Skip to content

Commit 2c09bec

Browse files
committed
requested fixes
1 parent 4f15c83 commit 2c09bec

File tree

13 files changed

+50
-60
lines changed

13 files changed

+50
-60
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ packages/
5555
*.so
5656
*.so.*
5757
*.dll
58-
*.obj
58+
./*.obj
59+
*.h.pch
5960

6061
# Emscripten
6162
emsdk
@@ -82,6 +83,7 @@ DerivedData/
8283

8384
# VSCode project
8485
.vscode
86+
.clangd
8587

8688
# Jetbrains project
8789
.idea/

src/external/glfw/src/context.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window,
359359
window->context.source = ctxconfig->source;
360360
window->context.client = GLFW_OPENGL_API;
361361

362-
previous = (_GLFWwindow*)_glfwPlatformGetTls(&_glfw.contextSlot);
362+
previous = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
363363
glfwMakeContextCurrent((GLFWwindow*) window);
364364
if (_glfwPlatformGetTls(&_glfw.contextSlot) != window)
365365
return GLFW_FALSE;
@@ -615,12 +615,12 @@ GLFWbool _glfwStringInExtensionString(const char* string, const char* extensions
615615

616616
GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
617617
{
618-
_GLFWwindow* window = (_GLFWwindow*) handle;
618+
_GLFWwindow* window = (_GLFWwindow *) handle;
619619
_GLFWwindow* previous;
620620

621621
_GLFW_REQUIRE_INIT();
622622

623-
previous = (_GLFWwindow*)_glfwPlatformGetTls(&_glfw.contextSlot);
623+
previous = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
624624

625625
if (window && window->context.client == GLFW_NO_API)
626626
{
@@ -647,7 +647,7 @@ GLFWAPI GLFWwindow* glfwGetCurrentContext(void)
647647

648648
GLFWAPI void glfwSwapBuffers(GLFWwindow* handle)
649649
{
650-
_GLFWwindow* window = (_GLFWwindow*) handle;
650+
_GLFWwindow* window = (_GLFWwindow *) handle;
651651
assert(window != NULL);
652652

653653
_GLFW_REQUIRE_INIT();
@@ -686,7 +686,7 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
686686

687687
_GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE);
688688

689-
window = (_GLFWwindow*)_glfwPlatformGetTls(&_glfw.contextSlot);
689+
window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
690690
if (!window)
691691
{
692692
_glfwInputError(GLFW_NO_CURRENT_CONTEXT,

src/external/glfw/src/egl_context.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
118118
return GLFW_FALSE;
119119
}
120120

121-
nativeConfigs = (EGLConfig*)_glfw_calloc(nativeCount, sizeof(EGLConfig));
121+
nativeConfigs = (EGLConfig *)_glfw_calloc(nativeCount, sizeof(EGLConfig));
122122
eglGetConfigs(_glfw.egl.display, nativeConfigs, nativeCount, &nativeCount);
123123

124124
usableConfigs = (_GLFWfbconfig *)_glfw_calloc(nativeCount, sizeof(_GLFWfbconfig));
@@ -308,7 +308,7 @@ static int extensionSupportedEGL(const char* extension)
308308

309309
static GLFWglproc getProcAddressEGL(const char* procname)
310310
{
311-
_GLFWwindow* window = (_GLFWwindow*)_glfwPlatformGetTls(&_glfw.contextSlot);
311+
_GLFWwindow* window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
312312
assert(window != NULL);
313313

314314
if (window->context.egl.client)
@@ -883,7 +883,7 @@ GLFWAPI EGLDisplay glfwGetEGLDisplay(void)
883883

884884
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle)
885885
{
886-
_GLFWwindow* window = (_GLFWwindow*) handle;
886+
_GLFWwindow* window = (_GLFWwindow *) handle;
887887
_GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_CONTEXT);
888888

889889
if (window->context.source != GLFW_EGL_CONTEXT_API)
@@ -897,7 +897,7 @@ GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle)
897897

898898
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle)
899899
{
900-
_GLFWwindow* window = (_GLFWwindow*) handle;
900+
_GLFWwindow* window = (_GLFWwindow *) handle;
901901
_GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_SURFACE);
902902

903903
if (window->context.source != GLFW_EGL_CONTEXT_API)

src/external/jar_mod.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ static bool jar_mod_load( jar_mod_context_t * modctx, void * mod_data, int mod_d
11481148
{
11491149
// 15 Samples modules support
11501150
// Shift the whole datas to make it look likes a standard 4 channels mod.
1151-
memcopy(&(modctx->song.signature), (void*)"M.K.", 4);
1151+
memcopy(&(modctx->song.signature), (void *)"M.K.", 4);
11521152
memcopy(&(modctx->song.length), &(modctx->song.samples[15]), 130);
11531153
memclear(&(modctx->song.samples[15]), 0, 480);
11541154
modmemory += 600;
@@ -1535,13 +1535,13 @@ mulong jar_mod_load_file(jar_mod_context_t * modctx, const char* filename)
15351535

15361536
if(fsize && fsize < 32*1024*1024)
15371537
{
1538-
modctx->modfile = (muchar*) JARMOD_MALLOC(fsize);
1538+
modctx->modfile = (muchar *) JARMOD_MALLOC(fsize);
15391539
modctx->modfilesize = fsize;
15401540
memset(modctx->modfile, 0, fsize);
15411541
fread(modctx->modfile, fsize, 1, f);
15421542
fclose(f);
1543-
1544-
if(!jar_mod_load(modctx, (void*)modctx->modfile, fsize)) fsize = 0;
1543+
1544+
if(!jar_mod_load(modctx, (void *)modctx->modfile, fsize)) fsize = 0;
15451545
} else fsize = 0;
15461546
}
15471547
return fsize;

src/external/jar_xm.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsam
123123
// * @param output buffer of 2*numsamples elements (A left and right value for each sample)
124124
// * @param numsamples number of samples to generate
125125
void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t numsamples) {
126-
float* musicBuffer = (float*)JARXM_MALLOC((2*numsamples)*sizeof(float));
126+
float* musicBuffer = (float *)JARXM_MALLOC((2*numsamples)*sizeof(float));
127127
jar_xm_generate_samples(ctx, musicBuffer, numsamples);
128128

129129
if(output){
@@ -136,7 +136,7 @@ void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t
136136
// * @param output buffer of 2*numsamples elements (A left and right value for each sample)
137137
// * @param numsamples number of samples to generate
138138
void jar_xm_generate_samples_8bit(jar_xm_context_t* ctx, char* output, size_t numsamples) {
139-
float* musicBuffer = (float*)JARXM_MALLOC((2*numsamples)*sizeof(float));
139+
float* musicBuffer = (float *)JARXM_MALLOC((2*numsamples)*sizeof(float));
140140
jar_xm_generate_samples(ctx, musicBuffer, numsamples);
141141

142142
if(output){
@@ -543,7 +543,7 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz
543543
#endif
544544

545545
bytes_needed = jar_xm_get_memory_needed_for_context(moddata, moddata_length);
546-
mempool = (char*)JARXM_MALLOC(bytes_needed);
546+
mempool = (char *)JARXM_MALLOC(bytes_needed);
547547
if(mempool == NULL && bytes_needed > 0) { /* JARXM_MALLOC() failed, trouble ahead */
548548
DEBUG("call to JARXM_MALLOC() failed, returned %p", (void*)mempool);
549549
return 2;
@@ -558,11 +558,11 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz
558558

