Skip to content

Commit 2bb4a0a

Browse files
author
Sean Barrett
committed
Fix trailing whitespace
1 parent 7a69424 commit 2bb4a0a

22 files changed

+896
-864
lines changed

stb.h

+99-99
Large diffs are not rendered by default.

stb_c_lexer.h

+28-28
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ enum
280280
STB_C_LEX_EQUAL_ARROW( CLEX_eqarrow )
281281

282282
#ifdef STB__clex_define_shifts
283-
CLEX_shleq, CLEX_shreq,
283+
CLEX_shleq, CLEX_shreq,
284284
#endif
285285

286286
CLEX_first_unused_token
@@ -348,7 +348,7 @@ static int stb__clex_iswhite(int x)
348348

349349
static const char *stb__strchr(const char *str, int ch)
350350
{
351-
for (; *str; ++str)
351+
for (; *str; ++str)
352352
if (*str == ch)
353353
return str;
354354
return 0;
@@ -604,14 +604,14 @@ int stb_c_lexer_get_token(stb_lexer *lexer)
604604
lexer->string[n] = 0;
605605
return stb__clex_token(lexer, CLEX_id, p, p+n-1);
606606
}
607-
607+
608608
// check for EOF
609609
STB_C_LEX_0_IS_EOF(
610610
if (*p == 0)
611611
return stb__clex_eof(tok);
612612
)
613613

614-
single_char:
614+
single_char:
615615
// not an identifier, return the character as itself
616616
return stb__clex_token(lexer, *p, p, p);
617617

@@ -929,38 +929,38 @@ This software is available under 2 licenses -- choose whichever you prefer.
929929
------------------------------------------------------------------------------
930930
ALTERNATIVE A - MIT License
931931
Copyright (c) 2017 Sean Barrett
932-
Permission is hereby granted, free of charge, to any person obtaining a copy of
933-
this software and associated documentation files (the "Software"), to deal in
934-
the Software without restriction, including without limitation the rights to
935-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
936-
of the Software, and to permit persons to whom the Software is furnished to do
932+
Permission is hereby granted, free of charge, to any person obtaining a copy of
933+
this software and associated documentation files (the "Software"), to deal in
934+
the Software without restriction, including without limitation the rights to
935+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
936+
of the Software, and to permit persons to whom the Software is furnished to do
937937
so, subject to the following conditions:
938-
The above copyright notice and this permission notice shall be included in all
938+
The above copyright notice and this permission notice shall be included in all
939939
copies or substantial portions of the Software.
940-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
941-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
942-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
943-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
944-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
945-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
940+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
941+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
942+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
943+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
944+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
945+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
946946
SOFTWARE.
947947
------------------------------------------------------------------------------
948948
ALTERNATIVE B - Public Domain (www.unlicense.org)
949949
This is free and unencumbered software released into the public domain.
950-
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
951-
software, either in source code form or as a compiled binary, for any purpose,
950+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
951+
software, either in source code form or as a compiled binary, for any purpose,
952952
commercial or non-commercial, and by any means.
953-
In jurisdictions that recognize copyright laws, the author or authors of this
954-
software dedicate any and all copyright interest in the software to the public
955-
domain. We make this dedication for the benefit of the public at large and to
956-
the detriment of our heirs and successors. We intend this dedication to be an
957-
overt act of relinquishment in perpetuity of all present and future rights to
953+
In jurisdictions that recognize copyright laws, the author or authors of this
954+
software dedicate any and all copyright interest in the software to the public
955+
domain. We make this dedication for the benefit of the public at large and to
956+
the detriment of our heirs and successors. We intend this dedication to be an
957+
overt act of relinquishment in perpetuity of all present and future rights to
958958
this software under copyright law.
959-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
960-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
961-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
962-
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
963-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
959+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
960+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
961+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
962+
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
963+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
964964
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
965965
------------------------------------------------------------------------------
966966
*/

stb_connected_components.h

