diff options
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -132,12 +132,11 @@ vsprintf_alloc(const char *f, va_list args) char * makeUTF16(const char *string) { - int i; int n = strlen(string); char *value = malloc(2 * n); if(!value) return NULL; - for(i = 0; i < n; i++) { + for(int i = 0; i < n; i++) { value[2 * i] = '\0'; value[2 * i + 1] = string[i]; } @@ -445,7 +444,6 @@ degreesToFraction(int deg, int *num, int *den) { double n, d; double rad, val; - int i; if(deg <= -(60 * TWO_SIXTEENTH) || deg >= (60 * TWO_SIXTEENTH)) goto fail; @@ -460,7 +458,7 @@ degreesToFraction(int deg, int *num, int *den) val = atan2(n, d); /* There must be a cleaner way */ - for(i = 1; i < 10000; i++) { + for(int i = 1; i < 10000; i++) { if((int)(d * i) != 0.0 && fabs(atan2(ROUND(n * i), ROUND(d * i)) - val) < 0.05) { *num = (int)ROUND(n * i); |