Mercurial > hg > early-roguelike
comparison arogue7/mdport.c @ 285:17005af49963
Fix some potential problems detected by clang.
Most of these are unnecessary comparisons and functions returning the
wrong types.
author | John "Elwin" Edwards |
---|---|
date | Sat, 23 Sep 2017 09:47:00 -0400 |
parents | 6376b514a30b |
children | e52a8a7ad4c5 |
comparison
equal
deleted
inserted
replaced
284:6376b514a30b | 285:17005af49963 |
---|---|
109 # define SE exit_standout_mode | 109 # define SE exit_standout_mode |
110 #endif | 110 #endif |
111 | 111 |
112 static int md_standout_mode = 0; | 112 static int md_standout_mode = 0; |
113 | 113 |
114 int | 114 void |
115 md_raw_standout(void) | 115 md_raw_standout(void) |
116 { | 116 { |
117 #ifdef _WIN32 | 117 #ifdef _WIN32 |
118 CONSOLE_SCREEN_BUFFER_INFO csbiInfo; | 118 CONSOLE_SCREEN_BUFFER_INFO csbiInfo; |
119 HANDLE hStdout; | 119 HANDLE hStdout; |
132 _puts(SO); | 132 _puts(SO); |
133 fflush(stdout); | 133 fflush(stdout); |
134 #endif | 134 #endif |
135 } | 135 } |
136 | 136 |
137 int | 137 void |
138 md_raw_standend(void) | 138 md_raw_standend(void) |
139 { | 139 { |
140 #ifdef _WIN32 | 140 #ifdef _WIN32 |
141 CONSOLE_SCREEN_BUFFER_INFO csbiInfo; | 141 CONSOLE_SCREEN_BUFFER_INFO csbiInfo; |
142 HANDLE hStdout; | 142 HANDLE hStdout; |
211 | 211 |
212 return(fd); | 212 return(fd); |
213 } | 213 } |
214 | 214 |
215 | 215 |
216 int | 216 void |
217 md_normaluser(void) | 217 md_normaluser(void) |
218 { | 218 { |
219 #ifndef _WIN32 | 219 #ifndef _WIN32 |
220 setuid(getuid()); | 220 setuid(getuid()); |
221 setgid(getgid()); | 221 setgid(getgid()); |
579 #else | 579 #else |
580 return(random()); | 580 return(random()); |
581 #endif | 581 #endif |
582 } | 582 } |
583 | 583 |
584 int | 584 void |
585 md_srand(int seed) | 585 md_srand(int seed) |
586 { | 586 { |
587 #ifdef _WIN32 | 587 #ifdef _WIN32 |
588 srand(seed); | 588 srand(seed); |
589 #else | 589 #else |