+32-32
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// two points, with fast updates when changing reachability (e.g. on one machine
66
// it was typically 0.2ms w/ 1024x1024 grid). Each grid square must be "open" or
77
// "closed" (traversable or untraversable), and grid squares are only connected
8-
// to their orthogonal neighbors, not diagonally.
8+
// to their orthogonal neighbors, not diagonally.
99
//
1010
// In one source file, create the implementation by doing something like this:
1111
//
@@ -17,7 +17,7 @@
1717
// The above creates an implementation that can run on maps up to 1024x1024.
1818
// Map sizes must be a multiple of (1<<(LOG2/2)) on each axis (e.g. 32 if LOG2=10,
1919
// 16 if LOG2=8, etc.) (You can just pad your map with untraversable space.)
20-
//
20+
//
2121
// MEMORY USAGE
2222
//
2323
// Uses about 6-7 bytes per grid square (e.g. 7MB for a 1024x1024 grid).
@@ -52,7 +52,7 @@
5252
// - function for setting a grid of squares at once (just use batching)
5353
//
5454
// LICENSE
55-
//
55+
//
5656
// See end of file for license information.
5757
//
5858
// ALGORITHM
@@ -435,7 +435,7 @@ static void stbcc__build_all_connections_for_cluster(stbcc_grid *g, int cx, int
435435
i = 0;
436436
j = 0;
437437
step_x = 0;
438-
step_y = 1;
438+
step_y = 1;
439439
n = STBCC__CLUSTER_SIZE_Y;
440440
break;
441441
case 2:
@@ -599,7 +599,7 @@ void stbcc_init_grid(stbcc_grid *g, unsigned char *map, int w, int h)
599599

600600
#if 0
601601
for (j=0; j < STBCC__CLUSTER_COUNT_Y; ++j)
602-
for (i=0; i < STBCC__CLUSTER_COUNT_X; ++i)
602+
for (i=0; i < STBCC__CLUSTER_COUNT_X; ++i)
603603
g->cluster_dirty[j][i] = 0;
604604
#endif
605605

@@ -699,7 +699,7 @@ static void stbcc__remove_clump_connection(stbcc_grid *g, int x1, int y1, int x2
699699
for (i=0; i < clump->num_adjacent; ++i)
700700
if (rc.clump_index == adj[i].clump_index &&
701701
rc.cluster_dx == adj[i].cluster_dx &&
702-
rc.cluster_dy == adj[i].cluster_dy)
702+
rc.cluster_dy == adj[i].cluster_dy)
703703
break;
704704

705705
if (i < clump->num_adjacent)
@@ -736,7 +736,7 @@ static void stbcc__add_connections_to_adjacent_cluster(stbcc_grid *g, int cx, in
736736
i = 0;
737737
j = 0;
738738
step_x = 0;
739-
step_y = 1;
739+
step_y = 1;
740740
n = STBCC__CLUSTER_SIZE_Y;
741741
} else if (dy == -1) {
742742
i = 0;
@@ -797,7 +797,7 @@ static void stbcc__remove_connections_to_adjacent_cluster(stbcc_grid *g, int cx,
797797
i = 0;
798798
j = 0;
799799
step_x = 0;
800-
step_y = 1;
800+
step_y = 1;
801801
n = STBCC__CLUSTER_SIZE_Y;
802802
} else if (dy == -1) {
803803
i = 0;
@@ -1012,38 +1012,38 @@ This software is available under 2 licenses -- choose whichever you prefer.
10121012
------------------------------------------------------------------------------
10131013
ALTERNATIVE A - MIT License
10141014
Copyright (c) 2017 Sean Barrett
1015-
Permission is hereby granted, free of charge, to any person obtaining a copy of
1016-
this software and associated documentation files (the "Software"), to deal in
1017-
the Software without restriction, including without limitation the rights to
1018-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1019-
of the Software, and to permit persons to whom the Software is furnished to do
1015+
Permission is hereby granted, free of charge, to any person obtaining a copy of
1016+
this software and associated documentation files (the "Software"), to deal in
1017+
the Software without restriction, including without limitation the rights to
1018+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1019+
of the Software, and to permit persons to whom the Software is furnished to do
10201020
so, subject to the following conditions:
1021-
The above copyright notice and this permission notice shall be included in all
1021+
The above copyright notice and this permission notice shall be included in all
10221022
copies or substantial portions of the Software.
1023-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1024-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1025-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1026-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1027-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1028-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1023+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1024+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1025+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1026+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1027+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1028+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
10291029
SOFTWARE.
10301030
------------------------------------------------------------------------------
10311031
ALTERNATIVE B - Public Domain (www.unlicense.org)
10321032
This is free and unencumbered software released into the public domain.
1033-
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
1034-
software, either in source code form or as a compiled binary, for any purpose,
1033+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
1034+
software, either in source code form or as a compiled binary, for any purpose,
10351035
commercial or non-commercial, and by any means.
1036-
In jurisdictions that recognize copyright laws, the author or authors of this
1037-
software dedicate any and all copyright interest in the software to the public
1038-
domain. We make this dedication for the benefit of the public at large and to
1039-
the detriment of our heirs and successors. We intend this dedication to be an
1040-
overt act of relinquishment in perpetuity of all present and future rights to
1036+
In jurisdictions that recognize copyright laws, the author or authors of this
1037+
software dedicate any and all copyright interest in the software to the public
1038+
domain. We make this dedication for the benefit of the public at large and to
1039+
the detriment of our heirs and successors. We intend this dedication to be an
1040+
overt act of relinquishment in perpetuity of all present and future rights to
10411041
this software under copyright law.
1042-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1043-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1044-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1045-
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1046-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1042+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1043+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1044+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1045+
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1046+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
10471047
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10481048
------------------------------------------------------------------------------
10491049
*/

stb_divide.h

+26-26
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// HISTORY
55
//
6-
// v0.93 2020-02-02 Write useful exit() value from main()
6+
// v0.93 2020-02-02 Write useful exit() value from main()
77
// v0.92 2019-02-25 Fix warning
88
// v0.91 2010-02-27 Fix euclidean division by INT_MIN for non-truncating C
99
// Check result with 64-bit math to catch such cases
@@ -311,7 +311,7 @@ void test(int a, int b)
311311
if (show) printf("(%+11d,%+d) | ", a,b);
312312
q = stb_div_trunc(a,b), r = stb_mod_trunc(a,b);
313313
if (show) printf("(%+11d,%+2d) ", q,r); stbdiv_check(q,r,a,b, "trunc",a);
314-
q = stb_div_floor(a,b), r = stb_mod_floor(a,b);
314+
q = stb_div_floor(a,b), r = stb_mod_floor(a,b);
315315
if (show) printf("(%+11d,%+2d) ", q,r); stbdiv_check(q,r,a,b, "floor",b);
316316
q = stb_div_eucl (a,b), r = stb_mod_eucl (a,b);
317317
if (show) printf("(%+11d,%+2d)\n", q,r); stbdiv_check(q,r,a,b, "euclidean",1);
@@ -393,38 +393,38 @@ This software is available under 2 licenses -- choose whichever you prefer.
393393
------------------------------------------------------------------------------
394394
ALTERNATIVE A - MIT License
395395
Copyright (c) 2017 Sean Barrett
396-
Permission is hereby granted, free of charge, to any person obtaining a copy of
397-
this software and associated documentation files (the "Software"), to deal in
398-
the Software without restriction, including without limitation the rights to
399-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
400-
of the Software, and to permit persons to whom the Software is furnished to do
396+
Permission is hereby granted, free of charge, to any person obtaining a copy of
397+
this software and associated documentation files (the "Software"), to deal in
398+
the Software without restriction, including without limitation the rights to
399+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
400+
of the Software, and to permit persons to whom the Software is furnished to do
401401
so, subject to the following conditions:
402-
The above copyright notice and this permission notice shall be included in all
402+
The above copyright notice and this permission notice shall be included in all
403403
copies or substantial portions of the Software.
404-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
405-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
406-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
407-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
408-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
409-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
404+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
405+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
406+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
407+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
408+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
409+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
410410
SOFTWARE.
411411
------------------------------------------------------------------------------
412412
ALTERNATIVE B - Public Domain (www.unlicense.org)
413413
This is free and unencumbered software released into the public domain.
414-
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
415-
software, either in source code form or as a compiled binary, for any purpose,
414+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
415+
software, either in source code form or as a compiled binary, for any purpose,
416416
commercial or non-commercial, and by any means.
417-
In jurisdictions that recognize copyright laws, the author or authors of this
418-
software dedicate any and all copyright interest in the software to the public
419-
domain. We make this dedication for the benefit of the public at large and to
420-
the detriment of our heirs and successors. We intend this dedication to be an
421-
overt act of relinquishment in perpetuity of all present and future rights to
417+
In jurisdictions that recognize copyright laws, the author or authors of this
418+
software dedicate any and all copyright interest in the software to the public
419+
domain. We make this dedication for the benefit of the public at large and to
420+
the detriment of our heirs and successors. We intend this dedication to be an
421+
overt act of relinquishment in perpetuity of all present and future rights to
422422
this software under copyright law.
423-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
424-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
425-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
426-
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
427-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
423+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
424+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
425+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
426+
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
427+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
428428
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
429429
------------------------------------------------------------------------------
430430
*/

0 commit comments

Comments
 (0)