applied uncrustify to io source

master
Anton Lydike 3 years ago
parent 5128b0376f
commit 7246772787

@ -28,7 +28,7 @@ void dbgln(char* text, int len)
/* alphabet for itoa */ /* alphabet for itoa */
char alpha[16] = "0123456789abcdef"; char alpha[16] = "0123456789abcdef";
char* itoa (int value, char* str, int base) char* itoa(int value, char* str, int base)
{ {
if (base > 16 || base < 2) { if (base > 16 || base < 2) {
*str++ = '?'; *str++ = '?';
@ -42,6 +42,7 @@ char* itoa (int value, char* str, int base)
int digits = 0; int digits = 0;
int num = 0; int num = 0;
// reverse number // reverse number
do { do {
num = num * base; num = num * base;
@ -56,8 +57,7 @@ char* itoa (int value, char* str, int base)
value = value / base; value = value / base;
*str++ = alpha[num]; *str++ = alpha[num];
digits--; digits--;
} }while (digits > 0);
while (digits > 0);
return str; return str;
} }

@ -15,7 +15,7 @@
void dbgln(char* text, int len); void dbgln(char* text, int len);
/* alphabet for itoa */ /* alphabet for itoa */
char* itoa (int value, char* str, int base); char* itoa(int value, char* str, int base);
// if we don't have a textIO module for debugging // if we don't have a textIO module for debugging
#else #else
@ -24,9 +24,9 @@ char* itoa (int value, char* str, int base);
// if we don't have textio, dbgln becomes an empty macro to save on cycles // if we don't have textio, dbgln becomes an empty macro to save on cycles
#define dbgln(a,b) #define dbgln(a, b)
// itoa just evaluates to the passes pointer // itoa just evaluates to the passes pointer
#define itoa(a,b,c) b #define itoa(a, b, c) b
#endif #endif
#endif #endif

Loading…
Cancel
Save