mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-06 02:01:50 +08:00
use const for pointer fields of INNER_RES
This commit is contained in:
@@ -4584,17 +4584,15 @@ typedef unsigned long RES_KEY;
|
||||
/* define the incore res type */
|
||||
typedef struct _INNER_RES {
|
||||
RES_KEY key;
|
||||
Uint8* data;
|
||||
const Uint8* data;
|
||||
int data_len;
|
||||
|
||||
/* special param recognized by the TYPE_OPS
|
||||
* normal is null.
|
||||
* is the data is a mem of raw png, jpeg, bmp
|
||||
* and so on, it should be the extention name
|
||||
* of the filename. eg.
|
||||
/* A special param recognized by the TYPE_OPS; normally is NULL.
|
||||
* If the data is a raw png, jpeg, bmp file content,
|
||||
* it should be the extention name of the filename:
|
||||
* INNER_RES res[]= { ... { ..., ... ,.., "png" } .. };
|
||||
* */
|
||||
void* additional;
|
||||
const void* additional;
|
||||
} INNER_RES;
|
||||
|
||||
/* the type of resource */
|
||||
|
||||
@@ -112,6 +112,8 @@ static inline void reset_hidecursor_sem (void)
|
||||
#ifdef _DEBUG
|
||||
if (ret == -1)
|
||||
perror ("reset_hidecursor_sem");
|
||||
#else
|
||||
ret = ret + 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -83,8 +83,10 @@ static pthread_mutex_t timerLock;
|
||||
#endif /* __LINUX__ */
|
||||
|
||||
#ifdef _MG_USE_BETTER_TIMER
|
||||
#ifdef _MGRM_THREADS
|
||||
#include <sys/times.h>
|
||||
static clock_t g_timer_started;
|
||||
#endif
|
||||
static clock_t g_last_tick;
|
||||
#endif
|
||||
|
||||
@@ -95,7 +97,7 @@ static void __mg_timer_action (void *data)
|
||||
SHAREDRES_TIMER_COUNTER += 1;
|
||||
#else
|
||||
|
||||
#if defined(__uClinux__) && defined(_MGRM_STANDALONE)
|
||||
#if defined(_MGRM_STANDALONE)
|
||||
__mg_timer_counter += 10;
|
||||
#else
|
||||
# ifdef _MG_USE_BETTER_TIMER
|
||||
|
||||
@@ -931,7 +931,7 @@ static void* img_get_res_data(RESOURCE* res, int src_type, DWORD usr_param)
|
||||
INNER_RES* inner = res->source.inner;
|
||||
if(inner->additional == NULL) {
|
||||
// raw bitmap
|
||||
res->data = inner->data;
|
||||
res->data = (void*)inner->data;
|
||||
}
|
||||
else {
|
||||
BITMAP *pbmp = NEW(BITMAP);
|
||||
@@ -1174,7 +1174,7 @@ static void* etc_get_res_data(RESOURCE* res, int src_type, DWORD usr_param)
|
||||
break;
|
||||
}
|
||||
case REF_SRC_INNER:
|
||||
res->data = res->source.inner->data;
|
||||
res->data = (void*)res->source.inner->data;
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user