add const to INNER_RES

This commit is contained in:
Vincent Wei
2019-04-15 15:54:39 +08:00
parent 4f51baac32
commit 76f4bf3661
2 changed files with 9 additions and 9 deletions
+5 -6
View File
@@ -4584,17 +4584,16 @@ 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
/* The special param recognized by the TYPE_OPS normally it is NULL.
* If data is the data is a mem of raw png, jpeg, bmp
* and so on, it should be the extention name
* of the filename. eg.
* of the filename. eg.
* INNER_RES res[]= { ... { ..., ... ,.., "png" } .. };
* */
void* additional;
const void* additional;
} INNER_RES;
/* the type of resource */
+4 -3
View File
@@ -928,11 +928,12 @@ 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);
if(LoadBitmapFromMem((HDC)usr_param, pbmp, inner->data, inner->data_len, (const char*)inner->additional) != 0)
if(LoadBitmapFromMem((HDC)usr_param, pbmp, inner->data,
inner->data_len, (const char*)inner->additional) != 0)
{
DELETE(pbmp);
return NULL;
@@ -1177,7 +1178,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;