diff --git a/libretro-common/audio/dsp_filters/vibrato.c b/libretro-common/audio/dsp_filters/vibrato.c index 2db906bb03..0f3a804cde 100644 --- a/libretro-common/audio/dsp_filters/vibrato.c +++ b/libretro-common/audio/dsp_filters/vibrato.c @@ -90,7 +90,7 @@ float vibratocore_core(struct vibrato_core *core,float in) float lfo = sin(M * 2. * M_PI * core->phase++); int maxdelay = VIBRATO_BASE_DELAY_SEC * core->samplerate; core->phase = core->phase % maxphase; - lfo = (lfo + 1) * 1.; // transform from [-1; 1] to [0; 1] + lfo = (lfo + 1) * 1.; /* Transform from [-1; 1] to [0; 1] */ delay = lfo * core->depth * maxdelay; delay += VIBRATO_ADD_DELAY; readindex = core->writeindex - 1 - delay; diff --git a/libretro-common/encodings/encoding_crc32.c b/libretro-common/encodings/encoding_crc32.c index 79e2b177fb..f18f8ad3fe 100644 --- a/libretro-common/encodings/encoding_crc32.c +++ b/libretro-common/encodings/encoding_crc32.c @@ -37,7 +37,7 @@ uint32_t encoding_crc32(uint32_t crc, const uint8_t *data, size_t len) { crc = ~crc; - // Align data if it is not aligned + /* Align data if it is not aligned */ while (((uintptr_t)data & 7) && len > 0) { crc = __crc32b(crc, *(uint8_t *)data); diff --git a/libretro-common/include/array/rbuf.h b/libretro-common/include/array/rbuf.h index deb045fbbb..9af8769cb0 100644 --- a/libretro-common/include/array/rbuf.h +++ b/libretro-common/include/array/rbuf.h @@ -50,11 +50,11 @@ * -- Explicitly increase allocated memory and set capacity: * RBUF_FIT(buf, 100); * -- now RBUF_LEN(buf) == 0, RBUF_CAP(buf) == 100 - * + * * -- Resize buffer (does not initialize or zero memory!) * RBUF_RESIZE(buf, 200); * -- now RBUF_LEN(buf) == 200, RBUF_CAP(buf) == 200 - * + * * -- To handle running out of memory: * bool ran_out_of_memory = !RBUF_TRYFIT(buf, 1000); * -- before RESIZE or PUSH. When out of memory, buf will stay unmodified. @@ -89,7 +89,7 @@ struct rbuf__hdr __attribute__((__unused__)) #elif defined(_MSC_VER) #pragma warning(push) -#pragma warning(disable:4505) //unreferenced local function has been removed +#pragma warning(disable:4505) /* Unreferenced local function has been removed */ #endif static void *rbuf__grow(void *buf, size_t new_len, size_t elem_size) diff --git a/libretro-common/include/array/rhmap.h b/libretro-common/include/array/rhmap.h index 7427433d3f..22de502e59 100644 --- a/libretro-common/include/array/rhmap.h +++ b/libretro-common/include/array/rhmap.h @@ -131,7 +131,7 @@ #if defined(_MSC_VER) #pragma warning(push) -#pragma warning(disable:4505) //unreferenced local function has been removed +#pragma warning(disable:4505) /* Unreferenced local function has been removed */ #endif #define RHMAP_SET_FULL(b, key, str, val) (RHMAP__FIT1(b), b[rhmap__idx(RHMAP__HDR(b), (key), (str), 1, 0)] = (val)) diff --git a/libretro-common/include/defines/psp_defines.h b/libretro-common/include/defines/psp_defines.h index 5f7b7cf08d..9aa6814e51 100644 --- a/libretro-common/include/defines/psp_defines.h +++ b/libretro-common/include/defines/psp_defines.h @@ -51,7 +51,7 @@ int sceClibPrintf ( const char * format, ... ); #define PSP_FB_HEIGHT 544 #define PSP_PITCH_PIXELS 1024 - // Memory left to the system for threads and other internal stuffs +/* Memory left to the system for threads and other internal stuffs */ #ifdef SCE_LIBC_SIZE #define RAM_THRESHOLD 0x2000000 + SCE_LIBC_SIZE #else diff --git a/libretro-common/include/glsym/switch/nx_gl.h b/libretro-common/include/glsym/switch/nx_gl.h index f4f37c07d9..17c654ee76 100644 --- a/libretro-common/include/glsym/switch/nx_gl.h +++ b/libretro-common/include/glsym/switch/nx_gl.h @@ -35,7 +35,7 @@ extern "C" { #define APIENTRYP APIENTRY * #endif -// GL.h types +/* GL.h types */ typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; @@ -52,7 +52,7 @@ typedef float GLclampf; /* single precision float in [0,1] */ typedef double GLdouble; /* double precision float */ typedef double GLclampd; /* double precision float in [0,1] */ -// GL.h defines +/* GL.h defines */ #define GL_ARB_imaging 1 #define GL_FALSE 0 #define GL_TRUE 1 @@ -845,4 +845,4 @@ typedef double GLclampd; /* double precision float in [0,1] */ } #endif -#endif // __NX_GL_H__ +#endif /* __NX_GL_H__ */ diff --git a/libretro-common/include/glsym/switch/nx_glsym.h b/libretro-common/include/glsym/switch/nx_glsym.h index ce112234c8..94863ebd5d 100644 --- a/libretro-common/include/glsym/switch/nx_glsym.h +++ b/libretro-common/include/glsym/switch/nx_glsym.h @@ -925,4 +925,4 @@ RGLSYMGLBINDTEXTURESPROC glBindTextures; #ifdef __cplusplus } #endif -#endif // __NX_GLSYM_H__ +#endif /* __NX_GLSYM_H__ */ diff --git a/libretro-common/libco/x86.c b/libretro-common/libco/x86.c index 24e5aa6ce2..b7d57d37a4 100644 --- a/libretro-common/libco/x86.c +++ b/libretro-common/libco/x86.c @@ -25,7 +25,7 @@ static thread_local long co_active_buffer[64]; static thread_local cothread_t co_active_handle = 0; static void (fastcall *co_swap)(cothread_t, cothread_t) = 0; -//ABI: fastcall +/* ABI: fastcall */ static unsigned char co_swap_function[] = { 0x89, 0x22, /* mov [edx],esp */ 0x8b, 0x21, /* mov esp,[ecx] */ diff --git a/libretro-common/rthreads/ctr_pthread.h b/libretro-common/rthreads/ctr_pthread.h index 5582af1a9d..46290c7844 100644 --- a/libretro-common/rthreads/ctr_pthread.h +++ b/libretro-common/rthreads/ctr_pthread.h @@ -162,7 +162,7 @@ static INLINE int pthread_create(pthread_t *thread, { s32 prio = 0; Thread new_ctr_thread; - int procnum = -2; // use default cpu + int procnum = -2; /* use default cpu */ bool isNew3DS; APT_CheckNew3DS(&isNew3DS); @@ -176,7 +176,7 @@ static INLINE int pthread_create(pthread_t *thread, mutex_inited = true; } - /*Must wait if attempting to launch 2 threads at once to prevent corruption of function pointer*/ + /* Must wait if attempting to launch 2 threads at once to prevent corruption of function pointer*/ while (LightLock_TryLock(&safe_double_thread_launch) != 0); svcGetThreadPriority(&prio, CUR_THREAD_HANDLE); diff --git a/libretro-common/rthreads/psp_pthread.h b/libretro-common/rthreads/psp_pthread.h index f320969db2..5669bf08d2 100644 --- a/libretro-common/rthreads/psp_pthread.h +++ b/libretro-common/rthreads/psp_pthread.h @@ -302,4 +302,4 @@ static INLINE int pthread_equal(pthread_t t1, pthread_t t2) return t1 == t2; } -#endif //_PSP_PTHREAD_WRAP__ +#endif /* _PSP_PTHREAD_WRAP__ */ diff --git a/libretro-common/test/string/test_stdstring.c b/libretro-common/test/string/test_stdstring.c index 4250c1f7d2..1706e442ca 100644 --- a/libretro-common/test/string/test_stdstring.c +++ b/libretro-common/test/string/test_stdstring.c @@ -268,7 +268,9 @@ START_TEST (test_utf8_util) ck_assert_uint_eq(3592, utf8_walk(tptr)); ck_assert_uint_eq(131108, utf8_walk(tptr)); - //ck_assert_uint_eq(1, utf8cpy(out, 64, test1, 1)); +#if 0 + ck_assert_uint_eq(1, utf8cpy(out, 64, test1, 1)); +#endif } END_TEST diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index b6781f2a33..314a3afce7 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -619,18 +619,26 @@ enum uico_driver_state_t *uico_st = uico_state_get_ptr(); rarch_setting_t *appicon_setting = menu_setting_find_enum(MENU_ENUM_LABEL_APPICON_SETTINGS); struct string_list *icons; - if (appicon_setting && uico_st->drv && uico_st->drv->get_app_icons && (icons = uico_st->drv->get_app_icons()) && icons->size > 1) + if ( appicon_setting + && uico_st->drv + && uico_st->drv->get_app_icons + && (icons = uico_st->drv->get_app_icons()) + && icons->size > 1) { + int i; + size_t len = 0; + char *options = NULL; + const char *icon_name; + appicon_setting->default_value.string = icons->elems[0].data; - int len = 0, i = 0; - const char *iconName = [[application alternateIconName] cStringUsingEncoding:kCFStringEncodingUTF8]; // need to ask uico_st for this - for (; i < (int)icons->size; i++) + icon_name = [[application alternateIconName] cStringUsingEncoding:kCFStringEncodingUTF8]; /* need to ask uico_st for this */ + for (i = 0; i < (int)icons->size; i++) { len += strlen(icons->elems[i].data) + 1; - if (string_is_equal(iconName, icons->elems[i].data)) + if (string_is_equal(icon_name, icons->elems[i].data)) appicon_setting->value.target.string = icons->elems[i].data; } - char *options = (char*)calloc(len, sizeof(char)); + options = (char*)calloc(len, sizeof(char)); string_list_join_concat(options, len, icons, "|"); if (appicon_setting->values) free((void*)appicon_setting->values); @@ -789,10 +797,10 @@ enum apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskAll; if (string_is_equal(apple_frontend_settings.orientations, "landscape")) - apple_frontend_settings.orientation_flags = + apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskLandscape; else if (string_is_equal(apple_frontend_settings.orientations, "portrait")) - apple_frontend_settings.orientation_flags = + apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; #endif diff --git a/ui/drivers/ui_qt.cpp b/ui/drivers/ui_qt.cpp index 64509a98cf..ca5b3363b7 100644 --- a/ui/drivers/ui_qt.cpp +++ b/ui/drivers/ui_qt.cpp @@ -2422,7 +2422,7 @@ QVector > MainWindow::getCoreInfo() core_info_ctx_firmware_t firmware_info; bool update_missing_firmware = false; bool set_missing_firmware = false; - settings_t *settings = config_get_ptr(); + settings_t *settings = config_get_ptr(); uint8_t flags = content_get_flags(); bool systemfiles_in_content_dir = settings->bools.systemfiles_in_content_dir; bool content_is_inited = flags & CONTENT_ST_FLAG_IS_INITED; @@ -2485,7 +2485,7 @@ QVector > MainWindow::getCoreInfo() /* Show the path that was checked */ snprintf(tmp, sizeof(tmp), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE_PATH), + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE_PATH), firmware_info.directory.system); hash["key"] = QString(tmp); @@ -4236,13 +4236,15 @@ static void* ui_application_qt_initialize(void) setlocale(LC_NUMERIC, "C"); #ifdef HAVE_WAYLAND #if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) - // This needs to match the name of the .desktop file in order for windows to be correctly associated on Wayland + /* This needs to match the name of the .desktop file in order for + * Windows to be correctly associated on Wayland */ ui_application.app->setDesktopFileName(WAYLAND_APP_ID); #endif #endif #endif { - /* Can't declare the pixmap at the top, because: "QPixmap: Must construct a QGuiApplication before a QPixmap" */ + /* Can't declare the pixmap at the top, because: + * "QPixmap: Must construct a QGuiApplication before a QPixmap" */ QImage iconImage(16, 16, QImage::Format_ARGB32); QPixmap iconPixmap; unsigned char *bits = iconImage.bits();