diff options
author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-11-10 23:55:22 +0000 |
---|---|---|
committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-11-10 23:55:22 +0000 |
commit | 8ba546241137c6c1c43751b25e40bbaf610658a1 (patch) | |
tree | a677c3ad74326acc217842a2d927328597cfe3c8 /code/sys | |
parent | b1613ef65246cc89a1e40e35c6e07080c56ea00b (diff) | |
download | ioquake3-aero-8ba546241137c6c1c43751b25e40bbaf610658a1.tar.gz ioquake3-aero-8ba546241137c6c1c43751b25e40bbaf610658a1.zip |
* Fix some new GCC 4.3 warnings
* Fix many many strict aliasing warnings, now that it's re-enabled
git-svn-id: svn://svn.icculus.org/quake3/trunk@1487 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/sys')
-rw-r--r-- | code/sys/con_tty.c | 20 | ||||
-rw-r--r-- | code/sys/sys_unix.c | 5 |
2 files changed, 16 insertions, 9 deletions
diff --git a/code/sys/con_tty.c b/code/sys/con_tty.c index c2e553a..28f1fd4 100644 --- a/code/sys/con_tty.c +++ b/code/sys/con_tty.c @@ -86,12 +86,14 @@ send "\b \b" static void CON_Back( void ) { char key; + size_t size; + key = '\b'; - write(1, &key, 1); + size = write(1, &key, 1); key = ' '; - write(1, &key, 1); + size = write(1, &key, 1); key = '\b'; - write(1, &key, 1); + size = write(1, &key, 1); } /* @@ -142,12 +144,13 @@ static void CON_Show( void ) ttycon_hide--; if (ttycon_hide == 0) { - write( 1, "]", 1 ); + size_t size; + size = write( 1, "]", 1 ); if (TTY_con.cursor) { for (i=0; i<TTY_con.cursor; i++) { - write(1, TTY_con.buffer+i, 1); + size = write(1, TTY_con.buffer+i, 1); } } } @@ -307,6 +310,7 @@ char *CON_Input( void ) int avail; char key; field_t *history; + size_t size; if( ttycon_on ) { @@ -336,8 +340,8 @@ char *CON_Input( void ) strcpy(text, TTY_con.buffer); Field_Clear(&TTY_con); key = '\n'; - write(1, &key, 1); - write( 1, "]", 1 ); + size = write(1, &key, 1); + size = write( 1, "]", 1 ); return text; } if (key == '\t') @@ -399,7 +403,7 @@ char *CON_Input( void ) TTY_con.buffer[TTY_con.cursor] = key; TTY_con.cursor++; // print the current line (this is differential) - write(1, &key, 1); + size = write(1, &key, 1); } return NULL; diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index 21d0b57..c05fda5 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -231,7 +231,10 @@ char *Sys_Cwd( void ) { static char cwd[MAX_OSPATH]; - getcwd( cwd, sizeof( cwd ) - 1 ); + char *result = getcwd( cwd, sizeof( cwd ) - 1 ); + if( result != cwd ) + return NULL; + cwd[MAX_OSPATH-1] = 0; return cwd; |