Mercurial > hg > early-roguelike
comparison rogue5/mdport.c @ 282:8b6aba552f6f
Excise md_putchar().
The function wrapped the standard putchar(), doing nothing beside
discarding the return value. That could cause problems with tputs(),
which expects an int to be returned.
| author | John "Elwin" Edwards |
|---|---|
| date | Mon, 18 Sep 2017 19:11:57 -0400 |
| parents | 3d4252fa2ed3 |
| children | 5b6855d5d089 |
comparison
equal
deleted
inserted
replaced
| 281:4a3f4729257c | 282:8b6aba552f6f |
|---|---|
| 276 #else | 276 #else |
| 277 return((CE != NULL) && (*CE != 0)); | 277 return((CE != NULL) && (*CE != 0)); |
| 278 #endif | 278 #endif |
| 279 } | 279 } |
| 280 | 280 |
| 281 void | |
| 282 md_putchar(int c) | |
| 283 { | |
| 284 putchar(c); | |
| 285 } | |
| 286 | |
| 287 #ifdef _WIN32 | 281 #ifdef _WIN32 |
| 288 static int md_standout_mode = 0; | 282 static int md_standout_mode = 0; |
| 289 #endif | 283 #endif |
| 290 | 284 |
| 291 void | 285 void |
| 304 bgattr = (csbiInfo.wAttributes & 0xF0); | 298 bgattr = (csbiInfo.wAttributes & 0xF0); |
| 305 SetConsoleTextAttribute(hStdout,(fgattr << 4) | (bgattr >> 4)); | 299 SetConsoleTextAttribute(hStdout,(fgattr << 4) | (bgattr >> 4)); |
| 306 md_standout_mode = 1; | 300 md_standout_mode = 1; |
| 307 } | 301 } |
| 308 #elif defined(SO) | 302 #elif defined(SO) |
| 309 tputs(SO,0,md_putchar); | 303 tputs(SO,0,putchar); |
| 310 fflush(stdout); | 304 fflush(stdout); |
| 311 #endif | 305 #endif |
| 312 } | 306 } |
| 313 | 307 |
| 314 void | 308 void |
| 327 bgattr = (csbiInfo.wAttributes & 0xF0); | 321 bgattr = (csbiInfo.wAttributes & 0xF0); |
| 328 SetConsoleTextAttribute(hStdout,(fgattr << 4) | (bgattr >> 4)); | 322 SetConsoleTextAttribute(hStdout,(fgattr << 4) | (bgattr >> 4)); |
| 329 md_standout_mode = 0; | 323 md_standout_mode = 0; |
| 330 } | 324 } |
| 331 #elif defined(SE) | 325 #elif defined(SE) |
| 332 tputs(SE,0,md_putchar); | 326 tputs(SE,0,putchar); |
| 333 fflush(stdout); | 327 fflush(stdout); |
| 334 #endif | 328 #endif |
| 335 } | 329 } |
| 336 | 330 |
| 337 int | 331 int |
