Browse code

str2float removed -- not necessary anymore

Jan Janak authored on 27/04/2004 14:51:13
Showing 1 changed files
... ...
@@ -398,35 +398,4 @@ static inline int str2int(str* _s, unsigned int* _r)
398 398
 	return 0;
399 399
 }
400 400
 
401
-
402
-/*
403
- * Convert a str to float
404
- */
405
-static inline int str2float(str* _s, float* _r)
406
-{
407
-	int i, dot = 0;
408
-	float order = 0.1;
409
-
410
-	*_r = 0;
411
-	for(i = 0; i < _s->len; i++) {
412
-		if (_s->s[i] == '.') {
413
-			if (dot) return -1;
414
-			dot = 1;
415
-			continue;
416
-		}
417
-		if ((_s->s[i] >= '0') && (_s->s[i] <= '9')) {
418
-			if (dot) {
419
-				*_r += (_s->s[i] - '0') * order;
420
-				order /= 10;
421
-			} else {
422
-				*_r *= 10;
423
-				*_r += _s->s[i] - '0';
424
-			}
425
-		} else {
426
-			return -2;
427
-		}
428
-	}
429
-	return 0;
430
-}
431
-
432 401
 #endif