iC comments

This commit is contained in:
libretroadmin 2024-07-20 17:54:44 +02:00
parent 73afe24266
commit 60e0dd839a
13 changed files with 40 additions and 28 deletions

View File

@ -90,7 +90,7 @@ float vibratocore_core(struct vibrato_core *core,float in)
float lfo = sin(M * 2. * M_PI * core->phase++); float lfo = sin(M * 2. * M_PI * core->phase++);
int maxdelay = VIBRATO_BASE_DELAY_SEC * core->samplerate; int maxdelay = VIBRATO_BASE_DELAY_SEC * core->samplerate;
core->phase = core->phase % maxphase; 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 = lfo * core->depth * maxdelay;
delay += VIBRATO_ADD_DELAY; delay += VIBRATO_ADD_DELAY;
readindex = core->writeindex - 1 - delay; readindex = core->writeindex - 1 - delay;

View File

@ -37,7 +37,7 @@ uint32_t encoding_crc32(uint32_t crc, const uint8_t *data, size_t len)
{ {
crc = ~crc; crc = ~crc;
// Align data if it is not aligned /* Align data if it is not aligned */
while (((uintptr_t)data & 7) && len > 0) while (((uintptr_t)data & 7) && len > 0)
{ {
crc = __crc32b(crc, *(uint8_t *)data); crc = __crc32b(crc, *(uint8_t *)data);

View File

@ -50,11 +50,11 @@
* -- Explicitly increase allocated memory and set capacity: * -- Explicitly increase allocated memory and set capacity:
* RBUF_FIT(buf, 100); * RBUF_FIT(buf, 100);
* -- now RBUF_LEN(buf) == 0, RBUF_CAP(buf) == 100 * -- now RBUF_LEN(buf) == 0, RBUF_CAP(buf) == 100
* *
* -- Resize buffer (does not initialize or zero memory!) * -- Resize buffer (does not initialize or zero memory!)
* RBUF_RESIZE(buf, 200); * RBUF_RESIZE(buf, 200);
* -- now RBUF_LEN(buf) == 200, RBUF_CAP(buf) == 200 * -- now RBUF_LEN(buf) == 200, RBUF_CAP(buf) == 200
* *
* -- To handle running out of memory: * -- To handle running out of memory:
* bool ran_out_of_memory = !RBUF_TRYFIT(buf, 1000); * bool ran_out_of_memory = !RBUF_TRYFIT(buf, 1000);
* -- before RESIZE or PUSH. When out of memory, buf will stay unmodified. * -- before RESIZE or PUSH. When out of memory, buf will stay unmodified.
@ -89,7 +89,7 @@ struct rbuf__hdr
__attribute__((__unused__)) __attribute__((__unused__))
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:4505) //unreferenced local function has been removed #pragma warning(disable:4505) /* Unreferenced local function has been removed */
#endif #endif
static void *rbuf__grow(void *buf, static void *rbuf__grow(void *buf,
size_t new_len, size_t elem_size) size_t new_len, size_t elem_size)

View File

@ -131,7 +131,7 @@
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:4505) //unreferenced local function has been removed #pragma warning(disable:4505) /* Unreferenced local function has been removed */
#endif #endif
#define RHMAP_SET_FULL(b, key, str, val) (RHMAP__FIT1(b), b[rhmap__idx(RHMAP__HDR(b), (key), (str), 1, 0)] = (val)) #define RHMAP_SET_FULL(b, key, str, val) (RHMAP__FIT1(b), b[rhmap__idx(RHMAP__HDR(b), (key), (str), 1, 0)] = (val))

View File

@ -51,7 +51,7 @@ int sceClibPrintf ( const char * format, ... );
#define PSP_FB_HEIGHT 544 #define PSP_FB_HEIGHT 544
#define PSP_PITCH_PIXELS 1024 #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 #ifdef SCE_LIBC_SIZE
#define RAM_THRESHOLD 0x2000000 + SCE_LIBC_SIZE #define RAM_THRESHOLD 0x2000000 + SCE_LIBC_SIZE
#else #else

View File

@ -35,7 +35,7 @@ extern "C" {
#define APIENTRYP APIENTRY * #define APIENTRYP APIENTRY *
#endif #endif
// GL.h types /* GL.h types */
typedef unsigned int GLenum; typedef unsigned int GLenum;
typedef unsigned char GLboolean; typedef unsigned char GLboolean;
typedef unsigned int GLbitfield; 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 GLdouble; /* double precision float */
typedef double GLclampd; /* double precision float in [0,1] */ typedef double GLclampd; /* double precision float in [0,1] */
// GL.h defines /* GL.h defines */
#define GL_ARB_imaging 1 #define GL_ARB_imaging 1
#define GL_FALSE 0 #define GL_FALSE 0
#define GL_TRUE 1 #define GL_TRUE 1
@ -845,4 +845,4 @@ typedef double GLclampd; /* double precision float in [0,1] */
} }
#endif #endif
#endif // __NX_GL_H__ #endif /* __NX_GL_H__ */

View File

@ -925,4 +925,4 @@ RGLSYMGLBINDTEXTURESPROC glBindTextures;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // __NX_GLSYM_H__ #endif /* __NX_GLSYM_H__ */

View File

@ -25,7 +25,7 @@ static thread_local long co_active_buffer[64];
static thread_local cothread_t co_active_handle = 0; static thread_local cothread_t co_active_handle = 0;
static void (fastcall *co_swap)(cothread_t, cothread_t) = 0; static void (fastcall *co_swap)(cothread_t, cothread_t) = 0;
//ABI: fastcall /* ABI: fastcall */
static unsigned char co_swap_function[] = { static unsigned char co_swap_function[] = {
0x89, 0x22, /* mov [edx],esp */ 0x89, 0x22, /* mov [edx],esp */
0x8b, 0x21, /* mov esp,[ecx] */ 0x8b, 0x21, /* mov esp,[ecx] */

View File

@ -162,7 +162,7 @@ static INLINE int pthread_create(pthread_t *thread,
{ {
s32 prio = 0; s32 prio = 0;
Thread new_ctr_thread; Thread new_ctr_thread;
int procnum = -2; // use default cpu int procnum = -2; /* use default cpu */
bool isNew3DS; bool isNew3DS;
APT_CheckNew3DS(&isNew3DS); APT_CheckNew3DS(&isNew3DS);
@ -176,7 +176,7 @@ static INLINE int pthread_create(pthread_t *thread,
mutex_inited = true; 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); while (LightLock_TryLock(&safe_double_thread_launch) != 0);
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE); svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);

View File

@ -302,4 +302,4 @@ static INLINE int pthread_equal(pthread_t t1, pthread_t t2)
return t1 == t2; return t1 == t2;
} }
#endif //_PSP_PTHREAD_WRAP__ #endif /* _PSP_PTHREAD_WRAP__ */

View File

@ -268,7 +268,9 @@ START_TEST (test_utf8_util)
ck_assert_uint_eq(3592, utf8_walk(tptr)); ck_assert_uint_eq(3592, utf8_walk(tptr));
ck_assert_uint_eq(131108, 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 END_TEST

View File

@ -619,18 +619,26 @@ enum
uico_driver_state_t *uico_st = uico_state_get_ptr(); uico_driver_state_t *uico_st = uico_state_get_ptr();
rarch_setting_t *appicon_setting = menu_setting_find_enum(MENU_ENUM_LABEL_APPICON_SETTINGS); rarch_setting_t *appicon_setting = menu_setting_find_enum(MENU_ENUM_LABEL_APPICON_SETTINGS);
struct string_list *icons; 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; appicon_setting->default_value.string = icons->elems[0].data;
int len = 0, i = 0; icon_name = [[application alternateIconName] cStringUsingEncoding:kCFStringEncodingUTF8]; /* need to ask uico_st for this */
const char *iconName = [[application alternateIconName] cStringUsingEncoding:kCFStringEncodingUTF8]; // need to ask uico_st for this for (i = 0; i < (int)icons->size; i++)
for (; i < (int)icons->size; i++)
{ {
len += strlen(icons->elems[i].data) + 1; 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; 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, "|"); string_list_join_concat(options, len, icons, "|");
if (appicon_setting->values) if (appicon_setting->values)
free((void*)appicon_setting->values); free((void*)appicon_setting->values);
@ -789,10 +797,10 @@ enum
apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskAll; apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskAll;
if (string_is_equal(apple_frontend_settings.orientations, "landscape")) if (string_is_equal(apple_frontend_settings.orientations, "landscape"))
apple_frontend_settings.orientation_flags = apple_frontend_settings.orientation_flags =
UIInterfaceOrientationMaskLandscape; UIInterfaceOrientationMaskLandscape;
else if (string_is_equal(apple_frontend_settings.orientations, "portrait")) else if (string_is_equal(apple_frontend_settings.orientations, "portrait"))
apple_frontend_settings.orientation_flags = apple_frontend_settings.orientation_flags =
UIInterfaceOrientationMaskPortrait UIInterfaceOrientationMaskPortrait
| UIInterfaceOrientationMaskPortraitUpsideDown; | UIInterfaceOrientationMaskPortraitUpsideDown;
#endif #endif

View File

@ -2422,7 +2422,7 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
core_info_ctx_firmware_t firmware_info; core_info_ctx_firmware_t firmware_info;
bool update_missing_firmware = false; bool update_missing_firmware = false;
bool set_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(); uint8_t flags = content_get_flags();
bool systemfiles_in_content_dir = settings->bools.systemfiles_in_content_dir; bool systemfiles_in_content_dir = settings->bools.systemfiles_in_content_dir;
bool content_is_inited = flags & CONTENT_ST_FLAG_IS_INITED; bool content_is_inited = flags & CONTENT_ST_FLAG_IS_INITED;
@ -2485,7 +2485,7 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
/* Show the path that was checked */ /* Show the path that was checked */
snprintf(tmp, sizeof(tmp), 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); firmware_info.directory.system);
hash["key"] = QString(tmp); hash["key"] = QString(tmp);
@ -4236,13 +4236,15 @@ static void* ui_application_qt_initialize(void)
setlocale(LC_NUMERIC, "C"); setlocale(LC_NUMERIC, "C");
#ifdef HAVE_WAYLAND #ifdef HAVE_WAYLAND
#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) #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); ui_application.app->setDesktopFileName(WAYLAND_APP_ID);
#endif #endif
#endif #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); QImage iconImage(16, 16, QImage::Format_ARGB32);
QPixmap iconPixmap; QPixmap iconPixmap;
unsigned char *bits = iconImage.bits(); unsigned char *bits = iconImage.bits();