mtdev/mtdev-implicit.diff
2012-02-13 10:05:55 +00:00

46 lines
1.4 KiB
Diff

From: Jan Engelhardt <jengelh@medozas.de>
Date: 2012-02-12 19:46:35.478843702 +0100
build: resolve compiler warnings due to use of impl.-decl. fns
match_four.c: In function 'set_dist':
match_four.c:79:4: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
mtdev-kernel.c: In function 'main':
mtdev-kernel.c:130:2: warning: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
---
src/match_four.c | 1 +
test/mtdev-kernel.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
Index: mtdev-1.1.0/src/match_four.c
===================================================================
--- mtdev-1.1.0.orig/src/match_four.c
+++ mtdev-1.1.0/src/match_four.c
@@ -1,3 +1,4 @@
+#include <math.h>
#include "match.h"
#include <limits.h>
Index: mtdev-1.1.0/test/mtdev-kernel.c
===================================================================
--- mtdev-1.1.0.orig/test/mtdev-kernel.c
+++ mtdev-1.1.0/test/mtdev-kernel.c
@@ -26,6 +26,7 @@
*
****************************************************************************/
+#include <stdlib.h>
#include <../src/common.h>
#include <stdio.h>
#include <time.h>
@@ -127,7 +128,7 @@ int main(int argc, char *argv[])
return 1;
}
- eslot = atoi(argv[1]) + 1;
+ eslot = strtol(argv[1], NULL, 0) + 1;
if (eslot > SLOT_CNT) {
fprintf(stderr, "allowed slot range: 2 - %d\n", SLOT_MAX);
return 1;