cleanup init functions of audio - use SDL_bool if possible - assume NULL/SDL_FALSE filled impl - skip zfill of current_audio at the beginning of SDL_AudioInit (done before the init() calls)
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
diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index 3514ca3..38e1f25 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -943,15 +943,14 @@ SDL_GetAudioDriver(int index)
int
SDL_AudioInit(const char *driver_name)
{
- int i = 0;
- int initialized = 0;
- int tried_to_init = 0;
+ int i;
+ SDL_bool initialized = SDL_FALSE, tried_to_init = SDL_FALSE;
if (SDL_GetCurrentAudioDriver()) {
SDL_AudioQuit(); /* shutdown driver if already running. */
}
- SDL_zero(current_audio);
+ // SDL_zero(current_audio); -- no need at this point, done before init()
SDL_zeroa(open_devices);
/* Select the proper audio driver */
@@ -977,7 +976,7 @@ SDL_AudioInit(const char *driver_name)
for (i = 0; bootstrap[i]; ++i) {
if ((driver_attempt_len == SDL_strlen(bootstrap[i]->name)) &&
(SDL_strncasecmp(bootstrap[i]->name, driver_attempt, driver_attempt_len) == 0)) {
- tried_to_init = 1;
+ tried_to_init = SDL_TRUE;
SDL_zero(current_audio);
current_audio.name = bootstrap[i]->name;
current_audio.desc = bootstrap[i]->desc;
@@ -994,7 +993,7 @@ SDL_AudioInit(const char *driver_name)
continue;
}
- tried_to_init = 1;
+ tried_to_init = SDL_TRUE;
SDL_zero(current_audio);
current_audio.name = bootstrap[i]->name;
current_audio.desc = bootstrap[i]->desc;
diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h
index 7d90a87..7c9be10 100644
--- a/src/audio/SDL_sysaudio.h
+++ b/src/audio/SDL_sysaudio.h
@@ -84,12 +84,11 @@ typedef struct SDL_AudioDriverImpl
/* !!! FIXME: add pause(), so we can optimize instead of mixing silence. */
/* Some flags to push duplicate code into the core and reduce #ifdefs. */
- /* !!! FIXME: these should be SDL_bool */
- int ProvidesOwnCallbackThread;
- int HasCaptureSupport;
- int OnlyHasDefaultOutputDevice;
- int OnlyHasDefaultCaptureDevice;
- int AllowsArbitraryDeviceNames;
+ SDL_bool ProvidesOwnCallbackThread;
+ SDL_bool HasCaptureSupport;
+ SDL_bool OnlyHasDefaultOutputDevice;
+ SDL_bool OnlyHasDefaultCaptureDevice;
+ SDL_bool AllowsArbitraryDeviceNames;
} SDL_AudioDriverImpl;
@@ -177,8 +176,8 @@ typedef struct AudioBootStrap
{
const char *name;
const char *desc;
- int (*init) (SDL_AudioDriverImpl * impl);
- int demand_only; /* 1==request explicitly, or it won't be available. */
+ SDL_bool (*init) (SDL_AudioDriverImpl * impl);
+ SDL_bool demand_only; /* 1==request explicitly, or it won't be available. */
} AudioBootStrap;
/* Not all of these are available in a given build. Use #ifdefs, etc. */
diff --git a/src/audio/aaudio/SDL_aaudio.c b/src/audio/aaudio/SDL_aaudio.c
index 4e728b5..0412e0d 100644
--- a/src/audio/aaudio/SDL_aaudio.c
+++ b/src/audio/aaudio/SDL_aaudio.c
@@ -268,7 +268,7 @@ aaudio_Deinitialize(void)
LOGI("End AAUDIO %s", SDL_GetError());
}
-static int
+static SDL_bool
aaudio_Init(SDL_AudioDriverImpl *impl)
{
aaudio_result_t res;
@@ -280,7 +280,7 @@ aaudio_Init(SDL_AudioDriverImpl *impl)
* See https://github.com/google/oboe/issues/40 for more information.
*/
if (SDL_GetAndroidSDKVersion() < 27) {
- return 0;
+ return SDL_FALSE;
}
SDL_zero(ctx);
@@ -315,12 +315,12 @@ aaudio_Init(SDL_AudioDriverImpl *impl)
/* and the capabilities */
impl->HasCaptureSupport = SDL_TRUE;
- impl->OnlyHasDefaultOutputDevice = 1;
- impl->OnlyHasDefaultCaptureDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
+ impl->OnlyHasDefaultCaptureDevice = SDL_TRUE;
/* this audio target is available. */
LOGI("SDL aaudio_Init OK");
- return 1;
+ return SDL_TRUE;
failure:
if (ctx.handle) {
@@ -331,11 +331,11 @@ failure:
}
ctx.handle = NULL;
ctx.builder = NULL;
- return 0;
+ return SDL_FALSE;
}
AudioBootStrap aaudio_bootstrap = {
- "AAudio", "AAudio audio driver", aaudio_Init, 0
+ "AAudio", "AAudio audio driver", aaudio_Init, SDL_FALSE
};
/* Pause (block) all non already paused audio devices by taking their mixer lock */
diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c
index 78a491e..83649c2 100644
--- a/src/audio/alsa/SDL_alsa_audio.c
+++ b/src/audio/alsa/SDL_alsa_audio.c
@@ -997,11 +997,11 @@ ALSA_Deinitialize(void)
UnloadALSALibrary();
}
-static int
+static SDL_bool
ALSA_Init(SDL_AudioDriverImpl * impl)
{
if (LoadALSALibrary() < 0) {
- return 0;
+ return SDL_FALSE;
}
/* Set the function pointers */
@@ -1017,12 +1017,12 @@ ALSA_Init(SDL_AudioDriverImpl * impl)
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap ALSA_bootstrap = {
- "alsa", "ALSA PCM audio", ALSA_Init, 0
+ "alsa", "ALSA PCM audio", ALSA_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_ALSA */
diff --git a/src/audio/android/SDL_androidaudio.c b/src/audio/android/SDL_androidaudio.c
index 3efa2d6..31f256a 100644
--- a/src/audio/android/SDL_androidaudio.c
+++ b/src/audio/android/SDL_androidaudio.c
@@ -120,7 +120,7 @@ ANDROIDAUDIO_CloseDevice(_THIS)
SDL_free(this->hidden);
}
-static int
+static SDL_bool
ANDROIDAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
@@ -133,14 +133,14 @@ ANDROIDAUDIO_Init(SDL_AudioDriverImpl * impl)
/* and the capabilities */
impl->HasCaptureSupport = SDL_TRUE;
- impl->OnlyHasDefaultOutputDevice = 1;
- impl->OnlyHasDefaultCaptureDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
+ impl->OnlyHasDefaultCaptureDevice = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap ANDROIDAUDIO_bootstrap = {
- "android", "SDL Android audio driver", ANDROIDAUDIO_Init, 0
+ "android", "SDL Android audio driver", ANDROIDAUDIO_Init, SDL_FALSE
};
/* Pause (block) all non already paused audio devices by taking their mixer lock */
diff --git a/src/audio/arts/SDL_artsaudio.c b/src/audio/arts/SDL_artsaudio.c
index 040d936..c85cc0b 100644
--- a/src/audio/arts/SDL_artsaudio.c
+++ b/src/audio/arts/SDL_artsaudio.c
@@ -320,16 +320,16 @@ ARTS_Deinitialize(void)
}
-static int
+static SDL_bool
ARTS_Init(SDL_AudioDriverImpl * impl)
{
if (LoadARTSLibrary() < 0) {
- return 0;
+ return SDL_FALSE;
} else {
if (SDL_NAME(arts_init) () != 0) {
UnloadARTSLibrary();
SDL_SetError("ARTS: arts_init failed (no audio server?)");
- return 0;
+ return SDL_FALSE;
}
/* Play a stream so aRts doesn't crash */
@@ -350,14 +350,14 @@ ARTS_Init(SDL_AudioDriverImpl * impl)
impl->GetDeviceBuf = ARTS_GetDeviceBuf;
impl->CloseDevice = ARTS_CloseDevice;
impl->Deinitialize = ARTS_Deinitialize;
- impl->OnlyHasDefaultOutputDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap ARTS_bootstrap = {
- "arts", "Analog RealTime Synthesizer", ARTS_Init, 0
+ "arts", "Analog RealTime Synthesizer", ARTS_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_ARTS */
diff --git a/src/audio/coreaudio/SDL_coreaudio.m b/src/audio/coreaudio/SDL_coreaudio.m
index 67d838f..cd88661 100644
--- a/src/audio/coreaudio/SDL_coreaudio.m
+++ b/src/audio/coreaudio/SDL_coreaudio.m
@@ -1152,7 +1152,7 @@ COREAUDIO_Deinitialize(void)
#endif
}
-static int
+static SDL_bool
COREAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
@@ -1164,18 +1164,18 @@ COREAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->DetectDevices = COREAUDIO_DetectDevices;
AudioObjectAddPropertyListener(kAudioObjectSystemObject, &devlist_address, device_list_changed, NULL);
#else
- impl->OnlyHasDefaultOutputDevice = 1;
- impl->OnlyHasDefaultCaptureDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
+ impl->OnlyHasDefaultCaptureDevice = SDL_TRUE;
#endif
- impl->ProvidesOwnCallbackThread = 1;
- impl->HasCaptureSupport = 1;
+ impl->ProvidesOwnCallbackThread = SDL_TRUE;
+ impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap COREAUDIO_bootstrap = {
- "coreaudio", "CoreAudio", COREAUDIO_Init, 0
+ "coreaudio", "CoreAudio", COREAUDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_COREAUDIO */
diff --git a/src/audio/directsound/SDL_directsound.c b/src/audio/directsound/SDL_directsound.c
index b4e8ce2..65b33a2 100644
--- a/src/audio/directsound/SDL_directsound.c
+++ b/src/audio/directsound/SDL_directsound.c
@@ -575,11 +575,11 @@ DSOUND_Deinitialize(void)
}
-static int
+static SDL_bool
DSOUND_Init(SDL_AudioDriverImpl * impl)
{
if (!DSOUND_Load()) {
- return 0;
+ return SDL_FALSE;
}
/* Set the function pointers */
@@ -596,11 +596,11 @@ DSOUND_Init(SDL_AudioDriverImpl * impl)
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap DSOUND_bootstrap = {
- "directsound", "DirectSound", DSOUND_Init, 0
+ "directsound", "DirectSound", DSOUND_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_DSOUND */
diff --git a/src/audio/disk/SDL_diskaudio.c b/src/audio/disk/SDL_diskaudio.c
index 56dfca5..5368df1 100644
--- a/src/audio/disk/SDL_diskaudio.c
+++ b/src/audio/disk/SDL_diskaudio.c
@@ -177,7 +177,7 @@ DISKAUDIO_DetectDevices(void)
SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, NULL, (void *) 0x2);
}
-static int
+static SDL_bool
DISKAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
@@ -191,14 +191,14 @@ DISKAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->CloseDevice = DISKAUDIO_CloseDevice;
impl->DetectDevices = DISKAUDIO_DetectDevices;
- impl->AllowsArbitraryDeviceNames = 1;
+ impl->AllowsArbitraryDeviceNames = SDL_TRUE;
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap DISKAUDIO_bootstrap = {
- "disk", "direct-to-disk audio", DISKAUDIO_Init, 1
+ "disk", "direct-to-disk audio", DISKAUDIO_Init, SDL_TRUE
};
#endif /* SDL_AUDIO_DRIVER_DISK */
diff --git a/src/audio/dsp/SDL_dspaudio.c b/src/audio/dsp/SDL_dspaudio.c
index 3c4b6aa..b0ca0f6 100644
--- a/src/audio/dsp/SDL_dspaudio.c
+++ b/src/audio/dsp/SDL_dspaudio.c
@@ -301,13 +301,13 @@ look_for_devices_test(int fd)
return 0;
}
-static int
+static SDL_bool
DSP_Init(SDL_AudioDriverImpl * impl)
{
InitTimeDevicesExist = SDL_FALSE;
SDL_EnumUnixAudioDevices(0, look_for_devices_test);
if (!InitTimeDevicesExist) {
- return 0; /* maybe try a different backend. */
+ return SDL_FALSE; /* maybe try a different backend. */
}
/* Set the function pointers */
@@ -319,15 +319,15 @@ DSP_Init(SDL_AudioDriverImpl * impl)
impl->CaptureFromDevice = DSP_CaptureFromDevice;
impl->FlushCapture = DSP_FlushCapture;
- impl->AllowsArbitraryDeviceNames = 1;
+ impl->AllowsArbitraryDeviceNames = SDL_TRUE;
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap DSP_bootstrap = {
- "dsp", "OSS /dev/dsp standard audio", DSP_Init, 0
+ "dsp", "OSS /dev/dsp standard audio", DSP_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_OSS */
diff --git a/src/audio/dummy/SDL_dummyaudio.c b/src/audio/dummy/SDL_dummyaudio.c
index e8b557a..4383243 100644
--- a/src/audio/dummy/SDL_dummyaudio.c
+++ b/src/audio/dummy/SDL_dummyaudio.c
@@ -45,22 +45,22 @@ DUMMYAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen)
return buflen;
}
-static int
+static SDL_bool
DUMMYAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->OpenDevice = DUMMYAUDIO_OpenDevice;
impl->CaptureFromDevice = DUMMYAUDIO_CaptureFromDevice;
- impl->OnlyHasDefaultOutputDevice = 1;
- impl->OnlyHasDefaultCaptureDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
+ impl->OnlyHasDefaultCaptureDevice = SDL_TRUE;
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap DUMMYAUDIO_bootstrap = {
- "dummy", "SDL dummy audio driver", DUMMYAUDIO_Init, 1
+ "dummy", "SDL dummy audio driver", DUMMYAUDIO_Init, SDL_TRUE
};
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/audio/emscripten/SDL_emscriptenaudio.c b/src/audio/emscripten/SDL_emscriptenaudio.c
index 0849ff8..0652c41 100644
--- a/src/audio/emscripten/SDL_emscriptenaudio.c
+++ b/src/audio/emscripten/SDL_emscriptenaudio.c
@@ -344,30 +344,29 @@ EMSCRIPTENAUDIO_LockOrUnlockDeviceWithNoMixerLock(SDL_AudioDevice * device)
{
}
-static int
+static SDL_bool
EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl)
{
- int available;
- int capture_available;
+ SDL_bool available, capture_available;
/* Set the function pointers */
impl->OpenDevice = EMSCRIPTENAUDIO_OpenDevice;
impl->CloseDevice = EMSCRIPTENAUDIO_CloseDevice;
- impl->OnlyHasDefaultOutputDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
/* no threads here */
impl->LockDevice = impl->UnlockDevice = EMSCRIPTENAUDIO_LockOrUnlockDeviceWithNoMixerLock;
- impl->ProvidesOwnCallbackThread = 1;
+ impl->ProvidesOwnCallbackThread = SDL_TRUE;
/* check availability */
available = EM_ASM_INT_V({
if (typeof(AudioContext) !== 'undefined') {
- return 1;
+ return SDL_TRUE;
} else if (typeof(webkitAudioContext) !== 'undefined') {
- return 1;
+ return SDL_TRUE;
}
- return 0;
+ return SDL_FALSE;
});
if (!available) {
@@ -376,11 +375,11 @@ EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl)
capture_available = available && EM_ASM_INT_V({
if ((typeof(navigator.mediaDevices) !== 'undefined') && (typeof(navigator.mediaDevices.getUserMedia) !== 'undefined')) {
- return 1;
+ return SDL_TRUE;
} else if (typeof(navigator.webkitGetUserMedia) !== 'undefined') {
- return 1;
+ return SDL_TRUE;
}
- return 0;
+ return SDL_FALSE;
});
impl->HasCaptureSupport = capture_available ? SDL_TRUE : SDL_FALSE;
@@ -390,7 +389,7 @@ EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl)
}
AudioBootStrap EMSCRIPTENAUDIO_bootstrap = {
- "emscripten", "SDL emscripten audio driver", EMSCRIPTENAUDIO_Init, 0
+ "emscripten", "SDL emscripten audio driver", EMSCRIPTENAUDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_EMSCRIPTEN */
diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c
index b0b794d..14035bd 100644
--- a/src/audio/esd/SDL_esdaudio.c
+++ b/src/audio/esd/SDL_esdaudio.c
@@ -293,11 +293,11 @@ ESD_Deinitialize(void)
UnloadESDLibrary();
}
-static int
+static SDL_bool
ESD_Init(SDL_AudioDriverImpl * impl)
{
if (LoadESDLibrary() < 0) {
- return 0;
+ return SDL_FALSE;
} else {
int connection = 0;
@@ -308,7 +308,7 @@ ESD_Init(SDL_AudioDriverImpl * impl)
if (connection < 0) {
UnloadESDLibrary();
SDL_SetError("ESD: esd_open_sound failed (no audio server?)");
- return 0;
+ return SDL_FALSE;
}
SDL_NAME(esd_close) (connection);
}
@@ -320,14 +320,14 @@ ESD_Init(SDL_AudioDriverImpl * impl)
impl->GetDeviceBuf = ESD_GetDeviceBuf;
impl->CloseDevice = ESD_CloseDevice;
impl->Deinitialize = ESD_Deinitialize;
- impl->OnlyHasDefaultOutputDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap ESD_bootstrap = {
- "esd", "Enlightened Sound Daemon", ESD_Init, 0
+ "esd", "Enlightened Sound Daemon", ESD_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_ESD */
diff --git a/src/audio/fusionsound/SDL_fsaudio.c b/src/audio/fusionsound/SDL_fsaudio.c
index 5f24cf4..af376a9 100644
--- a/src/audio/fusionsound/SDL_fsaudio.c
+++ b/src/audio/fusionsound/SDL_fsaudio.c
@@ -288,11 +288,11 @@ SDL_FS_Deinitialize(void)
}
-static int
+static SDL_bool
SDL_FS_Init(SDL_AudioDriverImpl * impl)
{
if (LoadFusionSoundLibrary() < 0) {
- return 0;
+ return SDL_FALSE;
} else {
DirectResult ret;
@@ -302,7 +302,7 @@ SDL_FS_Init(SDL_AudioDriverImpl * impl)
SDL_SetError
("FusionSound: SDL_FS_init failed (FusionSoundInit: %d)",
ret);
- return 0;
+ return SDL_FALSE;
}
}
@@ -313,14 +313,14 @@ SDL_FS_Init(SDL_AudioDriverImpl * impl)
impl->GetDeviceBuf = SDL_FS_GetDeviceBuf;
impl->CloseDevice = SDL_FS_CloseDevice;
impl->Deinitialize = SDL_FS_Deinitialize;
- impl->OnlyHasDefaultOutputDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap FUSIONSOUND_bootstrap = {
- "fusionsound", "FusionSound", SDL_FS_Init, 0
+ "fusionsound", "FusionSound", SDL_FS_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND */
diff --git a/src/audio/haiku/SDL_haikuaudio.cc b/src/audio/haiku/SDL_haikuaudio.cc
index 82da478..fe07b69 100644
--- a/src/audio/haiku/SDL_haikuaudio.cc
+++ b/src/audio/haiku/SDL_haikuaudio.cc
@@ -216,22 +216,22 @@ HAIKUAUDIO_Deinitialize(void)
SDL_QuitBeApp();
}
-static int
+static SDL_bool
HAIKUAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Initialize the Be Application, if it's not already started */
if (SDL_InitBeApp() < 0) {
- return 0;
+ return SDL_FALSE;
}
/* Set the function pointers */
impl->OpenDevice = HAIKUAUDIO_OpenDevice;
impl->CloseDevice = HAIKUAUDIO_CloseDevice;
impl->Deinitialize = HAIKUAUDIO_Deinitialize;
- impl->ProvidesOwnCallbackThread = 1;
- impl->OnlyHasDefaultOutputDevice = 1;
+ impl->ProvidesOwnCallbackThread = SDL_TRUE;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
extern "C"
@@ -239,7 +239,7 @@ extern "C"
extern AudioBootStrap HAIKUAUDIO_bootstrap;
}
AudioBootStrap HAIKUAUDIO_bootstrap = {
- "haiku", "Haiku BSoundPlayer", HAIKUAUDIO_Init, 0
+ "haiku", "Haiku BSoundPlayer", HAIKUAUDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_HAIKU */
diff --git a/src/audio/jack/SDL_jackaudio.c b/src/audio/jack/SDL_jackaudio.c
index 1c8aa0b..9f68a31 100644
--- a/src/audio/jack/SDL_jackaudio.c
+++ b/src/audio/jack/SDL_jackaudio.c
@@ -405,18 +405,18 @@ JACK_Deinitialize(void)
UnloadJackLibrary();
}
-static int
+static SDL_bool
JACK_Init(SDL_AudioDriverImpl * impl)
{
if (LoadJackLibrary() < 0) {
- return 0;
+ return SDL_FALSE;
} else {
/* Make sure a JACK server is running and available. */
jack_status_t status;
jack_client_t *client = JACK_jack_client_open("SDL", JackNoStartServer, &status, NULL);
if (client == NULL) {
UnloadJackLibrary();
- return 0;
+ return SDL_FALSE;
}
JACK_jack_client_close(client);
}
@@ -433,11 +433,11 @@ JACK_Init(SDL_AudioDriverImpl * impl)
impl->OnlyHasDefaultCaptureDevice = SDL_TRUE;
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap JACK_bootstrap = {
- "jack", "JACK Audio Connection Kit", JACK_Init, 0
+ "jack", "JACK Audio Connection Kit", JACK_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_JACK */
diff --git a/src/audio/nacl/SDL_naclaudio.c b/src/audio/nacl/SDL_naclaudio.c
index c651cfc..9d698ad 100644
--- a/src/audio/nacl/SDL_naclaudio.c
+++ b/src/audio/nacl/SDL_naclaudio.c
@@ -133,18 +133,18 @@ NACLAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) {
return 0;
}
-static int
+static SDL_bool
NACLAUDIO_Init(SDL_AudioDriverImpl * impl)
{
if (PSGetInstanceId() == 0) {
- return 0;
+ return SDL_FALSE;
}
/* Set the function pointers */
impl->OpenDevice = NACLAUDIO_OpenDevice;
impl->CloseDevice = NACLAUDIO_CloseDevice;
- impl->OnlyHasDefaultOutputDevice = 1;
- impl->ProvidesOwnCallbackThread = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
+ impl->ProvidesOwnCallbackThread = SDL_TRUE;
/*
* impl->WaitDevice = NACLAUDIO_WaitDevice;
* impl->GetDeviceBuf = NACLAUDIO_GetDeviceBuf;
@@ -152,12 +152,12 @@ NACLAUDIO_Init(SDL_AudioDriverImpl * impl)
* impl->Deinitialize = NACLAUDIO_Deinitialize;
*/
- return 1;
+ return SDL_TRUE;
}
AudioBootStrap NACLAUDIO_bootstrap = {
NACLAUDIO_DRIVER_NAME, "SDL NaCl Audio Driver",
- NACLAUDIO_Init, 0
+ NACLAUDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_NACL */
diff --git a/src/audio/nas/SDL_nasaudio.c b/src/audio/nas/SDL_nasaudio.c
index 87cda5e..d19c150 100644
--- a/src/audio/nas/SDL_nasaudio.c
+++ b/src/audio/nas/SDL_nasaudio.c
@@ -423,16 +423,16 @@ NAS_Deinitialize(void)
UnloadNASLibrary();
}
-static int
+static SDL_bool
NAS_Init(SDL_AudioDriverImpl * impl)
{
if (LoadNASLibrary() < 0) {
- return 0;
+ return SDL_FALSE;
} else {
AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL);
if (aud == NULL) {
SDL_SetError("NAS: AuOpenServer() failed (no audio server?)");
- return 0;
+ return SDL_FALSE;
}
NAS_AuCloseServer(aud);
}
@@ -447,15 +447,15 @@ NAS_Init(SDL_AudioDriverImpl * impl)
impl->CloseDevice = NAS_CloseDevice;
impl->Deinitialize = NAS_Deinitialize;
- impl->OnlyHasDefaultOutputDevice = 1;
- impl->OnlyHasDefaultCaptureDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
+ impl->OnlyHasDefaultCaptureDevice = SDL_TRUE;
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap NAS_bootstrap = {
- "nas", "Network Audio System", NAS_Init, 0
+ "nas", "Network Audio System", NAS_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_NAS */
diff --git a/src/audio/netbsd/SDL_netbsdaudio.c b/src/audio/netbsd/SDL_netbsdaudio.c
index b061ce7..2a62f94 100644
--- a/src/audio/netbsd/SDL_netbsdaudio.c
+++ b/src/audio/netbsd/SDL_netbsdaudio.c
@@ -326,7 +326,7 @@ NETBSDAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
return 0;
}
-static int
+static SDL_bool
NETBSDAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
@@ -339,14 +339,14 @@ NETBSDAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->FlushCapture = NETBSDAUDIO_FlushCapture;
impl->HasCaptureSupport = SDL_TRUE;
- impl->AllowsArbitraryDeviceNames = 1;
+ impl->AllowsArbitraryDeviceNames = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap NETBSDAUDIO_bootstrap = {
- "netbsd", "NetBSD audio", NETBSDAUDIO_Init, 0
+ "netbsd", "NetBSD audio", NETBSDAUDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_NETBSD */
diff --git a/src/audio/openslES/SDL_openslES.c b/src/audio/openslES/SDL_openslES.c
index ad02090..e7743a5 100644
--- a/src/audio/openslES/SDL_openslES.c
+++ b/src/audio/openslES/SDL_openslES.c
@@ -714,13 +714,13 @@ openslES_CloseDevice(_THIS)
SDL_free(this->hidden);
}
-static int
+static SDL_bool
openslES_Init(SDL_AudioDriverImpl * impl)
{
LOGI("openslES_Init() called");
if (!openslES_CreateEngine()) {
- return 0;
+ return SDL_FALSE;
}
LOGI("openslES_Init() - set pointers");
@@ -736,18 +736,18 @@ openslES_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = openslES_DestroyEngine;
/* and the capabilities */
- impl->HasCaptureSupport = 1;
- impl->OnlyHasDefaultOutputDevice = 1;
- impl->OnlyHasDefaultCaptureDevice = 1;
+ impl->HasCaptureSupport = SDL_TRUE;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
+ impl->OnlyHasDefaultCaptureDevice = SDL_TRUE;
LOGI("openslES_Init() - success");
/* this audio target is available. */
- return 1;
+ return SDL_TRUE;
}
AudioBootStrap openslES_bootstrap = {
- "openslES", "opensl ES audio driver", openslES_Init, 0
+ "openslES", "opensl ES audio driver", openslES_Init, SDL_FALSE
};
void openslES_ResumeDevices(void)
diff --git a/src/audio/os2/SDL_os2audio.c b/src/audio/os2/SDL_os2audio.c
index 5fa1ad4..e8f431e 100644
--- a/src/audio/os2/SDL_os2audio.c
+++ b/src/audio/os2/SDL_os2audio.c
@@ -423,7 +423,7 @@ static int OS2_OpenDevice(_THIS, void *handle, const char *devname,
}
-static int OS2_Init(SDL_AudioDriverImpl * impl)
+static SDL_bool OS2_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->DetectDevices = OS2_DetectDevices;
@@ -438,12 +438,12 @@ static int OS2_Init(SDL_AudioDriverImpl * impl)
impl->FlushCapture = ;
impl->HasCaptureSupport = SDL_TRUE;
*/
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap OS2AUDIO_bootstrap = {
- "DART", "OS/2 DART", OS2_Init, 0
+ "DART", "OS/2 DART", OS2_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_OS2 */
diff --git a/src/audio/paudio/SDL_paudio.c b/src/audio/paudio/SDL_paudio.c
index c4f40b3..b630ae9 100644
--- a/src/audio/paudio/SDL_paudio.c
+++ b/src/audio/paudio/SDL_paudio.c
@@ -485,14 +485,14 @@ PAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
return 0;
}
-static int
+static SDL_bool
PAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* !!! FIXME: not right for device enum? */
int fd = OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
if (fd < 0) {
SDL_SetError("PAUDIO: Couldn't open audio device");
- return 0;
+ return SDL_FALSE;
}
close(fd);
@@ -502,13 +502,13 @@ PAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->PlayDevice = PAUDIO_WaitDevice;
impl->GetDeviceBuf = PAUDIO_GetDeviceBuf;
impl->CloseDevice = PAUDIO_CloseDevice;
- impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE; /* !!! FIXME: add device enum! */
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap PAUDIO_bootstrap = {
- "paud", "AIX Paudio", PAUDIO_Init, 0
+ "paud", "AIX Paudio", PAUDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_PAUDIO */
diff --git a/src/audio/pipewire/SDL_pipewire.c b/src/audio/pipewire/SDL_pipewire.c
index 6d436f9..893d0c4 100644
--- a/src/audio/pipewire/SDL_pipewire.c
+++ b/src/audio/pipewire/SDL_pipewire.c
@@ -1223,19 +1223,19 @@ PIPEWIRE_Deinitialize()
}
}
-static int
+static SDL_bool
PIPEWIRE_Init(SDL_AudioDriverImpl *impl)
{
if (!pipewire_initialized) {
if (init_pipewire_library() < 0) {
- return 0;
+ return SDL_FALSE;
}
pipewire_initialized = SDL_TRUE;
if (hotplug_loop_init() < 0) {
PIPEWIRE_Deinitialize();
- return 0;
+ return SDL_FALSE;
}
}
@@ -1245,13 +1245,13 @@ PIPEWIRE_Init(SDL_AudioDriverImpl *impl)
impl->CloseDevice = PIPEWIRE_CloseDevice;
impl->Deinitialize = PIPEWIRE_Deinitialize;
- impl->HasCaptureSupport = 1;
- impl->ProvidesOwnCallbackThread = 1;
+ impl->HasCaptureSupport = SDL_TRUE;
+ impl->ProvidesOwnCallbackThread = SDL_TRUE;
- return 1;
+ return SDL_TRUE;
}
-AudioBootStrap PIPEWIRE_bootstrap = { "pipewire", "Pipewire", PIPEWIRE_Init, 0 };
+AudioBootStrap PIPEWIRE_bootstrap = { "pipewire", "Pipewire", PIPEWIRE_Init, SDL_FALSE };
#endif /* SDL_AUDIO_DRIVER_PIPEWIRE */
diff --git a/src/audio/psp/SDL_pspaudio.c b/src/audio/psp/SDL_pspaudio.c
index 1966caf..cbceaf4 100644
--- a/src/audio/psp/SDL_pspaudio.c
+++ b/src/audio/psp/SDL_pspaudio.c
@@ -158,7 +158,7 @@ static void PSPAUDIO_ThreadInit(_THIS)
}
}
-static int
+static SDL_bool
PSPAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
@@ -170,16 +170,16 @@ PSPAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->ThreadInit = PSPAUDIO_ThreadInit;
/* PSP audio device */
- impl->OnlyHasDefaultOutputDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
/*
- impl->HasCaptureSupport = 1;
- impl->OnlyHasDefaultCaptureDevice = 1;
+ impl->HasCaptureSupport = SDL_TRUE;
+ impl->OnlyHasDefaultCaptureDevice = SDL_TRUE;
*/
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap PSPAUDIO_bootstrap = {
- "psp", "PSP audio driver", PSPAUDIO_Init, 0
+ "psp", "PSP audio driver", PSPAUDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_PSP */
diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c
index bf16839..dfa38d0 100644
--- a/src/audio/pulseaudio/SDL_pulseaudio.c
+++ b/src/audio/pulseaudio/SDL_pulseaudio.c
@@ -832,16 +832,16 @@ PULSEAUDIO_Deinitialize(void)
UnloadPulseAudioLibrary();
}
-static int
+static SDL_bool
PULSEAUDIO_Init(SDL_AudioDriverImpl * impl)
{
if (LoadPulseAudioLibrary() < 0) {
- return 0;
+ return SDL_FALSE;
}
if (ConnectToPulseServer(&hotplug_mainloop, &hotplug_context) < 0) {
UnloadPulseAudioLibrary();
- return 0;
+ return SDL_FALSE;
}
include_monitors = SDL_GetHintBoolean(SDL_HINT_AUDIO_INCLUDE_MONITORS, SDL_FALSE);
@@ -859,11 +859,11 @@ PULSEAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap PULSEAUDIO_bootstrap = {
- "pulseaudio", "PulseAudio", PULSEAUDIO_Init, 0
+ "pulseaudio", "PulseAudio", PULSEAUDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_PULSEAUDIO */
diff --git a/src/audio/qsa/SDL_qsa_audio.c b/src/audio/qsa/SDL_qsa_audio.c
index 106d9f8..ca43907 100644
--- a/src/audio/qsa/SDL_qsa_audio.c
+++ b/src/audio/qsa/SDL_qsa_audio.c
@@ -635,7 +635,7 @@ QSA_Deinitialize(void)
qsa_capture_devices = 0;
}
-static int
+static SDL_bool
QSA_Init(SDL_AudioDriverImpl * impl)
{
/* Clear devices array */
@@ -655,19 +655,14 @@ QSA_Init(SDL_AudioDriverImpl * impl)
impl->GetDeviceBuf = QSA_GetDeviceBuf;
impl->CloseDevice = QSA_CloseDevice;
impl->Deinitialize = QSA_Deinitialize;
- impl->LockDevice = NULL;
- impl->UnlockDevice = NULL;
- impl->ProvidesOwnCallbackThread = 0;
- impl->HasCaptureSupport = 1;
- impl->OnlyHasDefaultOutputDevice = 0;
- impl->OnlyHasDefaultCaptureDevice = 0;
+ impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap QSAAUDIO_bootstrap = {
- "qsa", "QNX QSA Audio", QSA_Init, 0
+ "qsa", "QNX QSA Audio", QSA_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_QSA */
diff --git a/src/audio/sndio/SDL_sndioaudio.c b/src/audio/sndio/SDL_sndioaudio.c
index aa2f83a..4656f37 100644
--- a/src/audio/sndio/SDL_sndioaudio.c
+++ b/src/audio/sndio/SDL_sndioaudio.c
@@ -357,11 +357,11 @@ SNDIO_DetectDevices(void)
SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, NULL, (void *) 0x2);
}
-static int
+static SDL_bool
SNDIO_Init(SDL_AudioDriverImpl * impl)
{
if (LoadSNDIOLibrary() < 0) {
- return 0;
+ return SDL_FALSE;
}
/* Set the function pointers */
@@ -375,14 +375,14 @@ SNDIO_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = SNDIO_Deinitialize;
impl->DetectDevices = SNDIO_DetectDevices;
- impl->AllowsArbitraryDeviceNames = 1;
+ impl->AllowsArbitraryDeviceNames = SDL_TRUE;
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap SNDIO_bootstrap = {
- "sndio", "OpenBSD sndio", SNDIO_Init, 0
+ "sndio", "OpenBSD sndio", SNDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_SNDIO */
diff --git a/src/audio/sun/SDL_sunaudio.c b/src/audio/sun/SDL_sunaudio.c
index a78ec74..7a461d2 100644
--- a/src/audio/sun/SDL_sunaudio.c
+++ b/src/audio/sun/SDL_sunaudio.c
@@ -394,7 +394,7 @@ snd2au(int sample)
return (mask & sample);
}
-static int
+static SDL_bool
SUNAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
@@ -405,13 +405,13 @@ SUNAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->GetDeviceBuf = SUNAUDIO_GetDeviceBuf;
impl->CloseDevice = SUNAUDIO_CloseDevice;
- impl->AllowsArbitraryDeviceNames = 1;
+ impl->AllowsArbitraryDeviceNames = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap SUNAUDIO_bootstrap = {
- "audio", "UNIX /dev/audio interface", SUNAUDIO_Init, 0
+ "audio", "UNIX /dev/audio interface", SUNAUDIO_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_SUNAUDIO */
diff --git a/src/audio/vita/SDL_vitaaudio.c b/src/audio/vita/SDL_vitaaudio.c
index 5433594..62b4a39 100644
--- a/src/audio/vita/SDL_vitaaudio.c
+++ b/src/audio/vita/SDL_vitaaudio.c
@@ -154,7 +154,7 @@ static void VITAAUD_ThreadInit(_THIS)
}
}
-static int
+static SDL_bool
VITAAUD_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
@@ -166,16 +166,16 @@ VITAAUD_Init(SDL_AudioDriverImpl * impl)
impl->ThreadInit = VITAAUD_ThreadInit;
/* VITA audio device */
- impl->OnlyHasDefaultOutputDevice = 1;
+ impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
/*
- impl->HasCaptureSupport = 1;
- impl->OnlyHasDefaultInputDevice = 1;
+ impl->HasCaptureSupport = SDL_TRUE;
+ impl->OnlyHasDefaultInputDevice = SDL_TRUE;
*/
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap VITAAUD_bootstrap = {
- "vita", "VITA audio driver", VITAAUD_Init, 0
+ "vita", "VITA audio driver", VITAAUD_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_VITA */
diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c
index 8f287cd..942e66e 100644
--- a/src/audio/wasapi/SDL_wasapi.c
+++ b/src/audio/wasapi/SDL_wasapi.c
@@ -713,14 +713,14 @@ WASAPI_Deinitialize(void)
deviceid_list = NULL;
}
-static int
+static SDL_bool
WASAPI_Init(SDL_AudioDriverImpl * impl)
{
SDL_AtomicSet(&WASAPI_DefaultPlaybackGeneration, 1);
SDL_AtomicSet(&WASAPI_DefaultCaptureGeneration, 1);
if (WASAPI_PlatformInit() == -1) {
- return 0;
+ return SDL_FALSE;
}
/* Set the function pointers */
@@ -736,13 +736,13 @@ WASAPI_Init(SDL_AudioDriverImpl * impl)
impl->FlushCapture = WASAPI_FlushCapture;
impl->CloseDevice = WASAPI_CloseDevice;
impl->Deinitialize = WASAPI_Deinitialize;
- impl->HasCaptureSupport = 1;
+ impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap WASAPI_bootstrap = {
- "wasapi", "WASAPI", WASAPI_Init, 0
+ "wasapi", "WASAPI", WASAPI_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_WASAPI */
diff --git a/src/audio/winmm/SDL_winmm.c b/src/audio/winmm/SDL_winmm.c
index e79d6ee..d74120a 100644
--- a/src/audio/winmm/SDL_winmm.c
+++ b/src/audio/winmm/SDL_winmm.c
@@ -434,7 +434,7 @@ WINMM_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
return 0; /* Ready to go! */
}
-static int
+static SDL_bool
WINMM_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
@@ -449,11 +449,11 @@ WINMM_Init(SDL_AudioDriverImpl * impl)
impl->HasCaptureSupport = SDL_TRUE;
- return 1; /* this audio target is available. */
+ return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap WINMM_bootstrap = {
- "winmm", "Windows Waveform Audio", WINMM_Init, 0
+ "winmm", "Windows Waveform Audio", WINMM_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_WINMM */