UNIX line endings on 2 files
authorJohn Tsiombikas <nuclear@member.fsf.org>
Mon, 16 May 2022 04:29:14 +0000 (07:29 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Mon, 16 May 2022 04:29:14 +0000 (07:29 +0300)
.clang-format
src/sball.h
src/scr/thunder.c

index b54f2e9..5788564 100644 (file)
@@ -1,3 +1,33 @@
+UseCRLF: false
 UseTab: Always
+TabWidth: 4
 IndentWidth: 4
-ColumnLimit: 90
+ColumnLimit: 95
+SortIncludes: Never
+SpaceBeforeParens: Never
+BreakBeforeBraces: Custom
+BraceWrapping:
+       AfterFunction: true
+AlignAfterOpenBracket: DontAlign
+AlignConsecutiveAssignments: None
+AlignConsecutiveMacros: AcrossEmptyLines
+AlignEscapedNewlines: DontAlign
+AlignOperands: DontAlign
+AllowAllArgumentsOnNextLine: false
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortEnumsOnASingleLine: true
+AllowShortIfStatementsOnASingleLine: WithoutElse
+AllowShortLoopsOnASingleLine: true
+BinPackArguments: true
+BinPackParameters: true
+BreakBeforeBinaryOperators: NonAssignment
+BreakStringLiterals: true
+SpaceInEmptyParentheses: false
+IndentCaseLabels: false
+ReflowComments: true
+PointerAlignment: Right
+SpacesInCStyleCastParentheses: false
+SpaceAfterCStyleCast: false
+PenaltyBreakAssignment: 1000
+SpaceBeforeParens: Never
+SpaceAfterLogicalNot: false
index e12b12c..e26d336 100644 (file)
@@ -1,36 +1,36 @@
-#ifndef SBALL_H_\r
-#define SBALL_H_\r
-\r
-enum {\r
-       SBALL_EV_NONE,\r
-       SBALL_EV_MOTION,\r
-       SBALL_EV_BUTTON\r
-};\r
-\r
-struct sball_event_motion {\r
-       int type;\r
-       int motion[6];\r
-};\r
-\r
-struct sball_event_button {\r
-       int type;\r
-       int id;\r
-       int pressed;\r
-       unsigned int state;\r
-};\r
-\r
-typedef union sball_event {\r
-       int type;\r
-       struct sball_event_motion motion;\r
-       struct sball_event_button button;\r
-} sball_event;\r
-\r
-int sball_init(void);\r
-void sball_shutdown(void);\r
-\r
-int sball_getdev(void);\r
-\r
-int sball_pending(void);\r
-int sball_getevent(sball_event *ev);\r
-\r
-#endif /* SBALL_H_ */\r
+#ifndef SBALL_H_
+#define SBALL_H_
+
+enum {
+       SBALL_EV_NONE,
+       SBALL_EV_MOTION,
+       SBALL_EV_BUTTON
+};
+
+struct sball_event_motion {
+       int type;
+       int motion[6];
+};
+
+struct sball_event_button {
+       int type;
+       int id;
+       int pressed;
+       unsigned int state;
+};
+
+typedef union sball_event {
+       int type;
+       struct sball_event_motion motion;
+       struct sball_event_button button;
+} sball_event;
+
+int sball_init(void);
+void sball_shutdown(void);
+
+int sball_getdev(void);
+
+int sball_pending(void);
+int sball_getevent(sball_event *ev);
+
+#endif /* SBALL_H_ */
index 062eb57..3aa3b7e 100644 (file)
@@ -377,62 +377,62 @@ unsigned char fog(float z) {
        return (unsigned char)ret;
 }
 
-void sort(PointSprite *begin, PointSprite *end) {\r
-       PointSprite pivotValue;\r
-       size_t sz;\r
-       PointSprite *left, *right;\r
-       int leftCond, rightCond;\r
-       PointSprite tmp;\r
-\r
-       sz = end - begin;\r
-\r
-       if (sz < 2) return; /* already sorted */\r
-       if (sz == 2) {\r
-               /* trivial case */\r
-               if (begin[1] < begin[0]) {\r
-                       tmp = begin[0];\r
-                       begin[0] = begin[1];\r
-                       begin[1] = tmp;\r
-                       return;\r
-               }\r
-       }\r
-\r
-       /* minimum 3 elements from now on */\r
-\r
-       /* choose a pivot near the middle, since we frequently sort already sorted arrays */\r
-       pivotValue = begin[sz / 2];\r
-\r
-       left = begin;\r
-       right = end - 1;\r
-\r
-       while (right > left) {\r
-               /* check if left and right elements meet the conditions */\r
-               leftCond = pivotValue >= *left;\r
-               rightCond = pivotValue < *right;\r
-\r
-               if (!leftCond && !rightCond) {\r
-                       tmp = *left;\r
-                       *left = *right;\r
-                       *right = tmp;\r
-                       left++;\r
-                       right--;\r
-               }\r
-               else if (leftCond && rightCond) {\r
-                       left++;\r
-                       right--;\r
-               }\r
-               else if (leftCond) {\r
-                       left++;\r
-               }\r
-               else {\r
-                       right--;\r
-               }\r
-       }\r
-\r
-       /* recursion */\r
-       sort(begin, left);\r
-       sort(left, end);\r
-}\r
+void sort(PointSprite *begin, PointSprite *end) {
+       PointSprite pivotValue;
+       size_t sz;
+       PointSprite *left, *right;
+       int leftCond, rightCond;
+       PointSprite tmp;
+
+       sz = end - begin;
+
+       if (sz < 2) return; /* already sorted */
+       if (sz == 2) {
+               /* trivial case */
+               if (begin[1] < begin[0]) {
+                       tmp = begin[0];
+                       begin[0] = begin[1];
+                       begin[1] = tmp;
+                       return;
+               }
+       }
+
+       /* minimum 3 elements from now on */
+
+       /* choose a pivot near the middle, since we frequently sort already sorted arrays */
+       pivotValue = begin[sz / 2];
+
+       left = begin;
+       right = end - 1;
+
+       while (right > left) {
+               /* check if left and right elements meet the conditions */
+               leftCond = pivotValue >= *left;
+               rightCond = pivotValue < *right;
+
+               if (!leftCond && !rightCond) {
+                       tmp = *left;
+                       *left = *right;
+                       *right = tmp;
+                       left++;
+                       right--;
+               }
+               else if (leftCond && rightCond) {
+                       left++;
+                       right--;
+               }
+               else if (leftCond) {
+                       left++;
+               }
+               else {
+                       right--;
+               }
+       }
+
+       /* recursion */
+       sort(begin, left);
+       sort(left, end);
+}
 
 void sortPointSprites() {
        sort(pointSprites, pointSprites + pointSpriteCount);