559559
ctx->rate = rate;
560560
mempool = jar_xm_load_module(ctx, moddata, moddata_length, mempool);
561-
mempool = (char*)ALIGN_PTR(mempool, 16);
561+
mempool = (char *)ALIGN_PTR(mempool, 16);
562562

563563
ctx->channels = (jar_xm_channel_context_t*)mempool;
564564
mempool += ctx->module.num_channels * sizeof(jar_xm_channel_context_t);
565-
mempool = (char*)ALIGN_PTR(mempool, 16);
565+
mempool = (char *)ALIGN_PTR(mempool, 16);
566566

567567
ctx->default_global_volume = 1.f;
568568
ctx->global_volume = ctx->default_global_volume;
@@ -583,7 +583,7 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz
583583
ch->actual_panning = .5f;
584584
}
585585

586-
mempool = (char*)ALIGN_PTR(mempool, 16);
586+
mempool = (char *)ALIGN_PTR(mempool, 16);
587587
ctx->row_loop_count = (uint8_t *)mempool;
588588
mempool += MAX_NUM_ROWS * sizeof(uint8_t);
589589

@@ -681,14 +681,14 @@ uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t *ctx, uint16_t ch
681681

682682
//* Bound reader macros.
683683
//* If we attempt to read the buffer out-of-bounds, pretend that the buffer is infinitely padded with zeroes.
684-
#define READ_U8(offset) (((offset) < moddata_length) ? (*(uint8_t*)(moddata + (offset))) : 0)
684+
#define READ_U8(offset) (((offset) < moddata_length) ? (*(uint8_t *)(moddata + (offset))) : 0)
685685
#define READ_U16(offset) ((uint16_t)READ_U8(offset) | ((uint16_t)READ_U8((offset) + 1) << 8))
686686
#define READ_U32(offset) ((uint32_t)READ_U16(offset) | ((uint32_t)READ_U16((offset) + 2) << 16))
687687
#define READ_MEMCPY(ptr, offset, length) memcpy_pad(ptr, length, moddata, moddata_length, offset)
688688

