Commit 22076e09 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

wmc: Modify the error and warning functions to behave like all the other Wine…

wmc: Modify the error and warning functions to behave like all the other Wine tracing methods, that is to not append a '\n' to the message.
parent dc3feef0
...@@ -156,7 +156,7 @@ void set_codepage(int cp) ...@@ -156,7 +156,7 @@ void set_codepage(int cp)
codepage = cp; codepage = cp;
codepage_def = find_codepage(codepage); codepage_def = find_codepage(codepage);
if(!codepage_def) if(!codepage_def)
xyyerror("Codepage %d not found; cannot process", codepage); xyyerror("Codepage %d not found; cannot process\n", codepage);
} }
/* /*
...@@ -203,7 +203,7 @@ try_again: ...@@ -203,7 +203,7 @@ try_again:
assert(codepage_def != NULL); assert(codepage_def != NULL);
n = wine_cp_mbstowcs(codepage_def, 0, xlatebuffer, strlen(xlatebuffer)+1, inputbuffer, INPUTBUFFER_SIZE); n = wine_cp_mbstowcs(codepage_def, 0, xlatebuffer, strlen(xlatebuffer)+1, inputbuffer, INPUTBUFFER_SIZE);
if(n < 0) if(n < 0)
internal_error(__FILE__, __LINE__, "Could not translate to unicode (%d)", n); internal_error(__FILE__, __LINE__, "Could not translate to unicode (%d)\n", n);
if(n <= 1) if(n <= 1)
goto try_again; /* Should not hapen */ goto try_again; /* Should not hapen */
n--; /* Strip added conversion '\0' from input length */ n--; /* Strip added conversion '\0' from input length */
...@@ -224,7 +224,7 @@ try_again: ...@@ -224,7 +224,7 @@ try_again:
if(!n && ferror(yyin)) if(!n && ferror(yyin))
xyyerror(err_fatalread); xyyerror(err_fatalread);
else else
xyyerror("Fatal: file to short to determine byteorder (should never happen)"); xyyerror("Fatal: file to short to determine byteorder (should never happen)\n");
} }
if(isisochar(inputbuffer[0]) && if(isisochar(inputbuffer[0]) &&
isisochar(inputbuffer[1]) && isisochar(inputbuffer[1]) &&
...@@ -249,7 +249,7 @@ try_again: ...@@ -249,7 +249,7 @@ try_again:
#endif #endif
} }
else else
xyyerror("Fatal: cannot determine file's byteorder"); xyyerror("Fatal: cannot determine file's byteorder\n");
/* FIXME: /* FIXME:
* Determine the file-endian with the leader-bytes * Determine the file-endian with the leader-bytes
* "FF FE..."; can't remember the exact sequence. * "FF FE..."; can't remember the exact sequence.
...@@ -302,7 +302,7 @@ try_again: ...@@ -302,7 +302,7 @@ try_again:
if(!n) if(!n)
{ {
mcy_warning("Re-read line (input was or converted to zilch)"); mcy_warning("Re-read line (input was or converted to zilch)\n");
goto try_again; /* Should not happen, but could be due to stdin reading and a signal */ goto try_again; /* Should not happen, but could be due to stdin reading and a signal */
} }
...@@ -458,7 +458,7 @@ static int scan_number(int ch) ...@@ -458,7 +458,7 @@ static int scan_number(int ch)
while(1) while(1)
{ {
if(!isisochar(ch)) if(!isisochar(ch))
xyyerror("Invalid digit"); xyyerror("Invalid digit\n");
switch(state) switch(state)
{ {
...@@ -472,7 +472,7 @@ static int scan_number(int ch) ...@@ -472,7 +472,7 @@ static int scan_number(int ch)
state = 4; state = 4;
} }
else else
internal_error(__FILE__, __LINE__, "Non-digit in first number-scanner state"); internal_error(__FILE__, __LINE__, "Non-digit in first number-scanner state\n");
break; break;
case 1: case 1:
if(ch == 'x' || ch == 'X') if(ch == 'x' || ch == 'X')
...@@ -486,7 +486,7 @@ static int scan_number(int ch) ...@@ -486,7 +486,7 @@ static int scan_number(int ch)
state = 3; state = 3;
} }
else if(isalpha(ch) || ch == '_') else if(isalpha(ch) || ch == '_')
xyyerror("Invalid number digit"); xyyerror("Invalid number digit\n");
else else
{ {
unget_unichar(ch); unget_unichar(ch);
...@@ -498,7 +498,7 @@ static int scan_number(int ch) ...@@ -498,7 +498,7 @@ static int scan_number(int ch)
if(isxdigit(ch)) if(isxdigit(ch))
push_char(ch); push_char(ch);
else if(isalpha(ch) || ch == '_' || !isxdigit(tos_char_stack())) else if(isalpha(ch) || ch == '_' || !isxdigit(tos_char_stack()))
xyyerror("Invalid hex digit"); xyyerror("Invalid hex digit\n");
else else
{ {
base = 16; base = 16;
...@@ -509,7 +509,7 @@ static int scan_number(int ch) ...@@ -509,7 +509,7 @@ static int scan_number(int ch)
if(ch >= '0' && ch <= '7') if(ch >= '0' && ch <= '7')
push_char(ch); push_char(ch);
else if(isalnum(ch) || ch == '_') else if(isalnum(ch) || ch == '_')
xyyerror("Invalid octal digit"); xyyerror("Invalid octal digit\n");
else else
{ {
base = 8; base = 8;
...@@ -520,7 +520,7 @@ static int scan_number(int ch) ...@@ -520,7 +520,7 @@ static int scan_number(int ch)
if(isdigit(ch)) if(isdigit(ch))
push_char(ch); push_char(ch);
else if(isalnum(ch) || ch == '_') else if(isalnum(ch) || ch == '_')
xyyerror("Invalid decimal digit"); xyyerror("Invalid decimal digit\n");
else else
{ {
base = 10; base = 10;
...@@ -528,7 +528,7 @@ static int scan_number(int ch) ...@@ -528,7 +528,7 @@ static int scan_number(int ch)
} }
break; break;
default: default:
internal_error(__FILE__, __LINE__, "Invalid state in number-scanner"); internal_error(__FILE__, __LINE__, "Invalid state in number-scanner\n");
} }
ch = get_unichar(); ch = get_unichar();
} }
...@@ -626,7 +626,7 @@ int mcy_lex(void) ...@@ -626,7 +626,7 @@ int mcy_lex(void)
while((ch = get_unichar()) != '\n') while((ch = get_unichar()) != '\n')
{ {
if(ch == EOF) if(ch == EOF)
xyyerror("Unexpected EOF"); xyyerror("Unexpected EOF\n");
push_unichar(ch); push_unichar(ch);
} }
newline(); newline();
...@@ -710,7 +710,7 @@ int mcy_lex(void) ...@@ -710,7 +710,7 @@ int mcy_lex(void)
return tTOKEN; return tTOKEN;
default: default:
internal_error(__FILE__, __LINE__, "Invalid token type encountered"); internal_error(__FILE__, __LINE__, "Invalid token type encountered\n");
} }
} }
...@@ -741,7 +741,7 @@ int mcy_lex(void) ...@@ -741,7 +741,7 @@ int mcy_lex(void)
mcy_lval.str = xunistrdup(get_unichar_stack()); mcy_lval.str = xunistrdup(get_unichar_stack());
return tCOMMENT; return tCOMMENT;
default: default:
xyyerror("Invalid character '%c' (0x%04x)", isisochar(ch) && isprint(ch) ? ch : '.', ch); xyyerror("Invalid character '%c' (0x%04x)\n", isisochar(ch) && isprint(ch) ? ch : '.', ch);
} }
} }
} }
...@@ -122,7 +122,7 @@ static cp_xlat_t *find_cpxlat(int lan); ...@@ -122,7 +122,7 @@ static cp_xlat_t *find_cpxlat(int lan);
%% %%
file : items { file : items {
if(!check_languages(nodehead)) if(!check_languages(nodehead))
xyyerror("No messages defined"); xyyerror("No messages defined\n");
lanblockhead = block_messages(nodehead); lanblockhead = block_messages(nodehead);
} }
; ;
...@@ -165,7 +165,7 @@ global : tSEVNAMES '=' '(' smaps ')' ...@@ -165,7 +165,7 @@ global : tSEVNAMES '=' '(' smaps ')'
base = $3; base = $3;
break; break;
default: default:
xyyerror("Numberbase must be 8, 10 or 16"); xyyerror("Numberbase must be 8, 10 or 16\n");
} }
} }
| tBASE '=' error { xyyerror(err_number); } | tBASE '=' error { xyyerror(err_number); }
...@@ -184,7 +184,7 @@ smap : token '=' tNUMBER alias { ...@@ -184,7 +184,7 @@ smap : token '=' tNUMBER alias {
$1->token = $3; $1->token = $3;
$1->alias = $4; $1->alias = $4;
if($3 & (~0x3)) if($3 & (~0x3))
xyyerror("Severity value out of range (0x%08x > 0x3)", $3); xyyerror("Severity value out of range (0x%08x > 0x3)\n", $3);
do_add_token(tok_severity, $1, "severity"); do_add_token(tok_severity, $1, "severity");
} }
| token '=' error { xyyerror(err_number); } | token '=' error { xyyerror(err_number); }
...@@ -203,7 +203,7 @@ fmap : token '=' tNUMBER alias { ...@@ -203,7 +203,7 @@ fmap : token '=' tNUMBER alias {
$1->token = $3; $1->token = $3;
$1->alias = $4; $1->alias = $4;
if($3 & (~0xfff)) if($3 & (~0xfff))
xyyerror("Facility value out of range (0x%08x > 0xfff)", $3); xyyerror("Facility value out of range (0x%08x > 0xfff)\n", $3);
do_add_token(tok_facility, $1, "facility"); do_add_token(tok_facility, $1, "facility");
} }
| token '=' error { xyyerror(err_number); } | token '=' error { xyyerror(err_number); }
...@@ -229,9 +229,9 @@ lmap : token '=' tNUMBER setfile ':' tFILE optcp { ...@@ -229,9 +229,9 @@ lmap : token '=' tNUMBER setfile ':' tFILE optcp {
$1->codepage = $7; $1->codepage = $7;
do_add_token(tok_language, $1, "language"); do_add_token(tok_language, $1, "language");
if(!find_language($3) && !find_cpxlat($3)) if(!find_language($3) && !find_cpxlat($3))
mcy_warning("Language 0x%x not built-in, using codepage %d; use explicit codepage to override", $3, WMC_DEFAULT_CODEPAGE); mcy_warning("Language 0x%x not built-in, using codepage %d; use explicit codepage to override\n", $3, WMC_DEFAULT_CODEPAGE);
} }
| token '=' tNUMBER setfile ':' error { xyyerror("Filename expected"); } | token '=' tNUMBER setfile ':' error { xyyerror("Filename expected\n"); }
| token '=' tNUMBER error { xyyerror(err_colon); } | token '=' tNUMBER error { xyyerror(err_colon); }
| token '=' error { xyyerror(err_number); } | token '=' error { xyyerror(err_number); }
| token error { xyyerror(err_assign); } | token error { xyyerror(err_assign); }
...@@ -239,7 +239,7 @@ lmap : token '=' tNUMBER setfile ':' tFILE optcp { ...@@ -239,7 +239,7 @@ lmap : token '=' tNUMBER setfile ':' tFILE optcp {
optcp : /* Empty */ { $$ = 0; } optcp : /* Empty */ { $$ = 0; }
| ':' tNUMBER { $$ = $2; } | ':' tNUMBER { $$ = $2; }
| ':' error { xyyerror("Codepage-number expected"); } | ':' error { xyyerror("Codepage-number expected\n"); }
; ;
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
...@@ -253,7 +253,7 @@ cmaps : cmap ...@@ -253,7 +253,7 @@ cmaps : cmap
cmap : clan '=' tNUMBER ':' tNUMBER { cmap : clan '=' tNUMBER ':' tNUMBER {
static const char err_nocp[] = "Codepage %d not builtin; cannot convert"; static const char err_nocp[] = "Codepage %d not builtin; cannot convert";
if(find_cpxlat($1)) if(find_cpxlat($1))
xyyerror("Codepage translation already defined for language 0x%x", $1); xyyerror("Codepage translation already defined for language 0x%x\n", $1);
if($3 && !find_codepage($3)) if($3 && !find_codepage($3))
xyyerror(err_nocp, $3); xyyerror(err_nocp, $3);
if($5 && !find_codepage($5)) if($5 && !find_codepage($5))
...@@ -269,7 +269,7 @@ cmap : clan '=' tNUMBER ':' tNUMBER { ...@@ -269,7 +269,7 @@ cmap : clan '=' tNUMBER ':' tNUMBER {
clan : tNUMBER { $$ = $1; } clan : tNUMBER { $$ = $1; }
| tTOKEN { | tTOKEN {
if($1->type != tok_language) if($1->type != tok_language)
xyyerror("Language name or code expected"); xyyerror("Language name or code expected\n");
$$ = $1->token; $$ = $1->token;
} }
; ;
...@@ -282,7 +282,7 @@ msg : msgid sevfacsym { test_id($1); } bodies { $$ = complete_msg($4, $1); } ...@@ -282,7 +282,7 @@ msg : msgid sevfacsym { test_id($1); } bodies { $$ = complete_msg($4, $1); }
msgid : tMSGID '=' id { msgid : tMSGID '=' id {
if($3 & (~0xffff)) if($3 & (~0xffff))
xyyerror("Message ID value out of range (0x%08x > 0xffff)", $3); xyyerror("Message ID value out of range (0x%08x > 0xffff)\n", $3);
$$ = $3; $$ = $3;
} }
| tMSGID error { xyyerror(err_assign); } | tMSGID error { xyyerror(err_assign); }
...@@ -295,9 +295,9 @@ id : /* Empty */ { $$ = ++last_id; } ...@@ -295,9 +295,9 @@ id : /* Empty */ { $$ = ++last_id; }
; ;
sevfacsym: /* Empty */ { have_sev = have_fac = have_sym = 0; } sevfacsym: /* Empty */ { have_sev = have_fac = have_sym = 0; }
| sevfacsym sev { if(have_sev) xyyerror("Severity already defined"); have_sev = 1; } | sevfacsym sev { if(have_sev) xyyerror("Severity already defined\n"); have_sev = 1; }
| sevfacsym fac { if(have_fac) xyyerror("Facility already defined"); have_fac = 1; } | sevfacsym fac { if(have_fac) xyyerror("Facility already defined\n"); have_fac = 1; }
| sevfacsym sym { if(have_sym) xyyerror("Symbolname already defined"); have_sym = 1; } | sevfacsym sym { if(have_sym) xyyerror("Symbolname already defined\n"); have_sym = 1; }
; ;
sym : tSYMNAME '=' tIDENT { last_sym = $3; } sym : tSYMNAME '=' tIDENT { last_sym = $3; }
...@@ -308,9 +308,9 @@ sym : tSYMNAME '=' tIDENT { last_sym = $3; } ...@@ -308,9 +308,9 @@ sym : tSYMNAME '=' tIDENT { last_sym = $3; }
sev : tSEVERITY '=' token { sev : tSEVERITY '=' token {
token_t *tok = lookup_token($3->name); token_t *tok = lookup_token($3->name);
if(!tok) if(!tok)
xyyerror("Undefined severityname"); xyyerror("Undefined severityname\n");
if(tok->type != tok_severity) if(tok->type != tok_severity)
xyyerror("Identifier is not of class 'severity'"); xyyerror("Identifier is not of class 'severity'\n");
last_sev = tok->token; last_sev = tok->token;
} }
| tSEVERITY '=' error { xyyerror(err_ident); } | tSEVERITY '=' error { xyyerror(err_ident); }
...@@ -320,9 +320,9 @@ sev : tSEVERITY '=' token { ...@@ -320,9 +320,9 @@ sev : tSEVERITY '=' token {
fac : tFACILITY '=' token { fac : tFACILITY '=' token {
token_t *tok = lookup_token($3->name); token_t *tok = lookup_token($3->name);
if(!tok) if(!tok)
xyyerror("Undefined facilityname"); xyyerror("Undefined facilityname\n");
if(tok->type != tok_facility) if(tok->type != tok_facility)
xyyerror("Identifier is not of class 'facility'"); xyyerror("Identifier is not of class 'facility'\n");
last_fac = tok->token; last_fac = tok->token;
} }
| tFACILITY '=' error { xyyerror(err_ident); } | tFACILITY '=' error { xyyerror(err_ident); }
...@@ -334,7 +334,7 @@ fac : tFACILITY '=' token { ...@@ -334,7 +334,7 @@ fac : tFACILITY '=' token {
*/ */
bodies : body { $$ = add_lanmsg(NULL, $1); } bodies : body { $$ = add_lanmsg(NULL, $1); }
| bodies body { $$ = add_lanmsg($1, $2); } | bodies body { $$ = add_lanmsg($1, $2); }
| error { xyyerror("'Language=...' (start of message text-definition) expected"); } | error { xyyerror("'Language=...' (start of message text-definition) expected\n"); }
; ;
body : lang setline lines tMSGEND { $$ = new_lanmsg(&$1, $3); } body : lang setline lines tMSGEND { $$ = new_lanmsg(&$1, $3); }
...@@ -349,9 +349,9 @@ lang : tLANGUAGE setnl '=' token tNL { ...@@ -349,9 +349,9 @@ lang : tLANGUAGE setnl '=' token tNL {
token_t *tok = lookup_token($4->name); token_t *tok = lookup_token($4->name);
cp_xlat_t *cpx; cp_xlat_t *cpx;
if(!tok) if(!tok)
xyyerror("Undefined language"); xyyerror("Undefined language\n");
if(tok->type != tok_language) if(tok->type != tok_language)
xyyerror("Identifier is not of class 'language'"); xyyerror("Identifier is not of class 'language'\n");
if((cpx = find_cpxlat(tok->token))) if((cpx = find_cpxlat(tok->token)))
{ {
set_codepage($$.codepage = cpx->cpin); set_codepage($$.codepage = cpx->cpin);
...@@ -374,7 +374,7 @@ lang : tLANGUAGE setnl '=' token tNL { ...@@ -374,7 +374,7 @@ lang : tLANGUAGE setnl '=' token tNL {
set_codepage($$.codepage = tok->codepage); set_codepage($$.codepage = tok->codepage);
$$.language = tok->token; $$.language = tok->token;
} }
| tLANGUAGE setnl '=' token error { xyyerror("Missing newline"); } | tLANGUAGE setnl '=' token error { xyyerror("Missing newline\n"); }
| tLANGUAGE setnl '=' error { xyyerror(err_ident); } | tLANGUAGE setnl '=' error { xyyerror(err_ident); }
| tLANGUAGE error { xyyerror(err_assign); } | tLANGUAGE error { xyyerror(err_assign); }
; ;
...@@ -419,12 +419,12 @@ static void do_add_token(tok_e type, token_t *tok, const char *code) ...@@ -419,12 +419,12 @@ static void do_add_token(tok_e type, token_t *tok, const char *code)
if(tp) if(tp)
{ {
if(tok->type != type) if(tok->type != type)
mcy_warning("Type change in token"); mcy_warning("Type change in token\n");
if(tp != tok) if(tp != tok)
xyyerror("Overlapping token not the same"); xyyerror("Overlapping token not the same\n");
/* else its already defined and changed */ /* else its already defined and changed */
if(tok->fixed) if(tok->fixed)
xyyerror("Redefinition of %s", code); xyyerror("Redefinition of %s\n", code);
tok->fixed = 1; tok->fixed = 1;
} }
else else
...@@ -442,7 +442,7 @@ static lanmsg_t *new_lanmsg(lan_cp_t *lcp, WCHAR *msg) ...@@ -442,7 +442,7 @@ static lanmsg_t *new_lanmsg(lan_cp_t *lcp, WCHAR *msg)
lmp->msg = msg; lmp->msg = msg;
lmp->len = unistrlen(msg) + 1; /* Include termination */ lmp->len = unistrlen(msg) + 1; /* Include termination */
if(lmp->len > 4096) if(lmp->len > 4096)
mcy_warning("Message exceptionally long; might be a missing termination"); mcy_warning("Message exceptionally long; might be a missing termination\n");
return lmp; return lmp;
} }
...@@ -460,7 +460,7 @@ static msg_t *add_lanmsg(msg_t *msg, lanmsg_t *lanmsg) ...@@ -460,7 +460,7 @@ static msg_t *add_lanmsg(msg_t *msg, lanmsg_t *lanmsg)
for(i = 0; i < msg->nmsgs-1; i++) for(i = 0; i < msg->nmsgs-1; i++)
{ {
if(msg->msgs[i]->lan == lanmsg->lan) if(msg->msgs[i]->lan == lanmsg->lan)
xyyerror("Message for language 0x%x already defined", lanmsg->lan); xyyerror("Message for language 0x%x already defined\n", lanmsg->lan);
} }
return msg; return msg;
} }
...@@ -477,7 +477,7 @@ static msg_t *complete_msg(msg_t *mp, int id) ...@@ -477,7 +477,7 @@ static msg_t *complete_msg(msg_t *mp, int id)
if(have_sym) if(have_sym)
mp->sym = last_sym; mp->sym = last_sym;
else else
xyyerror("No symbolic name defined for message id %d", id); xyyerror("No symbolic name defined for message id %d\n", id);
mp->sev = last_sev; mp->sev = last_sev;
mp->fac = last_fac; mp->fac = last_fac;
qsort(mp->msgs, mp->nmsgs, sizeof(*(mp->msgs)), sort_lanmsg); qsort(mp->msgs, mp->nmsgs, sizeof(*(mp->msgs)), sort_lanmsg);
...@@ -516,7 +516,7 @@ static void test_id(int id) ...@@ -516,7 +516,7 @@ static void test_id(int id)
if(ndp->type != nd_msg) if(ndp->type != nd_msg)
continue; continue;
if(ndp->u.msg->id == id && ndp->u.msg->sev == last_sev && ndp->u.msg->fac == last_fac) if(ndp->u.msg->id == id && ndp->u.msg->sev == last_sev && ndp->u.msg->fac == last_fac)
xyyerror("MessageId %d with facility 0x%x and severity 0x%x already defined", id, last_fac, last_sev); xyyerror("MessageId %d with facility 0x%x and severity 0x%x already defined\n", id, last_fac, last_sev);
} }
} }
......
...@@ -38,7 +38,6 @@ static void generic_msg(const char *s, const char *t, va_list ap) ...@@ -38,7 +38,6 @@ static void generic_msg(const char *s, const char *t, va_list ap)
{ {
fprintf(stderr, "%s:%d:%d: %s: ", input_name ? input_name : "stdin", line_number, char_number, t); fprintf(stderr, "%s:%d:%d: %s: ", input_name ? input_name : "stdin", line_number, char_number, t);
vfprintf(stderr, s, ap); vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
} }
/* /*
...@@ -85,7 +84,6 @@ void internal_error(const char *file, int line, const char *s, ...) ...@@ -85,7 +84,6 @@ void internal_error(const char *file, int line, const char *s, ...)
va_start(ap, s); va_start(ap, s);
fprintf(stderr, "Internal error (please report) %s %d: ", file, line); fprintf(stderr, "Internal error (please report) %s %d: ", file, line);
vfprintf(stderr, s, ap); vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
va_end(ap); va_end(ap);
exit(3); exit(3);
} }
...@@ -96,7 +94,6 @@ void error(const char *s, ...) ...@@ -96,7 +94,6 @@ void error(const char *s, ...)
va_start(ap, s); va_start(ap, s);
fprintf(stderr, "Error: "); fprintf(stderr, "Error: ");
vfprintf(stderr, s, ap); vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
va_end(ap); va_end(ap);
exit(2); exit(2);
} }
...@@ -107,7 +104,6 @@ void warning(const char *s, ...) ...@@ -107,7 +104,6 @@ void warning(const char *s, ...)
va_start(ap, s); va_start(ap, s);
fprintf(stderr, "Warning: "); fprintf(stderr, "Warning: ");
vfprintf(stderr, s, ap); vfprintf(stderr, s, ap);
fprintf(stderr, "\n");
va_end(ap); va_end(ap);
} }
......
...@@ -101,11 +101,11 @@ static char *dup_u2c(int cp, const WCHAR *uc) ...@@ -101,11 +101,11 @@ static char *dup_u2c(int cp, const WCHAR *uc)
char *cptr; char *cptr;
const union cptable *cpdef = find_codepage(cp); const union cptable *cpdef = find_codepage(cp);
if(!cpdef) if(!cpdef)
internal_error(__FILE__, __LINE__, "Codepage %d not found (vanished?)", cp); internal_error(__FILE__, __LINE__, "Codepage %d not found (vanished?)\n", cp);
len = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, NULL, 0, NULL, NULL); len = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, NULL, 0, NULL, NULL);
cptr = xmalloc(len); cptr = xmalloc(len);
if((len = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, cptr, len, NULL, NULL)) < 0) if((len = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, cptr, len, NULL, NULL)) < 0)
internal_error(__FILE__, __LINE__, "Buffer overflow? code %d.", len); internal_error(__FILE__, __LINE__, "Buffer overflow? code %d\n", len);
return cptr; return cptr;
} }
...@@ -271,13 +271,13 @@ void write_h_file(const char *fname) ...@@ -271,13 +271,13 @@ void write_h_file(const char *fname)
fprintf(fp, "#define %s\t0x%08xL\n\n", cptr, ndp->u.msg->realid); fprintf(fp, "#define %s\t0x%08xL\n\n", cptr, ndp->u.msg->realid);
break; break;
default: default:
internal_error(__FILE__, __LINE__, "Invalid base for number print"); internal_error(__FILE__, __LINE__, "Invalid base for number print\n");
} }
free(cptr); free(cptr);
free(cast); free(cast);
break; break;
default: default:
internal_error(__FILE__, __LINE__, "Invalid node type %d", ndp->type); internal_error(__FILE__, __LINE__, "Invalid node type %d\n", ndp->type);
} }
} }
fprintf(fp, "\n#endif\n"); fprintf(fp, "\n#endif\n");
...@@ -307,7 +307,7 @@ static void write_rcbin(FILE *fp) ...@@ -307,7 +307,7 @@ static void write_rcbin(FILE *fp)
} }
} }
if(!cptr) if(!cptr)
internal_error(__FILE__, __LINE__, "Filename vanished for language 0x%0x", lbp->lan); internal_error(__FILE__, __LINE__, "Filename vanished for language 0x%0x\n", lbp->lan);
fprintf(fp, "1 MESSAGETABLE \"%s.bin\"\n", cptr); fprintf(fp, "1 MESSAGETABLE \"%s.bin\"\n", cptr);
free(cptr); free(cptr);
} }
...@@ -389,7 +389,7 @@ static char *make_string(WCHAR *uc, int len, int codepage) ...@@ -389,7 +389,7 @@ static char *make_string(WCHAR *uc, int len, int codepage)
mlen = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, NULL, 0, NULL, NULL); mlen = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, NULL, 0, NULL, NULL);
cc = tmp = xmalloc(mlen); cc = tmp = xmalloc(mlen);
if((i = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, tmp, mlen, NULL, NULL)) < 0) if((i = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, tmp, mlen, NULL, NULL)) < 0)
internal_error(__FILE__, __LINE__, "Buffer overflow? code %d.", i); internal_error(__FILE__, __LINE__, "Buffer overflow? code %d\n", i);
*cptr++ = ' '; *cptr++ = ' ';
*cptr++ = '"'; *cptr++ = '"';
for(i = b = 0; i < len; i++, cc++) for(i = b = 0; i < len; i++, cc++)
......
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