mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-12 06:29:58 +00:00
Fix compiler warnings in Droid build
This commit is contained in:
parent
92369c3fdb
commit
184884635b
@ -2250,7 +2250,7 @@ static void RegisterIoHandler(unsigned int uSlot, iorfunction IOReadC0, iowfunct
|
||||
unsigned int base_addr = 0xC080 + (uSlot<<4); // uSlot == 4 => 0xC0C0 , uSlot == 5 => 0xC0D0
|
||||
if (IOReadC0)
|
||||
{
|
||||
assert(IOWriteC0);
|
||||
assert((uintptr_t)IOWriteC0);
|
||||
for (unsigned int i = 0; i < 16; i++)
|
||||
{
|
||||
cpu65_vmem_r[base_addr+i] = IOReadC0;
|
||||
|
@ -144,7 +144,7 @@ float audio_getLatency(void) {
|
||||
|
||||
void audio_registerBackend(AudioBackend_s *backend, long order) {
|
||||
backend_node_s *node = MALLOC(sizeof(backend_node_s));
|
||||
assert(node);
|
||||
assert((uintptr_t)node);
|
||||
node->next = NULL;
|
||||
node->order = order;
|
||||
node->backend = backend;
|
||||
|
@ -55,8 +55,8 @@ static void _log_rotate(bool performRotation) {
|
||||
|
||||
ASPRINTF(&logPath0, LOG_PATH_TEMPLATE, data_dir, PATH_SEPARATOR, (i-1));
|
||||
ASPRINTF(&logPath1, LOG_PATH_TEMPLATE, data_dir, PATH_SEPARATOR, i);
|
||||
assert(logPath0);
|
||||
assert(logPath1);
|
||||
assert((uintptr_t)logPath0);
|
||||
assert((uintptr_t)logPath1);
|
||||
|
||||
int ret = -1;
|
||||
TEMP_FAILURE_RETRY(ret = rename(logPath0, logPath1));
|
||||
@ -68,7 +68,7 @@ static void _log_rotate(bool performRotation) {
|
||||
|
||||
char *logPath = NULL;
|
||||
ASPRINTF(&logPath, LOG_PATH_TEMPLATE, data_dir, PATH_SEPARATOR, 0);
|
||||
assert(logPath);
|
||||
assert((uintptr_t)logPath);
|
||||
|
||||
TEMP_FAILURE_RETRY(logFd = open(logPath, O_WRONLY|O_CREAT|xflag, S_IRUSR|S_IWUSR));
|
||||
|
||||
|
@ -78,11 +78,11 @@ void log_outputString(const char * const str);
|
||||
# undef assert
|
||||
# define assert(e) \
|
||||
do { \
|
||||
if (LIKELY(e)) { \
|
||||
/* ... */ \
|
||||
if (LIKELY((e))) { \
|
||||
/* ... ALL GOOD ... */ \
|
||||
} else { \
|
||||
LOG( "!!! ASSERT !!! : " #e ); \
|
||||
sleep(1); \
|
||||
/*LOG( "!!! ASSERT !!! : " #e); */ \
|
||||
/*sleep(1); */ \
|
||||
__assert2(_MYFILE_, __LINE__, __func__, #e); \
|
||||
} \
|
||||
} while (0)
|
||||
|
@ -371,7 +371,7 @@ void emulator_registerStartupCallback(long order, startup_callback_f ctor) {
|
||||
pthread_mutex_lock(&mutex);
|
||||
|
||||
module_ctor_node_s *node = MALLOC(sizeof(module_ctor_node_s));
|
||||
assert(node);
|
||||
assert((uintptr_t)node);
|
||||
node->next = NULL;
|
||||
node->order = order;
|
||||
node->ctor = ctor;
|
||||
|
10
src/prefs.c
10
src/prefs.c
@ -62,7 +62,7 @@ void prefs_load(void) {
|
||||
ASPRINTF(&filePath, "%s/.apple2.json", HOMEDIR);
|
||||
}
|
||||
|
||||
assert(filePath);
|
||||
assert((uintptr_t)filePath);
|
||||
_prefs_load(filePath);
|
||||
|
||||
FREE(filePath);
|
||||
@ -264,7 +264,7 @@ bool prefs_setStringValue(const char *domain, const char * _NONNULL key, const c
|
||||
if (errCount <= 0) {
|
||||
errCount = json_createFromString("{}", &jsonRef);
|
||||
assert(errCount > 0);
|
||||
assert(jsonRef);
|
||||
assert((uintptr_t)jsonRef);
|
||||
}
|
||||
|
||||
ret = json_mapSetStringValue(jsonRef, key, val);
|
||||
@ -294,7 +294,7 @@ bool prefs_setLongValue(const char * _NONNULL domain, const char * _NONNULL key,
|
||||
if (errCount <= 0) {
|
||||
errCount = json_createFromString("{}", &jsonRef);
|
||||
assert(errCount > 0);
|
||||
assert(jsonRef);
|
||||
assert((uintptr_t)jsonRef);
|
||||
}
|
||||
|
||||
ret = json_mapSetLongValue(jsonRef, key, val);
|
||||
@ -324,7 +324,7 @@ bool prefs_setBoolValue(const char * _NONNULL domain, const char * _NONNULL key,
|
||||
if (errCount <= 0) {
|
||||
errCount = json_createFromString("{}", &jsonRef);
|
||||
assert(errCount > 0);
|
||||
assert(jsonRef);
|
||||
assert((uintptr_t)jsonRef);
|
||||
}
|
||||
|
||||
ret = json_mapSetBoolValue(jsonRef, key, val);
|
||||
@ -354,7 +354,7 @@ bool prefs_setFloatValue(const char * _NONNULL domain, const char * _NONNULL key
|
||||
if (errCount <= 0) {
|
||||
errCount = json_createFromString("{}", &jsonRef);
|
||||
assert(errCount > 0);
|
||||
assert(jsonRef);
|
||||
assert((uintptr_t)jsonRef);
|
||||
}
|
||||
|
||||
ret = json_mapSetFloatValue(jsonRef, key, val);
|
||||
|
@ -52,7 +52,7 @@ static inline void _set_alpha(unsigned int dstIdx) {
|
||||
}
|
||||
|
||||
static void _alertToModel(char *message, unsigned int messageCols, unsigned int messageRows) {
|
||||
assert(message);
|
||||
assert((uintptr_t)message);
|
||||
|
||||
isEnabled = false;
|
||||
|
||||
@ -93,7 +93,7 @@ static void _alertToModel(char *message, unsigned int messageCols, unsigned int
|
||||
hudElement->pixWidth = fbWidth;
|
||||
hudElement->pixHeight = fbHeight;
|
||||
hudElement->pixels = MALLOC(fbWidth * fbHeight * PIXEL_STRIDE);
|
||||
assert(hudElement->pixels);
|
||||
assert((uintptr_t)(hudElement->pixels));
|
||||
glhud_setupDefault(messageModel);
|
||||
|
||||
if (1) {
|
||||
|
@ -134,7 +134,7 @@ void *glhud_createDefault(void) {
|
||||
void *glhud_createCustom(unsigned int sizeofModel) {
|
||||
assert(sizeof(GLModelHUDElement) <= sizeofModel);
|
||||
GLModelHUDElement *hudElement = (GLModelHUDElement *)CALLOC(sizeofModel, 1);
|
||||
assert(hudElement);
|
||||
assert((uintptr_t)hudElement);
|
||||
hudElement->glyphMultiplier = 1;
|
||||
return hudElement;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ void glnode_registerNode(glnode_render_order_t order, GLNode node) {
|
||||
pthread_mutex_lock(&mutex);
|
||||
|
||||
glnode_array_node_s *arrayNode = MALLOC(sizeof(glnode_array_node_s));
|
||||
assert(arrayNode);
|
||||
assert((uintptr_t)arrayNode);
|
||||
arrayNode->next = NULL;
|
||||
arrayNode->last = NULL;
|
||||
arrayNode->order = order;
|
||||
|
@ -556,7 +556,7 @@ void video_registerBackend(video_backend_s *backend, long order) {
|
||||
assert(!video_initialized); // backends cannot be registered after we've picked one to use
|
||||
|
||||
backend_node_s *node = MALLOC(sizeof(backend_node_s));
|
||||
assert(node);
|
||||
assert((uintptr_t)node);
|
||||
node->next = NULL;
|
||||
node->order = order;
|
||||
node->backend = backend;
|
||||
|
Loading…
x
Reference in New Issue
Block a user