689689
static void memcpy_pad(void *dst, size_t dst_len, const void *src, size_t src_len, size_t offset) {
690690
uint8_t *dst_c = (uint8_t *)dst;
691-
const uint8_t *src_c = (uint8_t*)src;
691+
const uint8_t *src_c = (uint8_t *)src;
692692

693693
/* how many bytes can be copied without overrunning `src` */
694694
size_t copy_bytes = (src_len >= offset) ? (src_len - offset) : 0;
@@ -808,10 +808,10 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
808808
mod->linear_interpolation = 1; // Linear interpolation can be set after loading
809809
mod->ramping = 1; // ramping can be set after loading
810810
mempool += mod->num_patterns * sizeof(jar_xm_pattern_t);
811-
mempool = (char*)ALIGN_PTR(mempool, 16);
811+
mempool = (char *)ALIGN_PTR(mempool, 16);
812812
mod->instruments = (jar_xm_instrument_t*)mempool;
813813
mempool += mod->num_instruments * sizeof(jar_xm_instrument_t);
814-
mempool = (char*)ALIGN_PTR(mempool, 16);
814+
mempool = (char *)ALIGN_PTR(mempool, 16);
815815
uint16_t flags = READ_U32(offset + 14);
816816
mod->frequency_type = (flags & (1 << 0)) ? jar_xm_LINEAR_FREQUENCIES : jar_xm_AMIGA_FREQUENCIES;
817817
ctx->default_tempo = READ_U16(offset + 16);
@@ -884,7 +884,7 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
884884

885885
offset += packed_patterndata_size;
886886
}
887-
mempool = (char*)ALIGN_PTR(mempool, 16);
887+
mempool = (char *)ALIGN_PTR(mempool, 16);
888888

