Commit 7e922836 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

wrc: Modify the error, warning and tracing functions to behave like all the…

wrc: Modify the error, warning and tracing functions to behave like all the other Wine tracing methods, that is to not append a '\n' to the message.
parent 22076e09
......@@ -272,7 +272,7 @@ static void string_to_upper(string_t *str)
}
else
{
internal_error(__FILE__, __LINE__, "Invalid string type %d", str->type);
internal_error(__FILE__, __LINE__, "Invalid string type %d\n", str->type);
}
}
......@@ -313,7 +313,7 @@ static void put_string(res_t *res, const string_t *str, enum str_e type, int ist
{
if (!check_unicode_conversion( str, newstr, codepage ))
error( "String %s does not convert identically to Unicode and back in codepage %d. "
"Try using a Unicode string instead.", str->str.cstr, codepage );
"Try using a Unicode string instead\n", str->str.cstr, codepage );
}
if (!isterm) put_word(res, newstr->size);
for(cnt = 0; cnt < newstr->size; cnt++)
......@@ -366,7 +366,7 @@ static void put_name_id(res_t *res, name_id_t *nid, int upcase, const language_t
}
else
{
internal_error(__FILE__, __LINE__, "Invalid name_id type %d", nid->type);
internal_error(__FILE__, __LINE__, "Invalid name_id type %d\n", nid->type);
}
}
......@@ -597,7 +597,7 @@ static res_t *dialog2res(name_id_t *name, dialog_t *dlg)
if(ctrl->ctlclass)
put_name_id(res, ctrl->ctlclass, TRUE, dlg->lvc.language);
else
internal_error(__FILE__, __LINE__, "Control has no control-class");
internal_error(__FILE__, __LINE__, "Control has no control-class\n");
if(ctrl->title)
put_name_id(res, ctrl->title, FALSE, dlg->lvc.language);
else
......@@ -665,10 +665,10 @@ static res_t *dialog2res(name_id_t *name, dialog_t *dlg)
else if(ctrl->ctlclass->type == name_str)
put_name_id(res, ctrl->ctlclass, FALSE, NULL);
else
error("Unknown control-class %04x", ctrl->ctlclass->name.i_name);
error("Unknown control-class %04x\n", ctrl->ctlclass->name.i_name);
}
else
internal_error(__FILE__, __LINE__, "Control has no control-class");
internal_error(__FILE__, __LINE__, "Control has no control-class\n");
if(ctrl->title)
put_name_id(res, ctrl->title, FALSE, NULL);
else
......@@ -772,7 +772,7 @@ static res_t *dialogex2res(name_id_t *name, dialogex_t *dlgex)
if(ctrl->ctlclass)
put_name_id(res, ctrl->ctlclass, TRUE, dlgex->lvc.language);
else
internal_error(__FILE__, __LINE__, "Control has no control-class");
internal_error(__FILE__, __LINE__, "Control has no control-class\n");
if(ctrl->title)
put_name_id(res, ctrl->title, FALSE, dlgex->lvc.language);
else
......@@ -1454,7 +1454,7 @@ static res_t *stringtable2res(stringtable_t *stt)
{
if(!stt->nentries)
{
warning("Empty internal stringtable");
warning("Empty internal stringtable\n");
continue;
}
name.type = name_ord;
......@@ -1591,7 +1591,7 @@ static void versionblock2res(res_t *res, ver_block_t *blk, int level, const lang
}
else
{
internal_error(__FILE__, __LINE__, "Invalid value indicator %d in VERSIONINFO", val->type);
internal_error(__FILE__, __LINE__, "Invalid value indicator %d in VERSIONINFO\n", val->type);
}
}
......@@ -1794,7 +1794,7 @@ char *prep_nid_for_label(const name_id_t *nid)
if((unsigned)*sptr < 0x80 && isprint(*sptr & 0xff))
buf[i] = *sptr++;
else
warning("Resourcename (str_unicode) contain unprintable characters or invalid translation, ignored");
warning("Resourcename (str_unicode) contain unprintable characters or invalid translation, ignored\n");
}
buf[i] = '\0';
}
......@@ -1809,7 +1809,7 @@ char *prep_nid_for_label(const name_id_t *nid)
if((unsigned)*cptr < 0x80 && isprint(*cptr & 0xff))
buf[i] = *cptr++;
else
warning("Resourcename (str_char) contain unprintable characters, ignored");
warning("Resourcename (str_char) contain unprintable characters, ignored\n");
}
buf[i] = '\0';
}
......@@ -1819,7 +1819,7 @@ char *prep_nid_for_label(const name_id_t *nid)
}
else
{
internal_error(__FILE__, __LINE__, "Resource name_id with invalid type %d", nid->type);
internal_error(__FILE__, __LINE__, "Resource name_id with invalid type %d\n", nid->type);
}
return buf;
}
......@@ -2000,7 +2000,7 @@ void resources2res(resource_t *top)
top->binres = anicurico2res(top->name, top->res.ani, top->type);
break;
default:
internal_error(__FILE__, __LINE__, "Unknown resource type encountered %d in binary res generation", top->type);
internal_error(__FILE__, __LINE__, "Unknown resource type encountered %d in binary res generation\n", top->type);
}
top->c_name = make_c_name(get_c_typename(top->type), top->name, top->lan);
top = top->next;
......
......@@ -327,7 +327,7 @@ static int convert_bitmap(char *data, int size)
type |= FL_SIZEBE | FL_OS2;
}
else
parser_error("Invalid bitmap format, bih->biSize = %d", bih->biSize);
parser_error("Invalid bitmap format, bih->biSize = %d\n", bih->biSize);
switch(type)
{
......@@ -336,12 +336,12 @@ static int convert_bitmap(char *data, int size)
case FL_SIZEBE:
case FL_SIZEBE | FL_V4:
case FL_SIZEBE | FL_OS2:
parser_warning("Bitmap v%c signature little-endian, but size big-endian", type & FL_V4 ? '4' : '3');
parser_warning("Bitmap v%c signature little-endian, but size big-endian\n", type & FL_V4 ? '4' : '3');
break;
case FL_SIGBE:
case FL_SIGBE | FL_V4:
case FL_SIGBE | FL_OS2:
parser_warning("Bitmap v%c signature big-endian, but size little-endian", type & FL_V4 ? '4' : '3');
parser_warning("Bitmap v%c signature big-endian, but size little-endian\n", type & FL_V4 ? '4' : '3');
break;
}
......@@ -461,7 +461,7 @@ static void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico)
else if(BYTESWAP_WORD(ih->type) == 1)
swap = 1;
else
parser_error("Icon resource data has invalid type id %d", ih->type);
parser_error("Icon resource data has invalid type id %d\n", ih->type);
cnt = swap ? BYTESWAP_WORD(ih->count) : ih->count;
for(i = 0; i < cnt; i++)
......@@ -481,7 +481,7 @@ static void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico)
}
if(ide.offset > rd->size
|| ide.offset + ide.ressize > rd->size)
parser_error("Icon resource data corrupt");
parser_error("Icon resource data corrupt\n");
ico->width = ide.width;
ico->height = ide.height;
ico->nclr = ide.nclr;
......@@ -556,7 +556,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur)
else if(BYTESWAP_WORD(ch->type) == 2)
swap = 1;
else
parser_error("Cursor resource data has invalid type id %d", ch->type);
parser_error("Cursor resource data has invalid type id %d\n", ch->type);
cnt = swap ? BYTESWAP_WORD(ch->count) : ch->count;
for(i = 0; i < cnt; i++)
{
......@@ -575,7 +575,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur)
}
if(cde.offset > rd->size
|| cde.offset + cde.ressize > rd->size)
parser_error("Cursor resource data corrupt");
parser_error("Cursor resource data corrupt\n");
cur->width = cde.width;
cur->height = cde.height;
cur->nclr = cde.nclr;
......@@ -598,7 +598,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur)
cur->bits = info.biBitCount;
}
if(!win32 && (cur->planes != 1 || cur->bits != 1))
parser_warning("Win16 cursor contains colors");
parser_warning("Win16 cursor contains colors\n");
cur->xhot = swap ? BYTESWAP_WORD(cde.xhot) : cde.xhot;
cur->yhot = swap ? BYTESWAP_WORD(cde.yhot) : cde.yhot;
cur->data = new_raw_data();
......@@ -840,7 +840,7 @@ ani_curico_t *new_ani_curico(enum res_e type, raw_data_t *rd, int *memopt)
else if(rtp->size + 2*sizeof(DWORD) == rd->size)
isswapped = 0;
else
parser_error("Animated %s has an invalid RIFF length", anistr);
parser_error("Animated %s has an invalid RIFF length\n", anistr);
switch(byteorder)
{
......@@ -1002,7 +1002,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
msg->memopt = WRC_MO_MOVEABLE | WRC_MO_PURE;
if(rd->size < sizeof(DWORD))
parser_error("Invalid messagetable, size too small");
parser_error("Invalid messagetable, size too small\n");
nblk = *(DWORD *)rd->data;
lo = WRC_LOWORD(nblk);
......@@ -1017,9 +1017,9 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
* the ID, offset and length (and flag) fields to be very sure.
*/
if(hi && lo)
internal_error(__FILE__, __LINE__, "Messagetable contains more than 65535 blocks; cannot determine endian");
internal_error(__FILE__, __LINE__, "Messagetable contains more than 65535 blocks; cannot determine endian\n");
if(!hi && !lo)
parser_error("Invalid messagetable block count 0");
parser_error("Invalid messagetable block count 0\n");
if(!hi && lo) /* Messagetable byteorder == native byteorder */
{
......@@ -1032,7 +1032,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
mbp = (msgtab_block_t *)&(((DWORD *)rd->data)[1]);
if(MSGTAB_BAD_PTR(mbp, rd->data, rd->size, nblk * sizeof(*mbp)))
parser_error("Messagetable's blocks are outside of defined data");
parser_error("Messagetable's blocks are outside of defined data\n");
for(i = 0; i < nblk; i++)
{
msgtab_entry_t *mep, *next_mep;
......@@ -1043,7 +1043,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))
parser_error("Messagetable's data for block %d, ID 0x%08x is outside of defined data", i, id);
parser_error("Messagetable's data for block %d, ID 0x%08x is outside of defined data\n", i, id);
if(mep->flags == 1) /* Docu says 'flags == 0x0001' for unicode */
{
WORD *wp = (WORD *)&mep[1];
......@@ -1051,7 +1051,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
int n;
if(mep->length & 1)
parser_error("Message 0x%08x is unicode (block %d), but has odd length (%d)", id, i, mep->length);
parser_error("Message 0x%08x is unicode (block %d), but has odd length (%d)\n", id, i, mep->length);
for(n = 0; n < l; n++)
wp[n] = BYTESWAP_WORD(wp[n]);
......@@ -1079,7 +1079,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
mbp = (msgtab_block_t *)&(((DWORD *)rd->data)[1]);
nblk = BYTESWAP_DWORD(nblk);
if(MSGTAB_BAD_PTR(mbp, rd->data, rd->size, nblk * sizeof(*mbp)))
parser_error("Messagetable's blocks are outside of defined data");
parser_error("Messagetable's blocks are outside of defined data\n");
for(i = 0; i < nblk; i++)
{
msgtab_entry_t *mep;
......@@ -1096,7 +1096,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))
parser_error("Messagetable's data for block %d, ID 0x%08x is outside of defined data", i, id);
parser_error("Messagetable's data for block %d, ID 0x%08x is outside of defined data\n", i, id);
if(mep->flags == 1) /* Docu says 'flags == 0x0001' for unicode */
{
WORD *wp = (WORD *)&mep[1];
......@@ -1104,7 +1104,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
int n;
if(mep->length & 1)
parser_error("Message 0x%08x is unicode (block %d), but has odd length (%d)", id, i, mep->length);
parser_error("Message 0x%08x is unicode (block %d), but has odd length (%d)\n", id, i, mep->length);
for(n = 0; n < l; n++)
wp[n] = BYTESWAP_WORD(wp[n]);
......
......@@ -324,10 +324,10 @@ static struct keyword *iskeyword(char *kw)
yy_pop_state();
lineno = (int)strtol(yytext, &cptr, 10);
if(!lineno)
parser_error("Malformed '#...' line-directive; invalid linenumber");
parser_error("Malformed '#...' line-directive; invalid linenumber\n");
fname = strchr(cptr, '"');
if(!fname)
parser_error("Malformed '#...' line-directive; missing filename");
parser_error("Malformed '#...' line-directive; missing filename\n");
fname++;
cptr = strchr(fname, '"');
if(!cptr)
......@@ -344,7 +344,7 @@ static struct keyword *iskeyword(char *kw)
}
<pp_pragma>code_page[^\n]* yyless(9); yy_pop_state(); yy_push_state(pp_code_page);
<pp_pragma>[^\n]* yy_pop_state(); if (pedantic) parser_warning("Unrecognized #pragma directive '%s'",yytext);
<pp_pragma>[^\n]* yy_pop_state(); if (pedantic) parser_warning("Unrecognized #pragma directive '%s'\n",yytext);
<pp_code_page>\({ws}*default{ws}*\)[^\n]* current_codepage = -1; yy_pop_state();
<pp_code_page>\({ws}*utf8{ws}*\)[^\n]* current_codepage = CP_UTF8; yy_pop_state();
......@@ -355,11 +355,11 @@ static struct keyword *iskeyword(char *kw)
current_codepage = strtol( p, NULL, 10 );
if (current_codepage && current_codepage != CP_UTF8 && !wine_cp_get_table( current_codepage ))
{
parser_error("Codepage %d not supported", current_codepage);
parser_error("Codepage %d not supported\n", current_codepage);
current_codepage = 0;
}
}
<pp_code_page>[^\n]* yy_pop_state(); parser_error("Malformed #pragma code_page directive");
<pp_code_page>[^\n]* yy_pop_state(); parser_error("Malformed #pragma code_page directive\n");
/*
* Strip everything until a ';' taking
......@@ -423,7 +423,7 @@ L\" {
unsigned int result;
result = strtoul(yytext+1, 0, 8);
if ( result > 0xffff )
parser_error("Character constant out of range");
parser_error("Character constant out of range\n");
addwchar((WCHAR)result);
}
<tklstr>\\x[0-9a-fA-F]{4} { /* hex escape sequence */
......@@ -431,9 +431,9 @@ L\" {
result = strtoul(yytext+2, 0, 16);
addwchar((WCHAR)result);
}
<tklstr>\\x[0-9a-fA-F]{1,3} { parser_error("Invalid hex escape sequence '%s'", yytext); }
<tklstr>\\x[0-9a-fA-F]{1,3} { parser_error("Invalid hex escape sequence '%s'\n", yytext); }
<tklstr>\\[0-9]+ parser_error("Bad escape sequence");
<tklstr>\\[0-9]+ parser_error("Bad escape sequence\n");
<tklstr>\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
<tklstr>\\a addwchar('\a');
<tklstr>\\b addwchar('\b');
......@@ -452,7 +452,7 @@ L\" {
while(*yptr) /* FIXME: codepage translation */
addwchar(*yptr++ & 0xff);
}
<tklstr>\n parser_error("Unterminated string");
<tklstr>\n parser_error("Unterminated string\n");
/*
* Normal string scanning
......@@ -468,7 +468,7 @@ L\" {
int result;
result = strtol(yytext+1, 0, 8);
if ( result > 0xff )
parser_error("Character constant out of range");
parser_error("Character constant out of range\n");
addcchar((char)result);
}
<tkstr>\\x[0-9a-fA-F]{2} { /* hex escape sequence */
......@@ -476,9 +476,9 @@ L\" {
result = strtol(yytext+2, 0, 16);
addcchar((char)result);
}
<tkstr>\\x[0-9a-fA-F] { parser_error("Invalid hex escape sequence '%s'", yytext); }
<tkstr>\\x[0-9a-fA-F] { parser_error("Invalid hex escape sequence '%s'\n", yytext); }
<tkstr>\\[0-9]+ parser_error("Bad escape sequence");
<tkstr>\\[0-9]+ parser_error("Bad escape sequence\n");
<tkstr>\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
<tkstr>\\a addcchar('\a');
<tkstr>\\b addcchar('\b');
......@@ -497,7 +497,7 @@ L\" {
<tkstr>\"\" addcchar('\"'); /* "bla""bla" -> "bla\"bla" */
<tkstr>\\\"\" addcchar('\"'); /* "bla\""bla" -> "bla\"bla" */
<tkstr>\"{ws}+\" ; /* "bla" "bla" -> "blabla" */
<tkstr>\n parser_error("Unterminated string");
<tkstr>\n parser_error("Unterminated string\n");
/*
* Raw data scanning
......@@ -518,7 +518,7 @@ L\" {
}
<tkrcd>{ws}+ ; /* Ignore space */
<tkrcd>\n line_number++; char_number = 1;
<tkrcd>. parser_error("Malformed data-line");
<tkrcd>. parser_error("Malformed data-line\n");
/*
* Comment stripping
......@@ -528,7 +528,7 @@ L\" {
yy_push_state(comment);
save_wanted_id = wanted_id;
if(!no_preprocess)
parser_warning("Found comments after preprocessing, please report");
parser_warning("Found comments after preprocessing, please report\n");
}
<comment>[^*\n]* ;
<comment>"*"+[^*/\n]* ;
......@@ -536,7 +536,7 @@ L\" {
<comment>"*"+"/" yy_pop_state(); want_id = save_wanted_id;
;[^\n]* want_id = wanted_id; /* not really comment, but left-over c-junk */
"//"[^\n]* want_id = wanted_id; if(!no_preprocess) parser_warning("Found comments after preprocessing, please report");
"//"[^\n]* want_id = wanted_id; if(!no_preprocess) parser_warning("Found comments after preprocessing, please report\n");
\n {
want_id = wanted_id;
......@@ -559,7 +559,7 @@ L\" {
line_number++;
char_number = 1;
}
parser_warning("Unmatched text '%c' (0x%02x) YY_START=%d",
parser_warning("Unmatched text '%c' (0x%02x) YY_START=%d\n",
isprint(*yytext & 0xff) ? *yytext : '.', *yytext, YY_START);
}
......@@ -575,7 +575,7 @@ static void addcchar(char c)
cbufalloc += 1024;
cbuffer = xrealloc(cbuffer, cbufalloc * sizeof(cbuffer[0]));
if(cbufalloc > 65536)
parser_warning("Reallocating string buffer larger than 64kB");
parser_warning("Reallocating string buffer larger than 64kB\n");
}
cbuffer[cbufidx++] = c;
}
......@@ -587,7 +587,7 @@ static void addwchar(WCHAR s)
wbufalloc += 1024;
wbuffer = xrealloc(wbuffer, wbufalloc * sizeof(wbuffer[0]));
if(wbufalloc > 65536)
parser_warning("Reallocating wide string buffer larger than 64kB");
parser_warning("Reallocating wide string buffer larger than 64kB\n");
}
wbuffer[wbufidx++] = s;
}
......@@ -604,7 +604,7 @@ static string_t *get_buffered_cstring(void)
if (!current_codepage || current_codepage == -1 || !win32) /* store as ANSI string */
{
if (!current_codepage) parser_error("Codepage set to Unicode only, cannot use ASCII string here");
if (!current_codepage) parser_error("Codepage set to Unicode only, cannot use ASCII string here\n");
return str;
}
else /* convert to Unicode before storing */
......@@ -612,7 +612,7 @@ static string_t *get_buffered_cstring(void)
string_t *str_w = convert_string( str, str_unicode, current_codepage );
if (!check_unicode_conversion( str, str_w, current_codepage ))
parser_error("String %s does not convert identically to Unicode and back in codepage %d. "
"Try using a Unicode string instead.", str->str.cstr, current_codepage );
"Try using a Unicode string instead\n", str->str.cstr, current_codepage );
free_string( str );
return str_w;
}
......
......@@ -106,7 +106,7 @@ static enum res_e res_type_from_id(const name_id_t *nid)
return res_usr;
if(nid->type != name_ord)
internal_error(__FILE__, __LINE__, "Invalid name_id descriptor %d", nid->type);
internal_error(__FILE__, __LINE__, "Invalid name_id descriptor %d\n", nid->type);
switch(nid->name.i_name)
{
......@@ -132,7 +132,7 @@ static enum res_e res_type_from_id(const name_id_t *nid)
case WRC_RT_VXD:
case WRC_RT_ANICURSOR:
case WRC_RT_ANIICON:
warning("Cannot be sure of resource type, using usertype settings");
warning("Cannot be sure of resource type, using usertype settings\n");
return res_usr;
}
}
......@@ -185,7 +185,7 @@ static resource_t *read_res32(FILE *fp)
totsize = hdrsize;
if(hdrsize & 3)
{
warning("Hu? .res header needed alignment (anything can happen now)");
warning("Hu? .res header needed alignment (anything can happen now)\n");
totsize += 4 - (hdrsize & 3);
}
totsize += ressize;
......@@ -217,7 +217,7 @@ static resource_t *read_res32(FILE *fp)
}
else if(get_word(idx) == 0)
{
error("ResType name has zero length (32 bit)");
error("ResType name has zero length (32 bit)\n");
}
else
{
......@@ -251,7 +251,7 @@ static resource_t *read_res32(FILE *fp)
}
else if(get_word(idx) == 0)
{
error("ResName name has zero length (32 bit)");
error("ResName name has zero length (32 bit)\n");
}
else
{
......@@ -328,7 +328,7 @@ static resource_t *read_res32(FILE *fp)
*/
static resource_t *read_res16(FILE *fp)
{
internal_error(__FILE__, __LINE__, "Can't yet read 16 bit .res files");
internal_error(__FILE__, __LINE__, "Can't yet read 16 bit .res files\n");
return NULL;
}
......@@ -351,7 +351,7 @@ resource_t *read_resfile(char *inname)
fp = fopen(inname, "rb");
if(!fp)
error("Could not open inputfile %s", inname);
error("Could not open inputfile %s\n", inname);
/* Determine 16 or 32 bit .res file */
if(fread(&rh, 1, sizeof(rh), fp) != sizeof(rh))
......@@ -361,16 +361,16 @@ resource_t *read_resfile(char *inname)
if(!memcmp(&emptyheader, &rh, sizeof(rh)))
is32bit = 1;
else if(!memcmp(&emptyheaderSWAPPED, &rh, sizeof(rh)))
error("Binary .res-file has its byteorder swapped");
error("Binary .res-file has its byteorder swapped\n");
else
is32bit = 0;
}
if(is32bit && !win32)
error("Cannot convert 32-bit .res-file into 16-bit resources (and will, hopefully never, implement it)");
error("Cannot convert 32-bit .res-file into 16-bit resources (and will, hopefully never, implement it)\n");
if(!is32bit && win32)
error("Cannot (yet) convert 16-bit .res-file into 32-bit resources");
error("Cannot (yet) convert 16-bit .res-file into 32-bit resources\n");
if(!is32bit)
{
......
......@@ -64,7 +64,6 @@ static void generic_msg(const char *s, const char *t, const char *n, va_list ap)
}
}
#endif
fprintf(stderr, "\n");
}
......@@ -93,7 +92,6 @@ void internal_error(const char *file, int line, const char *s, ...)
va_start(ap, s);
fprintf(stderr, "Internal error (please report) %s %d: ", file, line);
vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
va_end(ap);
exit(3);
}
......@@ -104,7 +102,6 @@ void error(const char *s, ...)
va_start(ap, s);
fprintf(stderr, "Error: ");
vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
va_end(ap);
exit(2);
}
......@@ -115,7 +112,6 @@ void warning(const char *s, ...)
va_start(ap, s);
fprintf(stderr, "Warning: ");
vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
va_end(ap);
}
......@@ -127,7 +123,6 @@ void chat(const char *s, ...)
va_start(ap, s);
fprintf(stderr, "FYI: ");
vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
va_end(ap);
}
}
......@@ -226,7 +221,7 @@ int compare_name_id(const name_id_t *n1, const name_id_t *n2)
}
else
{
internal_error(__FILE__, __LINE__, "Can't yet compare strings of mixed type");
internal_error(__FILE__, __LINE__, "Can't yet compare strings of mixed type\n");
}
}
else if(n1->type == name_ord && n2->type == name_str)
......@@ -234,7 +229,7 @@ int compare_name_id(const name_id_t *n1, const name_id_t *n2)
else if(n1->type == name_str && n2->type == name_ord)
return -1;
else
internal_error(__FILE__, __LINE__, "Comparing name-ids with unknown types (%d, %d)",
internal_error(__FILE__, __LINE__, "Comparing name-ids with unknown types (%d, %d)\n",
n1->type, n2->type);
return 0; /* Keep the compiler happy */
......@@ -247,7 +242,7 @@ string_t *convert_string(const string_t *str, enum str_e type, int codepage)
int res;
if (!codepage && str->type != type)
parser_error( "Current language is Unicode only, cannot convert string" );
parser_error( "Current language is Unicode only, cannot convert string\n" );
if((str->type == str_char) && (type == str_unicode))
{
......
......@@ -451,7 +451,7 @@ int main(int argc,char *argv[])
* no output was given.
*/
chat("Starting preprocess");
chat("Starting preprocess\n");
if (!preprocess_only)
{
......@@ -484,7 +484,7 @@ int main(int argc,char *argv[])
}
/* Go from .rc to .res */
chat("Starting parse");
chat("Starting parse\n");
if(!(parser_in = fopen(input_name, "rb")))
error("Could not open %s for input\n", input_name);
......@@ -507,7 +507,7 @@ int main(int argc,char *argv[])
/* Convert the internal lists to binary data */
resources2res(resource_top);
chat("Writing .res-file");
chat("Writing .res-file\n");
write_resfile(output_name, resource_top);
output_name = NULL;
......
......@@ -75,7 +75,7 @@ void write_resfile(char *outname, resource_t *top)
if(ret != res->size)
{
fclose(fo);
error("Error writing %s", outname);
error("Error writing %s\n", outname);
}
free(res);
}
......@@ -89,7 +89,7 @@ void write_resfile(char *outname, resource_t *top)
if(ret != top->binres->size)
{
fclose(fo);
error("Error writing %s", outname);
error("Error writing %s\n", outname);
}
if(win32 && (top->binres->size & 0x03))
{
......@@ -98,7 +98,7 @@ void write_resfile(char *outname, resource_t *top)
if(ret != 4 - (top->binres->size & 0x03))
{
fclose(fo);
error("Error writing %s", outname);
error("Error writing %s\n", outname);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment