summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-09-20 08:55:45 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-09-20 08:55:45 +0000
commit5a98ad2d7fd9980b6adc0f6383f1dc19560858dc (patch)
tree479160253c65a109f04e15997b35c6320c107b37
parentcc6ef19dd97a5dbbd901f9dbede5f65ef60c4a6f (diff)
downloadrockbox-5a98ad2d7fd9980b6adc0f6383f1dc19560858dc.tar.gz
rockbox-5a98ad2d7fd9980b6adc0f6383f1dc19560858dc.tar.bz2
rockbox-5a98ad2d7fd9980b6adc0f6383f1dc19560858dc.zip
format() (and its alias vuprintf) return values are uncheck -> void
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28119 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/common/format.c10
-rw-r--r--firmware/include/format.h4
-rw-r--r--firmware/libc/sprintf.c6
3 files changed, 8 insertions, 12 deletions
diff --git a/firmware/common/format.c b/firmware/common/format.c
index 240dd1ebd5..afe1010cfb 100644
--- a/firmware/common/format.c
+++ b/firmware/common/format.c
@@ -29,7 +29,7 @@
static const char hexdigit[] = "0123456789ABCDEF";
-int format(
+void format(
/* call 'push()' for each output letter */
int (*push)(void *userp, unsigned char data),
void *userp,
@@ -220,7 +220,6 @@ int format(
else
ok=push(userp, ch);
}
- return ok; /* true means good */
}
struct for_fprintf {
@@ -244,7 +243,6 @@ static int fprfunc(void *pr, unsigned char letter)
int fdprintf(int fd, const char *fmt, ...)
{
- bool ok;
va_list ap;
struct for_fprintf fpr;
@@ -252,13 +250,13 @@ int fdprintf(int fd, const char *fmt, ...)
fpr.bytes=0;
va_start(ap, fmt);
- ok = format(fprfunc, &fpr, fmt, ap);
+ format(fprfunc, &fpr, fmt, ap);
va_end(ap);
return fpr.bytes; /* return 0 on error */
}
-int vuprintf(int (*push)(void *userp, unsigned char data), void *userp, const char *fmt, va_list ap)
+void vuprintf(int (*push)(void *userp, unsigned char data), void *userp, const char *fmt, va_list ap)
{
- return format(push, userp, fmt, ap);
+ format(push, userp, fmt, ap);
}
diff --git a/firmware/include/format.h b/firmware/include/format.h
index 6a00574644..30a072aca8 100644
--- a/firmware/include/format.h
+++ b/firmware/include/format.h
@@ -22,7 +22,7 @@
#ifndef __FORMAT_H__
#define __FORMAT_H__
-int format(
+void format(
/* call 'push()' for each output letter */
int (*push)(void *userp, unsigned char data),
void *userp,
@@ -31,7 +31,7 @@ int format(
/* callback function is called for every output character (byte) with userp and
* should return 0 when ch is a char other than '\0' that should stop printing */
-int vuprintf(int (*push)(void *userp, unsigned char data),
+void vuprintf(int (*push)(void *userp, unsigned char data),
void *userp, const char *fmt, va_list ap);
#endif /* __FORMAT_H__ */
diff --git a/firmware/libc/sprintf.c b/firmware/libc/sprintf.c
index b02f5a2fae..18e2ce6fd2 100644
--- a/firmware/libc/sprintf.c
+++ b/firmware/libc/sprintf.c
@@ -57,7 +57,6 @@ static int sprfunc(void *ptr, unsigned char letter)
int snprintf(char *buf, size_t size, const char *fmt, ...)
{
- bool ok;
va_list ap;
struct for_snprintf pr;
@@ -66,7 +65,7 @@ int snprintf(char *buf, size_t size, const char *fmt, ...)
pr.max = size;
va_start(ap, fmt);
- ok = format(sprfunc, &pr, fmt, ap);
+ format(sprfunc, &pr, fmt, ap);
va_end(ap);
/* make sure it ends with a trailing zero */
@@ -77,14 +76,13 @@ int snprintf(char *buf, size_t size, const char *fmt, ...)
int vsnprintf(char *buf, size_t size, const char *fmt, va_list ap)
{
- bool ok;
struct for_snprintf pr;
pr.ptr = (unsigned char *)buf;
pr.bytes = 0;
pr.max = size;
- ok = format(sprfunc, &pr, fmt, ap);
+ format(sprfunc, &pr, fmt, ap);
/* make sure it ends with a trailing zero */
pr.ptr[(pr.bytes < pr.max) ? 0 : -1] = '\0';