1
1
/*
2
- Copyright (c) 2014 Arduino. All right reserved.
2
+ Copyright (c) 2014 Arduino LLC . All right reserved.
3
3
4
4
This library is free software; you can redistribute it and/or
5
5
modify it under the terms of the GNU Lesser General Public
20
20
#include <string.h>
21
21
22
22
#ifdef __cplusplus
23
- extern "C" {
24
- #endif // __cplusplus
23
+ extern "C" {
24
+ #endif
25
25
26
- #if 0
27
26
/* reverse: reverse string s in place */
27
+ /*
28
28
static void reverse( char s[] )
29
29
{
30
30
int i, j ;
@@ -37,22 +37,24 @@ static void reverse( char s[] )
37
37
s[j] = c ;
38
38
}
39
39
}
40
+ */
40
41
41
42
/* itoa: convert n to characters in s */
43
+ /*
42
44
extern void itoa( int n, char s[] )
43
45
{
44
46
int i, sign ;
45
47
46
- if ( (sign = n ) < 0 ) /* record sign */
48
+ if ( (sign = n) < 0 ) // record sign
47
49
{
48
- n = - n ; /* make n positive */
50
+ n = -n; // make n positive
49
51
}
50
52
51
53
i = 0;
52
54
do
53
- { /* generate digits in reverse order */
54
- s [i ++ ] = n % 10 + '0' ; /* get next digit */
55
- } while ((n /= 10 ) > 0 ) ; /* delete it */
55
+ { // generate digits in reverse order
56
+ s[i++] = n % 10 + '0'; // get next digit
57
+ } while ((n /= 10) > 0) ; // delete it
56
58
57
59
if (sign < 0 )
58
60
{
@@ -63,8 +65,7 @@ extern void itoa( int n, char s[] )
63
65
64
66
reverse( s ) ;
65
67
}
66
-
67
- #else
68
+ */
68
69
69
70
extern char * itoa ( int value , char * string , int radix )
70
71
{
@@ -163,8 +164,7 @@ extern char* ultoa( unsigned long value, char *string, int radix )
163
164
164
165
return string ;
165
166
}
166
- #endif /* 0 */
167
167
168
168
#ifdef __cplusplus
169
169
} // extern "C"
170
- #endif // __cplusplus
170
+ #endif
0 commit comments