From 9c75041df0005c4f59c81fae7de139371c0f684d Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 9 Jan 2024 15:57:57 +1000 Subject: [PATCH] Misc data type and comment fixes Signed-off-by: bones_was_here --- clvm_cmds.c | 34 +++++++++++++++++----------------- common.c | 8 ++++---- common.h | 8 ++++---- console.c | 18 +++++++++--------- console.h | 12 ++++++------ 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/clvm_cmds.c b/clvm_cmds.c index 78039744..3710852f 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -2448,49 +2448,49 @@ static void VM_CL_registercmd (prvm_prog_t *prog) Cmd_AddCommand(CF_CLIENT, PRVM_G_STRING(OFS_PARM0), NULL, "console command created by QuakeC"); } -//#360 float() readbyte (EXT_CSQC) +//#360 float() ReadByte (EXT_CSQC) static void VM_CL_ReadByte (prvm_prog_t *prog) { VM_SAFEPARMCOUNT(0, VM_CL_ReadByte); PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadByte(&cl_message); } -//#361 float() readchar (EXT_CSQC) +//#361 float() ReadChar (EXT_CSQC) static void VM_CL_ReadChar (prvm_prog_t *prog) { VM_SAFEPARMCOUNT(0, VM_CL_ReadChar); PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadChar(&cl_message); } -//#362 float() readshort (EXT_CSQC) +//#362 float() ReadShort (EXT_CSQC) static void VM_CL_ReadShort (prvm_prog_t *prog) { VM_SAFEPARMCOUNT(0, VM_CL_ReadShort); PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadShort(&cl_message); } -//#363 float() readlong (EXT_CSQC) +//#363 float() ReadLong (EXT_CSQC) static void VM_CL_ReadLong (prvm_prog_t *prog) { VM_SAFEPARMCOUNT(0, VM_CL_ReadLong); PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadLong(&cl_message); } -//#364 float() readcoord (EXT_CSQC) +//#364 float() ReadCoord (EXT_CSQC) static void VM_CL_ReadCoord (prvm_prog_t *prog) { VM_SAFEPARMCOUNT(0, VM_CL_ReadCoord); PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadCoord(&cl_message, cls.protocol); } -//#365 float() readangle (EXT_CSQC) +//#365 float() ReadAngle (EXT_CSQC) static void VM_CL_ReadAngle (prvm_prog_t *prog) { VM_SAFEPARMCOUNT(0, VM_CL_ReadAngle); PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadAngle(&cl_message, cls.protocol); } -//#366 string() readstring (EXT_CSQC) +//#366 string() ReadString (EXT_CSQC) static void VM_CL_ReadString (prvm_prog_t *prog) { size_t cl_readstring_len; @@ -2500,14 +2500,14 @@ static void VM_CL_ReadString (prvm_prog_t *prog) PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, cl_readstring, cl_readstring_len); } -//#367 float() readfloat (EXT_CSQC) +//#367 float() ReadFloat (EXT_CSQC) static void VM_CL_ReadFloat (prvm_prog_t *prog) { VM_SAFEPARMCOUNT(0, VM_CL_ReadFloat); PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadFloat(&cl_message); } -//#501 string() readpicture (DP_CSQC_READWRITEPICTURE) +//#501 string() ReadPicture (DP_CSQC_READWRITEPICTURE) extern cvar_t cl_readpicture_force; static void VM_CL_ReadPicture (prvm_prog_t *prog) { @@ -5344,14 +5344,14 @@ VM_findfont, // #356 float(string fontname) loadfont (DP_GFX_FONTS) VM_loadfont, // #357 float(string fontname, string fontmaps, string sizes, float slot) loadfont (DP_GFX_FONTS) VM_CL_loadcubemap, // #358 void(string cubemapname) loadcubemap (DP_GFX_) NULL, // #359 -VM_CL_ReadByte, // #360 float() readbyte (EXT_CSQC) -VM_CL_ReadChar, // #361 float() readchar (EXT_CSQC) -VM_CL_ReadShort, // #362 float() readshort (EXT_CSQC) -VM_CL_ReadLong, // #363 float() readlong (EXT_CSQC) -VM_CL_ReadCoord, // #364 float() readcoord (EXT_CSQC) -VM_CL_ReadAngle, // #365 float() readangle (EXT_CSQC) -VM_CL_ReadString, // #366 string() readstring (EXT_CSQC) -VM_CL_ReadFloat, // #367 float() readfloat (EXT_CSQC) +VM_CL_ReadByte, // #360 float() ReadByte (EXT_CSQC) +VM_CL_ReadChar, // #361 float() ReadChar (EXT_CSQC) +VM_CL_ReadShort, // #362 float() ReadShort (EXT_CSQC) +VM_CL_ReadLong, // #363 float() ReadLong (EXT_CSQC) +VM_CL_ReadCoord, // #364 float() ReadCoord (EXT_CSQC) +VM_CL_ReadAngle, // #365 float() ReadAngle (EXT_CSQC) +VM_CL_ReadString, // #366 string() ReadString (EXT_CSQC) +VM_CL_ReadFloat, // #367 float() ReadFloat (EXT_CSQC) NULL, // #368 NULL, // #369 NULL, // #370 diff --git a/common.c b/common.c index 0f0572d3..837c6353 100644 --- a/common.c +++ b/common.c @@ -460,7 +460,7 @@ Parse a token out of a string Writes the token and its strlen to the com_token and com_token_len globals. ============== */ -int COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments) +qbool COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments) { int len; int c; @@ -578,7 +578,7 @@ Parse a token out of a string Writes the token and its strlen to the com_token and com_token_len globals. ============== */ -int COM_ParseToken_QuakeC(const char **datapointer, qbool returnnewline) +qbool COM_ParseToken_QuakeC(const char **datapointer, qbool returnnewline) { int len; int c; @@ -697,7 +697,7 @@ Parse a token out of a string Writes the token and its strlen to the com_token and com_token_len globals. ============== */ -int COM_ParseToken_VM_Tokenize(const char **datapointer, qbool returnnewline) +qbool COM_ParseToken_VM_Tokenize(const char **datapointer, qbool returnnewline) { int len; int c; @@ -816,7 +816,7 @@ Parse a token out of a string, behaving like the qwcl console Writes the token and its strlen to the com_token and com_token_len globals. ============== */ -int COM_ParseToken_Console(const char **datapointer) +qbool COM_ParseToken_Console(const char **datapointer) { int len; const char *data = *datapointer; diff --git a/common.h b/common.h index 641ed105..cb889439 100644 --- a/common.h +++ b/common.h @@ -210,10 +210,10 @@ int COM_Wordwrap(const char *string, size_t length, float continuationSize, floa extern char com_token[MAX_INPUTLINE]; extern unsigned com_token_len; -int COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments); -int COM_ParseToken_QuakeC(const char **datapointer, qbool returnnewline); -int COM_ParseToken_VM_Tokenize(const char **datapointer, qbool returnnewline); -int COM_ParseToken_Console(const char **datapointer); +qbool COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments); +qbool COM_ParseToken_QuakeC(const char **datapointer, qbool returnnewline); +qbool COM_ParseToken_VM_Tokenize(const char **datapointer, qbool returnnewline); +qbool COM_ParseToken_Console(const char **datapointer); void COM_Init (void); void COM_Shutdown (void); diff --git a/console.c b/console.c index 01c371af..687c413a 100644 --- a/console.c +++ b/console.c @@ -333,7 +333,7 @@ ConBuffer_AddLine Appends a given string as a new line to the console. ================ */ -void ConBuffer_AddLine(conbuffer_t *buf, const char *line, int len, int mask) +void ConBuffer_AddLine(conbuffer_t *buf, const char *line, int len, unsigned mask) { char *putpos; con_lineinfo_t *p; @@ -367,7 +367,7 @@ void ConBuffer_AddLine(conbuffer_t *buf, const char *line, int len, int mask) p->height = -1; // calculate when needed } -int ConBuffer_FindPrevLine(conbuffer_t *buf, int mask_must, int mask_mustnot, int start) +int ConBuffer_FindPrevLine(conbuffer_t *buf, unsigned mask_must, unsigned mask_mustnot, int start) { int i; if(start == -1) @@ -1151,10 +1151,10 @@ Con_MaskPrint */ extern cvar_t timestamps; extern cvar_t timeformat; -void Con_MaskPrint(int additionalmask, const char *msg) +void Con_MaskPrint(unsigned additionalmask, const char *msg) { - static int mask = 0; - static int index = 0; + static unsigned mask = 0; + static unsigned index = 0; static char line[MAX_INPUTLINE]; if (con_mutex) @@ -1430,7 +1430,7 @@ void Con_MaskPrint(int additionalmask, const char *msg) Con_MaskPrintf ================ */ -void Con_MaskPrintf(int mask, const char *fmt, ...) +void Con_MaskPrintf(unsigned mask, const char *fmt, ...) { va_list argptr; char msg[MAX_INPUTLINE]; @@ -1700,7 +1700,7 @@ static int Con_DisplayLineFunc(void *passthrough, const char *line, size_t lengt return 1; } -static int Con_DrawNotifyRect(int mask_must, int mask_mustnot, float maxage, float x, float y, float width, float height, float fontsize, float alignment_x, float alignment_y, const char *continuationString) +static int Con_DrawNotifyRect(unsigned mask_must, unsigned mask_mustnot, float maxage, float x, float y, float width, float height, float fontsize, float alignment_x, float alignment_y, const char *continuationString) { int i; int lines = 0; @@ -1901,7 +1901,7 @@ If alpha is 0, the line is not drawn, but still wrapped and its height returned. ================ */ -static int Con_DrawConsoleLine(int mask_must, int mask_mustnot, float y, int lineno, float ymin, float ymax) +static int Con_DrawConsoleLine(unsigned mask_must, unsigned mask_mustnot, float y, int lineno, float ymin, float ymax) { float width = vid_conwidth.value; con_text_info_t ti; @@ -1933,7 +1933,7 @@ Calculates the last visible line index and how much to show of it based on con_backscroll. ================ */ -static void Con_LastVisibleLine(int mask_must, int mask_mustnot, int *last, int *limitlast) +static void Con_LastVisibleLine(unsigned mask_must, unsigned mask_mustnot, int *last, int *limitlast) { int lines_seen = 0; int i; diff --git a/console.h b/console.h index 093fd8c6..10da88f0 100644 --- a/console.h +++ b/console.h @@ -46,10 +46,10 @@ void Con_Shutdown (void); void Con_DrawConsole (int lines); /// Prints to a chosen console target -void Con_MaskPrint(int additionalmask, const char *msg); +void Con_MaskPrint(unsigned additionalmask, const char *msg); // Prints to a chosen console target -void Con_MaskPrintf(int mask, const char *fmt, ...) DP_FUNC_PRINTF(2); +void Con_MaskPrintf(unsigned mask, const char *fmt, ...) DP_FUNC_PRINTF(2); /// Prints to all appropriate console targets, and adds timestamps void Con_Print(const char *txt); @@ -108,7 +108,7 @@ typedef struct con_lineinfo_s { char *start; size_t len; - int mask; + unsigned mask; /// used only by console.c double addtime; @@ -149,9 +149,9 @@ void ConBuffer_DeleteLine(conbuffer_t *buf); void ConBuffer_DeleteLastLine(conbuffer_t *buf); /// Appends a given string as a new line to the console. -void ConBuffer_AddLine(conbuffer_t *buf, const char *line, int len, int mask); -int ConBuffer_FindPrevLine(conbuffer_t *buf, int mask_must, int mask_mustnot, int start); -int ConBuffer_FindNextLine(conbuffer_t *buf, int mask_must, int mask_mustnot, int start); +void ConBuffer_AddLine(conbuffer_t *buf, const char *line, int len, unsigned mask); +int ConBuffer_FindPrevLine(conbuffer_t *buf, unsigned mask_must, unsigned mask_mustnot, int start); +int ConBuffer_FindNextLine(conbuffer_t *buf, unsigned mask_must, unsigned mask_mustnot, int start); const char *ConBuffer_GetLine(conbuffer_t *buf, int i); #endif -- 2.39.2