889889
/* Read instruments */
890890
for(uint16_t i = 0; i < ctx->module.num_instruments; ++i) {
@@ -928,7 +928,7 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
928928
instr->panning_envelope.enabled = flags & (1 << 0);
929929
instr->panning_envelope.sustain_enabled = flags & (1 << 1);
930930
instr->panning_envelope.loop_enabled = flags & (1 << 2);
931-
instr->vibrato_type = (jar_xm_waveform_type_t )READ_U8(offset + 235);
931+
instr->vibrato_type = (jar_xm_waveform_type_t)READ_U8(offset + 235);
932932
if(instr->vibrato_type == 2) {
933933
instr->vibrato_type = (jar_xm_waveform_type_t)1;
934934
} else if(instr->vibrato_type == 1) {
@@ -976,7 +976,7 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
976976
sample->panning = (float)READ_U8(offset + 15) / 255.f;
977977
sample->relative_note = (int8_t)READ_U8(offset + 16);
978978
READ_MEMCPY(sample->name, 18, SAMPLE_NAME_LENGTH);
979-
sample->data = (float*)mempool;
979+
sample->data = (float *)mempool;
980980
if(sample->bits == 16) {
981981
/* 16 bit sample */
982982
mempool += sample->length * (sizeof(float) >> 1);
@@ -2223,7 +2223,7 @@ int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const
22232223
return 4;
22242224
}
22252225

2226-
char* data = (char*)JARXM_MALLOC(size + 1);
2226+
char* data = (char *)JARXM_MALLOC(size + 1);
22272227
if(!data || fread(data, 1, size, xmf) < size) {
22282228
fclose(xmf);
22292229
DEBUG_ERR(data ? "fread() failed" : "JARXM_MALLOC() failed");

src/external/qoa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ void *qoa_read(const char *filename, qoa_desc *qoa) {
733733
bytes_read = fread(data, 1, size, f);
734734
fclose(f);
735735

736-
sample_data = qoa_decode((const unsigned char*)data, bytes_read, qoa);
736+
sample_data = qoa_decode((const unsigned char *)data, bytes_read, qoa);
737737
QOA_FREE(data);
738738
return sample_data;
739739
}

src/external/tinyobj_loader_c.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static void parseFloat3(float *x, float *y, float *z, const char **token) {
454454
}
455455

456456
static unsigned int my_strnlen(const char *s, unsigned int n) {
457-
const char *p = (const char*)memchr(s, 0, n);
457+
const char *p = (const char *)memchr(s, 0, n);
458458
return p ? (unsigned int)(p - s) : n;
459459
}
460460

@@ -544,7 +544,7 @@ static void initMaterial(tinyobj_material_t *material) {
544544

545545
/* Implementation of string to int hashtable */
546546

547-
#define HASH_TABLE_ERROR 1
547+
#define HASH_TABLE_ERROR 1
548548
#define HASH_TABLE_SUCCESS 0
549549

550550
#define HASH_TABLE_DEFAULT_SIZE 10
@@ -609,7 +609,7 @@ static int hash_table_insert_value(unsigned long hash, long value, hash_table_t*
609609
{
610610
if (i >= hash_table->capacity)
611611
return HASH_TABLE_ERROR;
612-
index = (start_index + (i * i)) % hash_table->capacity;
612+
index = (start_index + (i * i)) % hash_table->capacity;
613613
}
614614

615615
entry = hash_table->entries + index;
@@ -970,7 +970,7 @@ int tinyobj_parse_mtl_file(tinyobj_material_t **materials_out,
970970
unsigned int *num_materials_out,
971971
const char *filename) {
972972
return tinyobj_parse_and_index_mtl_file(materials_out, num_materials_out, filename, NULL);
973-
}
973+
}
974974

975975

976976
typedef enum {
@@ -1269,7 +1269,7 @@ int tinyobj_parse_obj(tinyobj_attrib_t *attrib, tinyobj_shape_t **shapes,
12691269
if (is_line_ending(buf, i, end_idx)) {
12701270
line_infos[line_no].pos = prev_pos;
12711271
line_infos[line_no].len = i - prev_pos;
1272-
1272+
12731273
// ---- QUICK BUG FIX : https://github.com/raysan5/raylib/issues/3473
12741274
if ( i > 0 && buf[i-1] == '\r' ) line_infos[line_no].len--;
12751275
// --------
@@ -1284,7 +1284,7 @@ int tinyobj_parse_obj(tinyobj_attrib_t *attrib, tinyobj_shape_t **shapes,
12841284
}
12851285
}
12861286

1287-
commands = (Command *)TINYOBJ_MALLOC(sizeof(Command) * num_lines);
1287+
commands = (Command *)TINYOBJ_MALLOC(sizeof(Command) * num_lines);
12881288

12891289
create_hash_table(HASH_TABLE_DEFAULT_SIZE, &material_table);
12901290

@@ -1354,10 +1354,10 @@ int tinyobj_parse_obj(tinyobj_attrib_t *attrib, tinyobj_shape_t **shapes,
13541354
attrib->num_texcoords = (unsigned int)num_vt;
13551355
attrib->faces = (tinyobj_vertex_index_t *)TINYOBJ_MALLOC(sizeof(tinyobj_vertex_index_t) * num_f);
13561356
attrib->face_num_verts = (int *)TINYOBJ_MALLOC(sizeof(int) * num_faces);
1357-
1357+
13581358
attrib->num_faces = (unsigned int)num_faces;
13591359
attrib->num_face_num_verts = (unsigned int)num_f;
1360-
1360+
13611361
attrib->material_ids = (int *)TINYOBJ_MALLOC(sizeof(int) * num_faces);
13621362

13631363
for (i = 0; i < num_lines; i++) {
@@ -1379,7 +1379,7 @@ int tinyobj_parse_obj(tinyobj_attrib_t *attrib, tinyobj_shape_t **shapes,
13791379
}
13801380
*/
13811381
if (commands[i].material_name &&
1382-
commands[i].material_name_len >0)
1382+
commands[i].material_name_len >0)
13831383
{
13841384
/* Create a null terminated string */
13851385
char* material_name_null_term = (char*) TINYOBJ_MALLOC(commands[i].material_name_len + 1);
@@ -1528,7 +1528,7 @@ int tinyobj_parse_obj(tinyobj_attrib_t *attrib, tinyobj_shape_t **shapes,
15281528
}
15291529

15301530
destroy_hash_table(&material_table);
1531-
1531+
15321532
(*materials_out) = materials;
15331533
(*num_materials_out) = num_materials;
15341534

src/external/vox_loader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void Vox_FreeArrays(VoxArray3D* voxarray);
165165

166166
static void initArrayUShort(ArrayUShort* a, int initialSize)
167167
{
168-
a->array = (unsigned short*)VOX_MALLOC(initialSize * sizeof(unsigned short));
168+
a->array = (unsigned short *)VOX_MALLOC(initialSize * sizeof(unsigned short));
169169
a->used = 0;
170170
a->size = initialSize;
171171
}
@@ -366,7 +366,7 @@ static void Vox_SetVoxel(VoxArray3D* pvoxarray, int x, int y, int z, unsigned ch
366366
if (chunk->m_array == 0)
367367
{
368368
int size = CHUNKSIZE * CHUNKSIZE * CHUNKSIZE;
369-
chunk->m_array = (unsigned char*)VOX_MALLOC(size);
369+
chunk->m_array = (unsigned char *)VOX_MALLOC(size);
370370
chunk->arraySize = size;
371371
memset(chunk->m_array, 0, size);
372372

src/rgestures.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ typedef struct {
232232
// Global Variables Definition
233233
//----------------------------------------------------------------------------------
234234
static GesturesData GESTURES = {
235-
.Touch.firstId = -1,
236235
.current = GESTURE_NONE, // No current gesture detected
236+
.Touch.firstId = -1,
237237
.enabledFlags = 0b0000001111111111 // All gestures supported by default
238238
};
239239

0 commit comments

Comments
 (0)