X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=console.c;h=5eb850314b70140632816227e7b15c6b83c289d8;hb=7f6fffa3d33fa7821a34e58259f0511b62c530d2;hp=3cb08835c33335e1eada3588fc842973ec59cde9;hpb=11e05215e5f3cee630f54b9836dab1b36b5b4ffc;p=xonotic%2Fdarkplaces.git diff --git a/console.c b/console.c index 3cb08835..5eb85031 100644 --- a/console.c +++ b/console.c @@ -66,7 +66,7 @@ cvar_t log_file = {0, "log_file",""}; char crt_log_file [MAX_OSPATH] = ""; qfile_t* logfile = NULL; -qbyte* logqueue = NULL; +unsigned char* logqueue = NULL; size_t logq_ind = 0; size_t logq_size = 0; @@ -183,10 +183,10 @@ void Log_ConPrint (const char *msg) if (len > remain) { size_t factor = ((logq_ind + len) / logq_size) + 1; - qbyte* newqueue; + unsigned char* newqueue; logq_size *= factor; - newqueue = Mem_Alloc (tempmempool, logq_size); + newqueue = (unsigned char *)Mem_Alloc (tempmempool, logq_size); memcpy (newqueue, logqueue, logq_ind); Mem_Free (logqueue); logqueue = newqueue; @@ -369,7 +369,7 @@ void Con_Init (void) // Allocate a log queue logq_size = 512; - logqueue = Mem_Alloc (tempmempool, logq_size); + logqueue = (unsigned char *)Mem_Alloc (tempmempool, logq_size); logq_ind = 0; Cvar_RegisterVariable (&log_file); @@ -542,7 +542,7 @@ void Con_Print(const char *msg) if (index == 0) { // if this is the beginning of a new line, print timestamp - char *timestamp = timestamps.integer ? Sys_TimeString(timeformat.string) : ""; + const char *timestamp = timestamps.integer ? Sys_TimeString(timeformat.string) : ""; // reset the color // FIXME: 1. perhaps we should use a terminal system 2. use a constant instead of 7! line[index++] = STRING_COLOR_TAG; @@ -571,7 +571,7 @@ void Con_Print(const char *msg) } // store timestamp for (;*timestamp;index++, timestamp++) - if (index < sizeof(line) - 2) + if (index < (int)sizeof(line) - 2) line[index] = *timestamp; } // append the character @@ -730,7 +730,7 @@ void Con_DrawNotify (void) char *text; int i; float time; - extern char chat_buffer[]; + extern char chat_buffer[256]; char temptext[256]; int colorindex = -1; //-1 for default @@ -780,7 +780,7 @@ void Con_DrawNotify (void) sprintf(temptext, "say_team:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); else sprintf(temptext, "say:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); - while (strlen(temptext) >= (size_t) con_linewidth) + while ((int)strlen(temptext) >= con_linewidth) { DrawQ_ColoredString( 0, v, temptext, con_linewidth, 8, 8, 1.0, 1.0, 1.0, 1.0, 0, &colorindex ); strcpy(temptext, &temptext[con_linewidth]); @@ -802,7 +802,6 @@ Draws the console with the solid background The typing input line at the bottom should only be drawn if typing is allowed ================ */ -extern char engineversion[40]; void Con_DrawConsole (int lines) { int i, y, rows, j;