- Merge 25373
[reactos.git] / reactos / tools / wrc / newstruc.c
index c9c0560..8589b3c 100644 (file)
@@ -123,6 +123,20 @@ characts_t *dup_characts(characts_t *c)
        return new_characts(*c);
 }
 
+html_t *new_html(raw_data_t *rd, int *memopt)
+{
+       html_t *html = xmalloc(sizeof(html_t));
+       html->data = rd;
+       if(memopt)
+       {
+               html->memopt = *memopt;
+               free(memopt);
+       }
+       else
+               html->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE;
+       return html;
+}
+
 rcdata_t *new_rcdata(raw_data_t *rd, int *memopt)
 {
        rcdata_t *rc = (rcdata_t *)xmalloc(sizeof(rcdata_t));
@@ -311,8 +325,11 @@ static int convert_bitmap(char *data, int size)
        {
                type |= FL_SIZEBE | FL_OS2;
        }
-       else
-               yyerror("Invalid bitmap format, bih->biSize = %ld", bih->biSize);
+       else 
+       {
+               fprintf(stderr, "bisizel %d bosizel %d b4sizel %d\n", bisizel, bosizel, b4sizel);
+               yyerror("Invalid bitmap format, bih->biSize = %u", bih->biSize);
+       }
 
        switch(type)
        {
@@ -802,8 +819,7 @@ static void handle_ani_list(riff_tag_t *lst, enum res_e type, int isswapped)
                                       isprint(rtp->tag[2]) ? rtp->tag[2] : '.',
                                       isprint(rtp->tag[3]) ? rtp->tag[3] : '.');
 
-               /* FIXME: This relies in sizeof(DWORD) == sizeof(pointer_type) */
-               if((DWORD)rtp & 1)
+               if((UINT_PTR)rtp & 1)
                        rtp = SKIP_TAG(rtp,1);
        }
 }
@@ -858,8 +874,8 @@ ani_curico_t *new_ani_curico(enum res_e type, raw_data_t *rd, int *memopt)
                /* We only go through the RIFF file if we need to swap
                 * bytes in words/dwords. Else we couldn't care less
                 * what the file contains. This is consistent with
-                * MS' rc.exe, which doesn't complain at all, eventhough
-                * the fileformat might not be entirely correct.
+                * MS' rc.exe, which doesn't complain at all, even though
+                * the file format might not be entirely correct.
                 */
                rtp++;  /* Skip the "RIFF" tag */
 
@@ -913,8 +929,7 @@ ani_curico_t *new_ani_curico(enum res_e type, raw_data_t *rd, int *memopt)
                                       isprint(rtp->tag[2]) ? rtp->tag[2] : '.',
                                       isprint(rtp->tag[3]) ? rtp->tag[3] : '.');
 
-                       /* FIXME: This relies in sizeof(DWORD) == sizeof(pointer_type) */
-                       if((DWORD)rtp & 1)
+                       if((UINT_PTR)rtp & 1)
                                rtp = SKIP_TAG(rtp,1);
                }
 
@@ -1030,7 +1045,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
                        for(id = mbp[i].idlo; id <= mbp[i].idhi; id++)
                        {
                                if(MSGTAB_BAD_PTR(mep, rd->data, rd->size, mep->length))
-                                       yyerror("Messagetable's data for block %d, ID 0x%08lx is outside of defined data", (int)i, id);
+                                       yyerror("Messagetable's data for block %d, ID 0x%08x is outside of defined data", (int)i, id);
                                if(mep->flags == 1)     /* Docu says 'flags == 0x0001' for unicode */
                                {
                                        WORD *wp = (WORD *)&mep[1];
@@ -1038,7 +1053,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
                                        int n;
 
                                        if(mep->length & 1)
-                                               yyerror("Message 0x%08lx is unicode (block %d), but has odd length (%d)", id, (int)i, mep->length);
+                                               yyerror("Message 0x%08x is unicode (block %d), but has odd length (%d)", id, (int)i, mep->length);
                                        for(n = 0; n < l; n++)
                                                wp[n] = BYTESWAP_WORD(wp[n]);
 
@@ -1083,7 +1098,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
                                mep->flags  = BYTESWAP_WORD(mep->flags);
 
                                if(MSGTAB_BAD_PTR(mep, rd->data, rd->size, mep->length))
-                                       yyerror("Messagetable's data for block %d, ID 0x%08lx is outside of defined data", (int)i, id);
+                                       yyerror("Messagetable's data for block %d, ID 0x%08x is outside of defined data", (int)i, id);
                                if(mep->flags == 1)     /* Docu says 'flags == 0x0001' for unicode */
                                {
                                        WORD *wp = (WORD *)&mep[1];
@@ -1091,7 +1106,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
                                        int n;
 
                                        if(mep->length & 1)
-                                               yyerror("Message 0x%08lx is unicode (block %d), but has odd length (%d)", id, (int)i, mep->length);
+                                               yyerror("Message 0x%08x is unicode (block %d), but has odd length (%d)", id, (int)i, mep->length);
                                        for(n = 0; n < l; n++)
                                                wp[n] = BYTESWAP_WORD(wp[n]);