(svn r23568) -Codechange: only allocate the buffer for writing when it is really needed

This commit is contained in:
rubidium
2011-12-17 13:33:36 +00:00
parent b7b3ac8859
commit 6c31b25e22
2 changed files with 83 additions and 75 deletions

View File

@@ -19,7 +19,8 @@ enum CmdFlags {
};
DECLARE_ENUM_AS_BIT_SET(CmdFlags)
typedef void (*ParseCmdProc)(char *buf, int value);
struct Buffer;
typedef void (*ParseCmdProc)(Buffer *buffer, char *buf, int value);
struct CmdStruct {
const char *cmd;
@@ -29,9 +30,9 @@ struct CmdStruct {
CmdFlags flags;
};
static void EmitSingleChar(char *buf, int value);
static void EmitPlural(char *buf, int value);
static void EmitGender(char *buf, int value);
static void EmitSingleChar(Buffer *buffer, char *buf, int value);
static void EmitPlural(Buffer *buffer, char *buf, int value);
static void EmitGender(Buffer *buffer, char *buf, int value);
static const CmdStruct _cmd_structs[] = {
/* Font size */