Patch from Sylvain to fix clang warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405
diff --git a/include/SDL_test_assert.h b/include/SDL_test_assert.h
index 29277e1..60288d3 100644
--- a/include/SDL_test_assert.h
+++ b/include/SDL_test_assert.h
@@ -80,12 +80,12 @@ void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,
/**
* \brief Resets the assert summary counters to zero.
*/
-void SDLTest_ResetAssertSummary();
+void SDLTest_ResetAssertSummary(void);
/**
* \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
*/
-void SDLTest_LogAssertSummary();
+void SDLTest_LogAssertSummary(void);
/**
@@ -93,7 +93,7 @@ void SDLTest_LogAssertSummary();
*
* \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
*/
-int SDLTest_AssertSummaryToTestResult();
+int SDLTest_AssertSummaryToTestResult(void);
#ifdef __cplusplus
}
diff --git a/include/SDL_test_fuzzer.h b/include/SDL_test_fuzzer.h
index 9603652..7bab25c 100644
--- a/include/SDL_test_fuzzer.h
+++ b/include/SDL_test_fuzzer.h
@@ -68,14 +68,14 @@ void SDLTest_FuzzerInit(Uint64 execKey);
*
* \returns Generated integer
*/
-Uint8 SDLTest_RandomUint8();
+Uint8 SDLTest_RandomUint8(void);
/**
* Returns a random Sint8
*
* \returns Generated signed integer
*/
-Sint8 SDLTest_RandomSint8();
+Sint8 SDLTest_RandomSint8(void);
/**
@@ -83,14 +83,14 @@ Sint8 SDLTest_RandomSint8();
*
* \returns Generated integer
*/
-Uint16 SDLTest_RandomUint16();
+Uint16 SDLTest_RandomUint16(void);
/**
* Returns a random Sint16
*
* \returns Generated signed integer
*/
-Sint16 SDLTest_RandomSint16();
+Sint16 SDLTest_RandomSint16(void);
/**
@@ -98,7 +98,7 @@ Sint16 SDLTest_RandomSint16();
*
* \returns Generated integer
*/
-Sint32 SDLTest_RandomSint32();
+Sint32 SDLTest_RandomSint32(void);
/**
@@ -106,14 +106,14 @@ Sint32 SDLTest_RandomSint32();
*
* \returns Generated integer
*/
-Uint32 SDLTest_RandomUint32();
+Uint32 SDLTest_RandomUint32(void);
/**
* Returns random Uint64.
*
* \returns Generated integer
*/
-Uint64 SDLTest_RandomUint64();
+Uint64 SDLTest_RandomUint64(void);
/**
@@ -121,29 +121,29 @@ Uint64 SDLTest_RandomUint64();
*
* \returns Generated signed integer
*/
-Sint64 SDLTest_RandomSint64();
+Sint64 SDLTest_RandomSint64(void);
/**
* \returns random float in range [0.0 - 1.0[
*/
-float SDLTest_RandomUnitFloat();
+float SDLTest_RandomUnitFloat(void);
/**
* \returns random double in range [0.0 - 1.0[
*/
-double SDLTest_RandomUnitDouble();
+double SDLTest_RandomUnitDouble(void);
/**
* \returns random float.
*
*/
-float SDLTest_RandomFloat();
+float SDLTest_RandomFloat(void);
/**
* \returns random double.
*
*/
-double SDLTest_RandomDouble();
+double SDLTest_RandomDouble(void);
/**
* Returns a random boundary value for Uint8 within the given boundaries.
@@ -338,7 +338,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
*
* \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated.
*/
-char * SDLTest_RandomAsciiString();
+char * SDLTest_RandomAsciiString(void);
/**
@@ -371,7 +371,7 @@ char * SDLTest_RandomAsciiStringOfSize(int size);
/**
* Returns the invocation count for the fuzzer since last ...FuzzerInit.
*/
-int SDLTest_GetFuzzerInvocationCount();
+int SDLTest_GetFuzzerInvocationCount(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
diff --git a/include/SDL_test_images.h b/include/SDL_test_images.h
index 8c64b4f..1debaab 100644
--- a/include/SDL_test_images.h
+++ b/include/SDL_test_images.h
@@ -55,17 +55,17 @@ typedef struct SDLTest_SurfaceImage_s {
} SDLTest_SurfaceImage_t;
/* Test images */
-SDL_Surface *SDLTest_ImageBlit();
-SDL_Surface *SDLTest_ImageBlitColor();
-SDL_Surface *SDLTest_ImageBlitAlpha();
-SDL_Surface *SDLTest_ImageBlitBlendAdd();
-SDL_Surface *SDLTest_ImageBlitBlend();
-SDL_Surface *SDLTest_ImageBlitBlendMod();
-SDL_Surface *SDLTest_ImageBlitBlendNone();
-SDL_Surface *SDLTest_ImageBlitBlendAll();
-SDL_Surface *SDLTest_ImageFace();
-SDL_Surface *SDLTest_ImagePrimitives();
-SDL_Surface *SDLTest_ImagePrimitivesBlend();
+SDL_Surface *SDLTest_ImageBlit(void);
+SDL_Surface *SDLTest_ImageBlitColor(void);
+SDL_Surface *SDLTest_ImageBlitAlpha(void);
+SDL_Surface *SDLTest_ImageBlitBlendAdd(void);
+SDL_Surface *SDLTest_ImageBlitBlend(void);
+SDL_Surface *SDLTest_ImageBlitBlendMod(void);
+SDL_Surface *SDLTest_ImageBlitBlendNone(void);
+SDL_Surface *SDLTest_ImageBlitBlendAll(void);
+SDL_Surface *SDLTest_ImageFace(void);
+SDL_Surface *SDLTest_ImagePrimitives(void);
+SDL_Surface *SDLTest_ImagePrimitivesBlend(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
diff --git a/src/SDL.c b/src/SDL.c
index 9eef00c..ff2e938 100644
--- a/src/SDL.c
+++ b/src/SDL.c
@@ -36,10 +36,7 @@
/* Initialization/Cleanup routines */
#if !SDL_TIMERS_DISABLED
-extern int SDL_TimerInit(void);
-extern void SDL_TimerQuit(void);
-extern void SDL_TicksInit(void);
-extern void SDL_TicksQuit(void);
+# include "timer/SDL_timer_c.h"
#endif
#if SDL_VIDEO_DRIVER_WINDOWS
extern int SDL_HelperWindowCreate(void);
diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index 460852d..c7af699 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -33,36 +33,6 @@
static SDL_AudioDriver current_audio;
static SDL_AudioDevice *open_devices[16];
-/*
- * Not all of these will be compiled and linked in, but it's convenient
- * to have a complete list here and saves yet-another block of #ifdefs...
- * Please see bootstrap[], below, for the actual #ifdef mess.
- */
-extern AudioBootStrap PULSEAUDIO_bootstrap;
-extern AudioBootStrap ALSA_bootstrap;
-extern AudioBootStrap SNDIO_bootstrap;
-extern AudioBootStrap BSD_AUDIO_bootstrap;
-extern AudioBootStrap DSP_bootstrap;
-extern AudioBootStrap QSAAUDIO_bootstrap;
-extern AudioBootStrap SUNAUDIO_bootstrap;
-extern AudioBootStrap ARTS_bootstrap;
-extern AudioBootStrap ESD_bootstrap;
-extern AudioBootStrap NACLAUDIO_bootstrap;
-extern AudioBootStrap NAS_bootstrap;
-extern AudioBootStrap XAUDIO2_bootstrap;
-extern AudioBootStrap DSOUND_bootstrap;
-extern AudioBootStrap WINMM_bootstrap;
-extern AudioBootStrap PAUDIO_bootstrap;
-extern AudioBootStrap HAIKUAUDIO_bootstrap;
-extern AudioBootStrap COREAUDIO_bootstrap;
-extern AudioBootStrap DISKAUDIO_bootstrap;
-extern AudioBootStrap DUMMYAUDIO_bootstrap;
-extern AudioBootStrap FUSIONSOUND_bootstrap;
-extern AudioBootStrap ANDROIDAUDIO_bootstrap;
-extern AudioBootStrap PSPAUDIO_bootstrap;
-extern AudioBootStrap SNDIO_bootstrap;
-extern AudioBootStrap EMSCRIPTENAUDIO_bootstrap;
-
/* Available audio drivers */
static const AudioBootStrap *const bootstrap[] = {
#if SDL_AUDIO_DRIVER_PULSEAUDIO
diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h
index 943169b..320ade0 100644
--- a/src/audio/SDL_sysaudio.h
+++ b/src/audio/SDL_sysaudio.h
@@ -200,6 +200,78 @@ typedef struct AudioBootStrap
int demand_only; /* 1==request explicitly, or it won't be available. */
} AudioBootStrap;
+#if SDL_AUDIO_DRIVER_PULSEAUDIO
+extern AudioBootStrap PULSEAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_ALSA
+extern AudioBootStrap ALSA_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_SNDIO
+extern AudioBootStrap SNDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_BSD
+extern AudioBootStrap BSD_AUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_OSS
+extern AudioBootStrap DSP_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_QSA
+extern AudioBootStrap QSAAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_SUNAUDIO
+extern AudioBootStrap SUNAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_ARTS
+extern AudioBootStrap ARTS_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_ESD
+extern AudioBootStrap ESD_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_NACL
+extern AudioBootStrap NACLAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_NAS
+extern AudioBootStrap NAS_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_XAUDIO2
+extern AudioBootStrap XAUDIO2_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_DSOUND
+extern AudioBootStrap DSOUND_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_WINMM
+extern AudioBootStrap WINMM_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_PAUDIO
+extern AudioBootStrap PAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_HAIKU
+extern AudioBootStrap HAIKUAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_COREAUDIO
+extern AudioBootStrap COREAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_DISK
+extern AudioBootStrap DISKAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_DUMMY
+extern AudioBootStrap DUMMYAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_FUSIONSOUND
+extern AudioBootStrap FUSIONSOUND_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_ANDROID
+extern AudioBootStrap ANDROIDAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_PSP
+extern AudioBootStrap PSPAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_EMSCRIPTEN
+extern AudioBootStrap EMSCRIPTENAUDIO_bootstrap;
+#endif
+
+
+
#endif /* _SDL_sysaudio_h */
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/core/linux/SDL_ime.h b/src/core/linux/SDL_ime.h
index 22b31de..35c42e2 100644
--- a/src/core/linux/SDL_ime.h
+++ b/src/core/linux/SDL_ime.h
@@ -27,12 +27,12 @@
#include "SDL_stdinc.h"
#include "SDL_rect.h"
-extern SDL_bool SDL_IME_Init();
-extern void SDL_IME_Quit();
+extern SDL_bool SDL_IME_Init(void);
+extern void SDL_IME_Quit(void);
extern void SDL_IME_SetFocus(SDL_bool focused);
-extern void SDL_IME_Reset();
+extern void SDL_IME_Reset(void);
extern SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode);
extern void SDL_IME_UpdateTextRect(SDL_Rect *rect);
-extern void SDL_IME_PumpEvents();
+extern void SDL_IME_PumpEvents(void);
#endif /* _SDL_ime_h */
diff --git a/src/core/linux/SDL_udev.c b/src/core/linux/SDL_udev.c
index ae78ddd..a80b344 100644
--- a/src/core/linux/SDL_udev.c
+++ b/src/core/linux/SDL_udev.c
@@ -280,7 +280,7 @@ SDL_UDEV_LoadLibrary(void)
#define BITS_PER_LONG (sizeof(unsigned long) * 8)
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
#define OFF(x) ((x)%BITS_PER_LONG)
-#define BIT(x) (1UL<<OFF(x))
+/* #define BIT(x) (1UL<<OFF(x)) */
#define LONG(x) ((x)/BITS_PER_LONG)
#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c
index 4391420..158c8d5 100644
--- a/src/events/SDL_gesture.c
+++ b/src/events/SDL_gesture.c
@@ -71,9 +71,9 @@ typedef struct {
SDL_bool recording;
} SDL_GestureTouch;
-SDL_GestureTouch *SDL_gestureTouch;
-int SDL_numGestureTouches = 0;
-SDL_bool recordAll;
+static SDL_GestureTouch *SDL_gestureTouch;
+static int SDL_numGestureTouches = 0;
+static SDL_bool recordAll;
#if 0
static void PrintPath(SDL_FloatPoint *path)
@@ -468,7 +468,7 @@ static SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id)
return NULL;
}
-int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist)
+static int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist)
{
SDL_Event event;
event.mgesture.type = SDL_MULTIGESTURE;
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index 4236a99..fb4fae7 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -82,6 +82,7 @@ SDL_GetMouseFocus(void)
return mouse->focus;
}
+#if 0
void
SDL_ResetMouse(void)
{
@@ -98,6 +99,7 @@ SDL_ResetMouse(void)
}
SDL_assert(mouse->buttonstate == 0);
}
+#endif
void
SDL_SetMouseFocus(SDL_Window * window)
diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c
index c73827c..918cf38 100644
--- a/src/events/SDL_touch.c
+++ b/src/events/SDL_touch.c
@@ -92,7 +92,7 @@ SDL_GetFingerIndex(const SDL_Touch * touch, SDL_FingerID fingerid)
return -1;
}
-SDL_Finger *
+static SDL_Finger *
SDL_GetFinger(const SDL_Touch * touch, SDL_FingerID id)
{
int index = SDL_GetFingerIndex(touch, id);
diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c
index ddce908..f01a593 100644
--- a/src/haptic/SDL_haptic.c
+++ b/src/haptic/SDL_haptic.c
@@ -25,7 +25,7 @@
#include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */
#include "SDL_assert.h"
-SDL_Haptic *SDL_haptics = NULL;
+static SDL_Haptic *SDL_haptics = NULL;
/*
diff --git a/src/haptic/SDL_syshaptic.h b/src/haptic/SDL_syshaptic.h
index 372cefa..a71d3a0 100644
--- a/src/haptic/SDL_syshaptic.h
+++ b/src/haptic/SDL_syshaptic.h
@@ -62,7 +62,7 @@ struct _SDL_Haptic
extern int SDL_SYS_HapticInit(void);
/* Function to return the number of haptic devices plugged in right now */
-extern int SDL_SYS_NumHaptics();
+extern int SDL_SYS_NumHaptics(void);
/*
* Gets the device dependent name of the haptic device
diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index 7b69b4a..2f32a32 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -146,7 +146,7 @@ static void UpdateEventsForDeviceRemoval()
/*
* Event filter to fire controller events from joystick ones
*/
-int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
+static int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
{
switch(event->type) {
case SDL_JOYAXISMOTION:
@@ -291,7 +291,7 @@ int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
/*
* Helper function to scan the mappings database for a controller with the specified GUID
*/
-ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID *guid)
+static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID *guid)
{
ControllerMapping_t *pSupportedController = s_pSupportedControllers;
while (pSupportedController) {
@@ -389,7 +389,7 @@ const char* SDL_GameControllerGetStringForButton(SDL_GameControllerButton axis)
/*
* given a controller button name and a joystick name update our mapping structure with it
*/
-void SDL_PrivateGameControllerParseButton(const char *szGameButton, const char *szJoystickButton, struct _SDL_ControllerMapping *pMapping)
+static void SDL_PrivateGameControllerParseButton(const char *szGameButton, const char *szJoystickButton, struct _SDL_ControllerMapping *pMapping)
{
int iSDLButton = 0;
SDL_GameControllerButton button;
@@ -502,7 +502,7 @@ SDL_PrivateGameControllerParseControllerConfigString(struct _SDL_ControllerMappi
/*
* Make a new button mapping struct
*/
-void SDL_PrivateLoadButtonMapping(struct _SDL_ControllerMapping *pMapping, SDL_JoystickGUID guid, const char *pchName, const char *pchMapping)
+static void SDL_PrivateLoadButtonMapping(struct _SDL_ControllerMapping *pMapping, SDL_JoystickGUID guid, const char *pchName, const char *pchMapping)
{
int j;
@@ -538,7 +538,7 @@ void SDL_PrivateLoadButtonMapping(struct _SDL_ControllerMapping *pMapping, SDL_J
/*
* grab the guid string from a mapping string
*/
-char *SDL_PrivateGetControllerGUIDFromMappingString(const char *pMapping)
+static char *SDL_PrivateGetControllerGUIDFromMappingString(const char *pMapping)
{
const char *pFirstComma = SDL_strchr(pMapping, ',');
if (pFirstComma) {
@@ -577,7 +577,7 @@ char *SDL_PrivateGetControllerGUIDFromMappingString(const char *pMapping)
/*
* grab the name string from a mapping string
*/
-char *SDL_PrivateGetControllerNameFromMappingString(const char *pMapping)
+static char *SDL_PrivateGetControllerNameFromMappingString(const char *pMapping)
{
const char *pFirstComma, *pSecondComma;
char *pchName;
@@ -604,7 +604,7 @@ char *SDL_PrivateGetControllerNameFromMappingString(const char *pMapping)
/*
* grab the button mapping string from a mapping string
*/
-char *SDL_PrivateGetControllerMappingFromMappingString(const char *pMapping)
+static char *SDL_PrivateGetControllerMappingFromMappingString(const char *pMapping)
{
const char *pFirstComma, *pSecondComma;
@@ -622,7 +622,7 @@ char *SDL_PrivateGetControllerMappingFromMappingString(const char *pMapping)
/*
* Helper function to refresh a mapping
*/
-void SDL_PrivateGameControllerRefreshMapping(ControllerMapping_t *pControllerMapping)
+static void SDL_PrivateGameControllerRefreshMapping(ControllerMapping_t *pControllerMapping)
{
SDL_GameController *gamecontrollerlist = SDL_gamecontrollers;
while (gamecontrollerlist) {
@@ -699,7 +699,7 @@ SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString,
/*
* Helper function to determine pre-calculated offset to certain joystick mappings
*/
-ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
+static ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
{
SDL_JoystickGUID jGUID = SDL_JoystickGetDeviceGUID(device_index);
ControllerMapping_t *mapping;
diff --git a/src/joystick/SDL_sysjoystick.h b/src/joystick/SDL_sysjoystick.h
index f4cad05..0d6d28c 100644
--- a/src/joystick/SDL_sysjoystick.h
+++ b/src/joystick/SDL_sysjoystick.h
@@ -67,10 +67,10 @@ struct _SDL_Joystick
extern int SDL_SYS_JoystickInit(void);
/* Function to return the number of joystick devices plugged in right now */
-extern int SDL_SYS_NumJoysticks();
+extern int SDL_SYS_NumJoysticks(void);
/* Function to cause any queued joystick insertions to be processed */
-extern void SDL_SYS_JoystickDetect();
+extern void SDL_SYS_JoystickDetect(void);
/* Function to get the device-dependent name of a joystick */
extern const char *SDL_SYS_JoystickNameForDeviceIndex(int device_index);
diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c
index 38a53e1..e4f01a3 100644
--- a/src/joystick/linux/SDL_sysjoystick.c
+++ b/src/joystick/linux/SDL_sysjoystick.c
@@ -282,6 +282,7 @@ MaybeRemoveDevice(const char *path)
}
#endif
+#if ! SDL_USE_LIBUDEV
static int
JoystickInitWithoutUdev(void)
{
@@ -298,7 +299,7 @@ JoystickInitWithoutUdev(void)
return numjoysticks;
}
-
+#endif
#if SDL_USE_LIBUDEV
static int
@@ -342,9 +343,9 @@ SDL_SYS_JoystickInit(void)
#if SDL_USE_LIBUDEV
return JoystickInitWithUdev();
-#endif
-
+#else
return JoystickInitWithoutUdev();
+#endif
}
int SDL_SYS_NumJoysticks()
diff --git a/src/power/SDL_power.c b/src/power/SDL_power.c
index 016013b..d559ac2 100644
--- a/src/power/SDL_power.c
+++ b/src/power/SDL_power.c
@@ -20,6 +20,7 @@
*/
#include "../SDL_internal.h"
#include "SDL_power.h"
+#include "SDL_syspower.h"
/*
* Returns SDL_TRUE if we have a definitive answer.
@@ -29,18 +30,6 @@ typedef SDL_bool
(*SDL_GetPowerInfo_Impl) (SDL_PowerState * state, int *seconds,
int *percent);
-SDL_bool SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_Haiku(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_WinRT(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *, int *, int *);
-
#ifndef SDL_POWER_DISABLED
#ifdef SDL_POWER_HARDWIRED
/* This is for things that _never_ have a battery */
diff --git a/src/power/SDL_syspower.h b/src/power/SDL_syspower.h
new file mode 100644
index 0000000..70b883d
--- /dev/null
+++ b/src/power/SDL_syspower.h
@@ -0,0 +1,68 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+#include "../SDL_internal.h"
+
+/* These are functions that need to be implemented by a port of SDL */
+
+#ifndef _SDL_syspower_h
+#define _SDL_syspower_h
+
+#include "SDL_power.h"
+
+#ifndef SDL_POWER_DISABLED
+#ifdef SDL_POWER_LINUX /* in order of preference. More than could work. */
+SDL_bool SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *, int *, int *);
+SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *, int *, int *);
+SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *, int *, int *);
+#endif
+#ifdef SDL_POWER_WINDOWS /* handles Win32, Win64, PocketPC. */
+SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *, int *, int *);
+#endif
+#ifdef SDL_POWER_UIKIT /* handles iPhone/iPad/etc */
+SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *, int *, int *);
+#endif
+#ifdef SDL_POWER_MACOSX /* handles Mac OS X, Darwin. */
+SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *, int *, int *);
+#endif
+#ifdef SDL_POWER_HAIKU /* with BeOS euc.jp apm driver. Does this work on Haiku? */
+SDL_bool SDL_GetPowerInfo_Haiku(SDL_PowerState *, int *, int *);
+#endif
+#ifdef SDL_POWER_ANDROID /* handles Android. */
+SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *);
+#endif
+#ifdef SDL_POWER_PSP /* handles PSP. */
+SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *, int *, int *);
+#endif
+#ifdef SDL_POWER_WINRT /* handles WinRT */
+SDL_bool SDL_GetPowerInfo_WinRT(SDL_PowerState *, int *, int *);
+#endif
+#ifdef SDL_POWER_EMSCRIPTEN /* handles Emscripten */
+SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *, int *, int *);
+#endif
+
+#ifdef SDL_POWER_HARDWIRED
+SDL_bool SDL_GetPowerInfo_Hardwired(SDL_PowerState *, int *, int *);
+#endif
+#endif
+
+#endif /* _SDL_syspower_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/power/linux/SDL_syspower.c b/src/power/linux/SDL_syspower.c
index 793e266..c25b449 100644
--- a/src/power/linux/SDL_syspower.c
+++ b/src/power/linux/SDL_syspower.c
@@ -32,6 +32,7 @@
#include <fcntl.h>
#include "SDL_power.h"
+#include "../SDL_syspower.h"
static const char *proc_apm_path = "/proc/apm";
static const char *proc_acpi_battery_path = "/proc/acpi/battery";
diff --git a/src/render/opengl/SDL_shaders_gl.h b/src/render/opengl/SDL_shaders_gl.h
index 261627c..0b7d8ae 100644
--- a/src/render/opengl/SDL_shaders_gl.h
+++ b/src/render/opengl/SDL_shaders_gl.h
@@ -34,7 +34,7 @@ typedef enum {
typedef struct GL_ShaderContext GL_ShaderContext;
-extern GL_ShaderContext * GL_CreateShaderContext();
+extern GL_ShaderContext * GL_CreateShaderContext(void);
extern void GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader);
extern void GL_DestroyShaderContext(GL_ShaderContext *ctx);
diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c
index 71f5b3a..fbed503 100644
--- a/src/render/opengles/SDL_render_gles.c
+++ b/src/render/opengles/SDL_render_gles.c
@@ -214,7 +214,7 @@ static int GLES_LoadFunctions(GLES_RenderData * data)
static SDL_GLContext SDL_CurrentContext = NULL;
-GLES_FBOList *
+static GLES_FBOList *
GLES_GetFBO(GLES_RenderData *data, Uint32 w, Uint32 h)
{
GLES_FBOList *result = data->framebuffers;
diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c
index c846a7b..f956bd1 100644
--- a/src/render/opengles2/SDL_render_gles2.c
+++ b/src/render/opengles2/SDL_render_gles2.c
@@ -307,7 +307,7 @@ static int GLES2_LoadFunctions(GLES2_DriverContext * data)
return 0;
}
-GLES2_FBOList *
+static GLES2_FBOList *
GLES2_GetFBO(GLES2_DriverContext *data, Uint32 w, Uint32 h)
{
GLES2_FBOList *result = data->framebuffers;
@@ -1923,7 +1923,9 @@ static int GLES2_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture)
* Renderer instantiation *
*************************************************************************************************/
+#ifdef ZUNE_HD
#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B
+#endif
static void
GLES2_ResetState(SDL_Renderer *renderer)
@@ -1963,7 +1965,7 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags)
#ifndef ZUNE_HD
GLboolean hasCompiler;
#endif
- Uint32 window_flags;
+ Uint32 window_flags = 0; /* -Wconditional-uninitialized */
GLint window_framebuffer;
GLint value;
int profile_mask = 0, major = 0, minor = 0;
diff --git a/src/render/software/SDL_blendfillrect.c b/src/render/software/SDL_blendfillrect.c
index 7cfb274..74dadbd 100644
--- a/src/render/software/SDL_blendfillrect.c
+++ b/src/render/software/SDL_blendfillrect.c
@@ -245,7 +245,7 @@ SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect,
} else {
return SDL_BlendFillRect_ARGB8888(dst, rect, blendMode, r, g, b, a);
}
- break;
+ /* break; -Wunreachable-code-break */
}
break;
default:
diff --git a/src/render/software/SDL_blendline.c b/src/render/software/SDL_blendline.c
index ef0d585..d7d0f69 100644
--- a/src/render/software/SDL_blendline.c
+++ b/src/render/software/SDL_blendline.c
@@ -685,7 +685,7 @@ SDL_CalculateBlendLineFunc(const SDL_PixelFormat * fmt)
} else {
return SDL_BlendLine_RGB2;
}
- break;
+ /* break; -Wunreachable-code-break */
case 4:
if (fmt->Rmask == 0x00FF0000) {
if (fmt->Amask) {
diff --git a/src/render/software/SDL_blendpoint.c b/src/render/software/SDL_blendpoint.c
index fc42dfe..7c919dd 100644
--- a/src/render/software/SDL_blendpoint.c
+++ b/src/render/software/SDL_blendpoint.c
@@ -235,13 +235,11 @@ SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r
switch (dst->format->Rmask) {
case 0x00FF0000:
if (!dst->format->Amask) {
- return SDL_BlendPoint_RGB888(dst, x, y, blendMode, r, g, b,
- a);
+ return SDL_BlendPoint_RGB888(dst, x, y, blendMode, r, g, b, a);
} else {
- return SDL_BlendPoint_ARGB8888(dst, x, y, blendMode, r, g, b,
- a);
+ return SDL_BlendPoint_ARGB8888(dst, x, y, blendMode, r, g, b, a);
}
- break;
+ /* break; -Wunreachable-code-break */
}
break;
default:
diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c
index 29168a9..5c899c3 100644
--- a/src/render/software/SDL_rotate.c
+++ b/src/render/software/SDL_rotate.c
@@ -79,7 +79,7 @@ to a situation where the program can segfault.
/* !
\brief Lower limit of absolute zoom factor or rotation degrees.
*/
-#define VALUE_LIMIT 0.001
+/* #define VALUE_LIMIT 0.001 */
/* !
\brief Returns colorkey info for a surface
diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c
index 3e856b5..9198cfe 100644
--- a/src/stdlib/SDL_string.c
+++ b/src/stdlib/SDL_string.c
@@ -28,9 +28,10 @@
#include "SDL_stdinc.h"
-
+#if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOL) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOLL) || !defined(HAVE_STRTOULL) || !defined(HAVE_STRTOD)
#define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F'))
#define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f'))
+#endif
#define UTF8_IsLeadByte(c) ((c) >= 0xC0 && (c) <= 0xF4)
#define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF)
diff --git a/src/test/SDL_test_crc32.c b/src/test/SDL_test_crc32.c
index 6e12208..6d5715a 100644
--- a/src/test/SDL_test_crc32.c
+++ b/src/test/SDL_test_crc32.c
@@ -69,7 +69,7 @@ int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext)
}
/* Complete CRC32 calculation on a memory block */
-
+/* un-used
int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
{
if (SDLTest_Crc32CalcStart(crcContext,crc32)) {
@@ -86,6 +86,7 @@ int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUin
return 0;
}
+*/
/* Start crc calculation */
diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c
index 9ae6536..0aeb79f 100644
--- a/src/test/SDL_test_fuzzer.c
+++ b/src/test/SDL_test_fuzzer.c
@@ -196,7 +196,7 @@ SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
*
* \returns Returns a random boundary value for the domain or 0 in case of error
*/
-Uint64
+static Uint64
SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
{
Uint64 b1, b2;
@@ -328,7 +328,7 @@ SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool v
*
* \returns Returns a random boundary value for the domain or 0 in case of error
*/
-Sint64
+static Sint64
SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
{
Sint64 b1, b2;
diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c
index 4b86c7a..7481582 100644
--- a/src/test/SDL_test_harness.c
+++ b/src/test/SDL_test_harness.c
@@ -50,7 +50,7 @@ static Uint32 SDLTest_TestCaseTimeout = 3600;
*
* \returns The generated seed string
*/
-char *
+static char *
SDLTest_GenerateRunSeed(const int length)
{
char *seed = NULL;
@@ -97,8 +97,8 @@ SDLTest_GenerateRunSeed(const int length)
* \returns The generated execution key to initialize the fuzzer with.
*
*/
-Uint64
-SDLTest_GenerateExecKey(char *runSeed, char *suiteName, char *testName, int iteration)
+static Uint64
+SDLTest_GenerateExecKey(const char *runSeed, char *suiteName, char *testName, int iteration)
{
SDLTest_Md5Context md5Context;
Uint64 *keys;
@@ -168,7 +168,7 @@ SDLTest_GenerateExecKey(char *runSeed, char *suiteName, char *testName, int iter
*
* \return Timer id or -1 on failure.
*/
-SDL_TimerID
+static SDL_TimerID
SDLTest_SetTestTimeout(int timeout, void (*callback)())
{
Uint32 timeoutInMilliseconds;
@@ -206,8 +206,8 @@ SDLTest_SetTestTimeout(int timeout, void (*callback)())
/**
* \brief Timeout handler. Aborts test run and exits harness process.
*/
-void
- SDLTest_BailOut()
+static void
+SDLTest_BailOut()
{
SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run.");
exit(TEST_ABORTED); /* bail out from the test */
@@ -223,8 +223,8 @@ void
*
* \returns Test case result.
*/
-int
-SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey, SDL_bool forceTestRun)
+static int
+SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_TestCaseReference *testCase, Uint64 execKey, SDL_bool forceTestRun)
{
SDL_TimerID timer = 0;
int testCaseResult = 0;
@@ -313,7 +313,8 @@ SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference
}
/* Prints summary of all suites/tests contained in the given reference */
-void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites)
+#if 0
+static void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites)
{
int suiteCounter;
int testCounter;
@@ -340,12 +341,13 @@ void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites)
}
}
}
+#endif
/* Gets a timer value in seconds */
-float GetClock()
+static float GetClock()
{
- float currentClock = (float)clock();
- return currentClock / (float)CLOCKS_PER_SEC;
+ float currentClock = clock() / (float) CLOCKS_PER_SEC;
+ return currentClock;
}
/**
@@ -370,7 +372,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
int testCounter;
int iterationCounter;
SDLTest_TestSuiteReference *testSuite;
- SDLTest_TestCaseReference *testCase;
+ const SDLTest_TestCaseReference *testCase;
const char *runSeed = NULL;
char *currentSuiteName;
char *currentTestName;
@@ -396,7 +398,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
Uint32 testPassedCount = 0;
Uint32 testSkippedCount = 0;
Uint32 countSum = 0;
- SDLTest_TestCaseReference **failedTests;
+ const SDLTest_TestCaseReference **failedTests;
/* Sanitize test iterations */
if (testIterations < 1) {
@@ -440,7 +442,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
}
/* Pre-allocate an array for tracking failed tests (potentially all test cases) */
- failedTests = (SDLTest_TestCaseReference **)SDL_malloc(totalNumberOfTests * sizeof(SDLTest_TestCaseReference *));
+ failedTests = (const SDLTest_TestCaseReference **)SDL_malloc(totalNumberOfTests * sizeof(SDLTest_TestCaseReference *));
if (failedTests == NULL) {
SDLTest_LogError("Unable to allocate cache for failed tests");
SDL_Error(SDL_ENOMEM);
@@ -466,7 +468,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
testCounter = 0;
while (testSuite->testCases[testCounter] && testFilter == 0)
{
- testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
+ testCase = testSuite->testCases[testCounter];
testCounter++;
if (testCase->name != NULL && SDL_strcmp(filter, testCase->name) == 0) {
/* Matched a test name */
@@ -521,7 +523,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
testCounter = 0;
while(testSuite->testCases[testCounter])
{
- testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
+ testCase = testSuite->testCases[testCounter];
currentTestName = (char *)((testCase->name) ? testCase->name : SDLTEST_INVALID_NAME_FORMAT);
testCounter++;
@@ -562,7 +564,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
if (userExecKey != 0) {
execKey = userExecKey;
} else {
- execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter);
+ execKey = SDLTest_GenerateExecKey(runSeed, testSuite->name, testCase->name, iterationCounter);
}
SDLTest_Log("Test Iteration %i: execKey %" SDL_PRIu64, iterationCounter, execKey);
diff --git a/src/test/SDL_test_imageBlit.c b/src/test/SDL_test_imageBlit.c
index 5896ca0..9cca2d9 100644
--- a/src/test/SDL_test_imageBlit.c
+++ b/src/test/SDL_test_imageBlit.c
@@ -24,7 +24,7 @@
/* GIMP RGB C-Source image dump (blit.c) */
-const SDLTest_SurfaceImage_t SDLTest_imageBlit = {
+static const SDLTest_SurfaceImage_t SDLTest_imageBlit = {
80, 60, 3,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -561,7 +561,7 @@ SDL_Surface *SDLTest_ImageBlit()
return surface;
}
-const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = {
+static const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = {
80, 60, 3,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -1044,7 +1044,7 @@ SDL_Surface *SDLTest_ImageBlitColor()
return surface;
}
-const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = {
+static const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = {
80, 60, 3,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
diff --git a/src/test/SDL_test_imageBlitBlend.c b/src/test/SDL_test_imageBlitBlend.c
index 6e8c2f1..3ee8445 100644
--- a/src/test/SDL_test_imageBlitBlend.c
+++ b/src/test/SDL_test_imageBlitBlend.c
@@ -24,7 +24,7 @@
/* GIMP RGB C-Source image dump (alpha.c) */
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = {
+static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = {
80, 60, 3,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -601,7 +601,7 @@ SDL_Surface *SDLTest_ImageBlitBlendAdd()
return surface;
}
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = {
+static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = {
80, 60, 3,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -1131,7 +1131,7 @@ SDL_Surface *SDLTest_ImageBlitBlend()
return surface;
}
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = {
+static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = {
80, 60, 3,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -1561,7 +1561,7 @@ SDL_Surface *SDLTest_ImageBlitBlendMod()
return surface;
}
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = {
+static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = {
80, 60, 3,
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
@@ -2374,7 +2374,7 @@ SDL_Surface *SDLTest_ImageBlitBlendNone()
return surface;
}
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = {
+static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = {
80, 60, 3,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
diff --git a/src/test/SDL_test_imageFace.c b/src/test/SDL_test_imageFace.c
index 84f5037..4f13cd8 100644
--- a/src/test/SDL_test_imageFace.c
+++ b/src/test/SDL_test_imageFace.c
@@ -24,7 +24,7 @@
/* GIMP RGBA C-Source image dump (face.c) */
-const SDLTest_SurfaceImage_t SDLTest_imageFace = {
+static const SDLTest_SurfaceImage_t SDLTest_imageFace = {
32, 32, 4,
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
diff --git a/src/test/SDL_test_imagePrimitives.c b/src/test/SDL_test_imagePrimitives.c
index 4ab48d2..8d562cc 100644
--- a/src/test/SDL_test_imagePrimitives.c
+++ b/src/test/SDL_test_imagePrimitives.c
@@ -24,7 +24,7 @@
/* GIMP RGB C-Source image dump (primitives.c) */
-const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = {
+static const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = {
80, 60, 3,
"\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
diff --git a/src/test/SDL_test_imagePrimitivesBlend.c b/src/test/SDL_test_imagePrimitivesBlend.c
index 5e53862..2197416 100644
--- a/src/test/SDL_test_imagePrimitivesBlend.c
+++ b/src/test/SDL_test_imagePrimitivesBlend.c
@@ -24,7 +24,7 @@
/* GIMP RGB C-Source image dump (alpha.c) */
-const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = {
+static const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = {
80, 60, 3,
"\260e\15\222\356/\37\313\15\36\330\17K\3745D\3471\0\20\0D\3502D\3502<\321"
",\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0-\0\377\377"
diff --git a/src/test/SDL_test_log.c b/src/test/SDL_test_log.c
index a2f857f..a22b10f 100644
--- a/src/test/SDL_test_log.c
+++ b/src/test/SDL_test_log.c
@@ -50,7 +50,7 @@
*
* \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02'
*/
-char *SDLTest_TimestampToString(const time_t timestamp)
+static char *SDLTest_TimestampToString(const time_t timestamp)
{
time_t copy;
static char buffer[64];
diff --git a/src/thread/SDL_systhread.h b/src/thread/SDL_systhread.h
index 05a0125..6d19427 100644
--- a/src/thread/SDL_systhread.h
+++ b/src/thread/SDL_systhread.h
@@ -55,7 +55,7 @@ extern void SDL_SYS_WaitThread(SDL_Thread * thread);
extern void SDL_SYS_DetachThread(SDL_Thread * thread);
/* Get the thread local storage for this thread */
-extern SDL_TLSData *SDL_SYS_GetTLSData();
+extern SDL_TLSData *SDL_SYS_GetTLSData(void);
/* Set the thread local storage for this thread */
extern int SDL_SYS_SetTLSData(SDL_TLSData *data);
diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h
index 554325d..e1eb171 100644
--- a/src/thread/SDL_thread_c.h
+++ b/src/thread/SDL_thread_c.h
@@ -82,7 +82,7 @@ typedef struct {
This is only intended as a fallback if getting real thread-local
storage fails or isn't supported on this platform.
*/
-extern SDL_TLSData *SDL_Generic_GetTLSData();
+extern SDL_TLSData *SDL_Generic_GetTLSData(void);
/* Set cross-platform, slow, thread local storage for this thread.
This is only intended as a fallback if getting real thread-local
diff --git a/src/thread/pthread/SDL_syscond.c b/src/thread/pthread/SDL_syscond.c
index 998ac55..69790cb 100644
--- a/src/thread/pthread/SDL_syscond.c
+++ b/src/thread/pthread/SDL_syscond.c
@@ -129,7 +129,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
switch (retval) {
case EINTR:
goto tryagain;
- break;
+ /* break; -Wunreachable-code-break */
case ETIMEDOUT:
retval = SDL_MUTEX_TIMEDOUT;
break;
diff --git a/src/thread/pthread/SDL_systls.c b/src/thread/pthread/SDL_systls.c
index 622ad02..ba85036 100644
--- a/src/thread/pthread/SDL_systls.c
+++ b/src/thread/pthread/SDL_systls.c
@@ -20,6 +20,7 @@
*/
#include "../../SDL_internal.h"
#include "SDL_thread.h"
+#include "../SDL_systhread.h"
#include "../SDL_thread_c.h"
#include <pthread.h>
diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c
index 217fe32..b3e8933 100644
--- a/src/timer/unix/SDL_systimer.c
+++ b/src/timer/unix/SDL_systimer.c
@@ -29,6 +29,7 @@
#include "SDL_timer.h"
#include "SDL_assert.h"
+#include "../SDL_timer_c.h"
/* The clock_gettime provides monotonous time, so we should use it if
it's available. The clock_gettime function is behind ifdef
diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c
index 67baaf6..4f8b0e7 100644
--- a/src/video/SDL_RLEaccel.c
+++ b/src/video/SDL_RLEaccel.c
@@ -90,9 +90,11 @@
#include "SDL_blit.h"
#include "SDL_RLEaccel_c.h"
+/*
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
+*/
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
diff --git a/src/video/SDL_blit_1.c b/src/video/SDL_blit_1.c
index 69c15d0..078d3fc 100644
--- a/src/video/SDL_blit_1.c
+++ b/src/video/SDL_blit_1.c
@@ -70,12 +70,14 @@ Blit1to1(SDL_BlitInfo * info)
}
/* This is now endian dependent */
-#if ( SDL_BYTEORDER == SDL_LIL_ENDIAN )
-#define HI 1
-#define LO 0
-#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
-#define HI 0
-#define LO 1
+#ifndef USE_DUFFS_LOOP
+# if ( SDL_BYTEORDER == SDL_LIL_ENDIAN )
+# define HI 1
+# define LO 0
+# else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
+# define HI 0
+# define LO 1
+# endif
#endif
static void
Blit1to2(SDL_BlitInfo * info)
diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c
index 2d9cf24..2cefcd1 100644
--- a/src/video/SDL_bmp.c
+++ b/src/video/SDL_bmp.c
@@ -43,8 +43,8 @@
/* Compression encodings for BMP files */
#ifndef BI_RGB
#define BI_RGB 0
-#define BI_RLE8 1
-#define BI_RLE4 2
+/* #define BI_RLE8 1 */
+/* #define BI_RLE4 2 */
#define BI_BITFIELDS 3
#endif
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 0a21ef5..b8d362e 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -46,9 +46,11 @@
#include "SDL_opengles2.h"
#endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */
+#if !SDL_VIDEO_OPENGL
#ifndef GL_CONTEXT_RELEASE_BEHAVIOR_KHR
#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB
#endif
+#endif
/* On Windows, windows.h defines CreateWindow */
#ifdef CreateWindow
@@ -3617,8 +3619,9 @@ SDL_IsScreenKeyboardShown(SDL_Window *window)
#include "x11/SDL_x11messagebox.h"
#endif
-// This function will be unused if none of the above video drivers are present.
-SDL_UNUSED static SDL_bool SDL_MessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype)
+
+#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT || SDL_VIDEO_DRIVER_COCOA || SDL_VIDEO_DRIVER_UIKIT || SDL_VIDEO_DRIVER_X11
+static SDL_bool SDL_MessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype)
{
SDL_SysWMinfo info;
SDL_Window *window = messageboxdata->window;
@@ -3634,6 +3637,7 @@ SDL_UNUSED static SDL_bool SDL_MessageboxValidForDriver(const SDL_MessageBoxData
return (info.subsystem == drivertype);
}
}
+#endif
int
SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c
index 8d7e997..cefd433 100644
--- a/src/video/x11/SDL_x11events.c
+++ b/src/video/x11/SDL_x11events.c
@@ -201,7 +201,7 @@ X11_IsWheelEvent(Display * display,XEvent * event,int * xticks,int * yticks)
On error, -1 is returned.
*/
-int X11_URIDecode(char *buf, int len) {
+static int X11_URIDecode(char *buf, int len) {
int ri, wi, di;
char decode = '\0';
if (buf == NULL || len < 0) {
diff --git a/src/video/x11/SDL_x11messagebox.c b/src/video/x11/SDL_x11messagebox.c
index fc8b1b2..a0a4a40 100644
--- a/src/video/x11/SDL_x11messagebox.c
+++ b/src/video/x11/SDL_x11messagebox.c
@@ -27,6 +27,7 @@
#include "SDL_x11video.h"
#include "SDL_x11dyn.h"
#include "SDL_assert.h"
+#include "SDL_x11messagebox.h"
#include <X11/keysym.h>
#include <locale.h>
diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c
index 29307b3..3749fb5 100644
--- a/src/video/x11/SDL_x11modes.c
+++ b/src/video/x11/SDL_x11modes.c
@@ -134,14 +134,14 @@ X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo)
} else {
return SDL_PIXELFORMAT_INDEX4MSB;
}
- break;
+ /* break; -Wunreachable-code-break */
case 1:
if (BitmapBitOrder(display) == LSBFirst) {
return SDL_PIXELFORMAT_INDEX1LSB;
} else {
return SDL_PIXELFORMAT_INDEX1MSB;
}
- break;
+ /* break; -Wunreachable-code-break */
}
}
@@ -149,7 +149,7 @@ X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo)
}
/* Global for the error handler */
-int vm_event, vm_error = -1;
+static int vm_event, vm_error = -1;
#if SDL_VIDEO_DRIVER_X11_XINERAMA
static SDL_bool
@@ -349,7 +349,7 @@ SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size_t namelen,
}
-int
+static int
X11_InitModes_XRandR(_THIS)
{
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
@@ -569,7 +569,7 @@ CalculateXVidModeRefreshRate(const XF86VidModeModeInfo * info)
info->vtotal)) : 0;
}
-SDL_bool
+static SDL_bool
SetXVidModeModeInfo(const XF86VidModeModeInfo *info, SDL_DisplayMode *mode)
{
mode->w = info->hdisplay;
@@ -584,7 +584,7 @@ int
X11_InitModes(_THIS)
{
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
- int snum, screen, screencount;
+ int snum, screen, screencount = 0;
#if SDL_VIDEO_DRIVER_X11_XINERAMA
int xinerama_major, xinerama_minor;
int use_xinerama = 0;
diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c
index 3c73f8b..c29f71d 100644
--- a/src/video/x11/SDL_x11opengl.c
+++ b/src/video/x11/SDL_x11opengl.c
@@ -519,6 +519,7 @@ X11_GL_GetVisual(_THIS, Display * display, int screen)
return vinfo;
}
+#if 0
#ifndef GLXBadContext
#define GLXBadContext 0
#endif
@@ -528,6 +529,8 @@ X11_GL_GetVisual(_THIS, Display * display, int screen)
#ifndef GLXBadProfileARB
#define GLXBadProfileARB 13
#endif
+#endif
+
static int (*handler) (Display *, XErrorEvent *) = NULL;
static const char *errorHandlerOperation = NULL;
static int errorBase = 0;
diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c
index 668bce2..7ed27ba 100644
--- a/src/video/x11/SDL_x11window.c
+++ b/src/video/x11/SDL_x11window.c
@@ -44,7 +44,7 @@
#define _NET_WM_STATE_REMOVE 0l
#define _NET_WM_STATE_ADD 1l
-#define _NET_WM_STATE_TOGGLE 2l
+/* #define _NET_WM_STATE_TOGGLE 2l */
static Bool isMapNotify(Display *dpy, XEvent *ev, XPointer win)
{