aboutsummaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2007-05-23 21:41:17 +0000
committerJeff Johnston <jjohnstn@redhat.com>2007-05-23 21:41:17 +0000
commit4a9880e071b7677b6fe3ac4cc079dd374ecb9c39 (patch)
treef795c8c4a2b47639b623ade7b4218e2252acc9f3 /newlib
parenta0050b64fc79c4bab523e7abf0739ab22a4d2a33 (diff)
downloadnewlib-4a9880e071b7677b6fe3ac4cc079dd374ecb9c39.zip
newlib-4a9880e071b7677b6fe3ac4cc079dd374ecb9c39.tar.gz
newlib-4a9880e071b7677b6fe3ac4cc079dd374ecb9c39.tar.bz2
2007-05-23 Patrick Mansfield <patmans@us.ibm.com>
* libc/machine/spu/sys/syscall.h: Update the __send_to_ppe prototype. * libc/machine/spu/fclose.c: Use the __send_to_ppe return value instead of the slot 0 value, remove any now unused variables, and for some cases, now store the result in an int vs int*. * libc/machine/spu/feof.c: Ditto. * libc/machine/spu/ferror.c: Ditto. * libc/machine/spu/fflush.c: Ditto. * libc/machine/spu/fgetc.c: Ditto. * libc/machine/spu/fgetpos.c: Ditto. * libc/machine/spu/fgets.c: Ditto. * libc/machine/spu/fileno.c: Ditto. * libc/machine/spu/fopen.c: Ditto. * libc/machine/spu/fprintf.c: Ditto. * libc/machine/spu/fputc.c: Ditto. * libc/machine/spu/fputs.c: Ditto. * libc/machine/spu/fread.c: Ditto. * libc/machine/spu/freopen.c: Ditto. * libc/machine/spu/fscanf.c: Ditto. * libc/machine/spu/fseek.c: Ditto. * libc/machine/spu/fsetpos.c: Ditto. * libc/machine/spu/ftell.c: Ditto. * libc/machine/spu/fwrite.c: Ditto. * libc/machine/spu/getc.c: Ditto. * libc/machine/spu/getchar.c: Ditto. * libc/machine/spu/gets.c: Ditto. * libc/machine/spu/printf.c: Ditto. * libc/machine/spu/putc.c: Ditto. * libc/machine/spu/putchar.c: Ditto. * libc/machine/spu/puts.c: Ditto. * libc/machine/spu/remove.c: Ditto. * libc/machine/spu/rename.c: Ditto. * libc/machine/spu/scanf.c: Ditto. * libc/machine/spu/setvbuf.c: Ditto. * libc/machine/spu/snprintf.c: Ditto. * libc/machine/spu/sprintf.c: Ditto. * libc/machine/spu/sscanf.c: Ditto. * libc/machine/spu/tmpfile.c: Ditto. * libc/machine/spu/tmpnam.c: Ditto. * libc/machine/spu/ungetc.c: Ditto. * libc/machine/spu/vfprintf.c: Ditto. * libc/machine/spu/vfscanf.c: Ditto. * libc/machine/spu/vprintf.c: Ditto. * libc/machine/spu/vscanf.c: Ditto. * libc/machine/spu/vsnprintf.c: Ditto. * libc/machine/spu/vsprintf.c: Ditto. * libc/machine/spu/vsscanf.c: Ditto.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog50
-rw-r--r--newlib/libc/machine/spu/fclose.c2
-rw-r--r--newlib/libc/machine/spu/feof.c5
-rw-r--r--newlib/libc/machine/spu/ferror.c5
-rw-r--r--newlib/libc/machine/spu/fflush.c5
-rw-r--r--newlib/libc/machine/spu/fgetc.c4
-rw-r--r--newlib/libc/machine/spu/fgetpos.c8
-rw-r--r--newlib/libc/machine/spu/fgets.c6
-rw-r--r--newlib/libc/machine/spu/fileno.c4
-rw-r--r--newlib/libc/machine/spu/fopen.c9
-rw-r--r--newlib/libc/machine/spu/fprintf.c8
-rw-r--r--newlib/libc/machine/spu/fputc.c6
-rw-r--r--newlib/libc/machine/spu/fputs.c6
-rw-r--r--newlib/libc/machine/spu/fread.c6
-rw-r--r--newlib/libc/machine/spu/freopen.c9
-rw-r--r--newlib/libc/machine/spu/fscanf.c8
-rw-r--r--newlib/libc/machine/spu/fseek.c6
-rw-r--r--newlib/libc/machine/spu/fsetpos.c6
-rw-r--r--newlib/libc/machine/spu/ftell.c4
-rw-r--r--newlib/libc/machine/spu/fwrite.c6
-rw-r--r--newlib/libc/machine/spu/getc.c4
-rw-r--r--newlib/libc/machine/spu/getchar.c4
-rw-r--r--newlib/libc/machine/spu/gets.c4
-rw-r--r--newlib/libc/machine/spu/printf.c8
-rw-r--r--newlib/libc/machine/spu/putc.c6
-rw-r--r--newlib/libc/machine/spu/putchar.c4
-rw-r--r--newlib/libc/machine/spu/puts.c4
-rw-r--r--newlib/libc/machine/spu/remove.c4
-rw-r--r--newlib/libc/machine/spu/rename.c6
-rw-r--r--newlib/libc/machine/spu/scanf.c8
-rw-r--r--newlib/libc/machine/spu/setvbuf.c6
-rw-r--r--newlib/libc/machine/spu/snprintf.c8
-rw-r--r--newlib/libc/machine/spu/sprintf.c8
-rw-r--r--newlib/libc/machine/spu/sscanf.c8
-rw-r--r--newlib/libc/machine/spu/sys/syscall.h2
-rw-r--r--newlib/libc/machine/spu/tmpfile.c2
-rw-r--r--newlib/libc/machine/spu/tmpnam.c5
-rw-r--r--newlib/libc/machine/spu/ungetc.c6
-rw-r--r--newlib/libc/machine/spu/vfprintf.c7
-rw-r--r--newlib/libc/machine/spu/vfscanf.c7
-rw-r--r--newlib/libc/machine/spu/vprintf.c7
-rw-r--r--newlib/libc/machine/spu/vscanf.c7
-rw-r--r--newlib/libc/machine/spu/vsnprintf.c7
-rw-r--r--newlib/libc/machine/spu/vsprintf.c7
-rw-r--r--newlib/libc/machine/spu/vsscanf.c7
45 files changed, 114 insertions, 195 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index a72b013..6fdba52 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,53 @@
+2007-05-23 Patrick Mansfield <patmans@us.ibm.com>
+
+ * libc/machine/spu/sys/syscall.h: Update the __send_to_ppe
+ prototype.
+ * libc/machine/spu/fclose.c: Use the __send_to_ppe return value
+ instead of the slot 0 value, remove any now unused variables, and
+ for some cases, now store the result in an int vs int*.
+ * libc/machine/spu/feof.c: Ditto.
+ * libc/machine/spu/ferror.c: Ditto.
+ * libc/machine/spu/fflush.c: Ditto.
+ * libc/machine/spu/fgetc.c: Ditto.
+ * libc/machine/spu/fgetpos.c: Ditto.
+ * libc/machine/spu/fgets.c: Ditto.
+ * libc/machine/spu/fileno.c: Ditto.
+ * libc/machine/spu/fopen.c: Ditto.
+ * libc/machine/spu/fprintf.c: Ditto.
+ * libc/machine/spu/fputc.c: Ditto.
+ * libc/machine/spu/fputs.c: Ditto.
+ * libc/machine/spu/fread.c: Ditto.
+ * libc/machine/spu/freopen.c: Ditto.
+ * libc/machine/spu/fscanf.c: Ditto.
+ * libc/machine/spu/fseek.c: Ditto.
+ * libc/machine/spu/fsetpos.c: Ditto.
+ * libc/machine/spu/ftell.c: Ditto.
+ * libc/machine/spu/fwrite.c: Ditto.
+ * libc/machine/spu/getc.c: Ditto.
+ * libc/machine/spu/getchar.c: Ditto.
+ * libc/machine/spu/gets.c: Ditto.
+ * libc/machine/spu/printf.c: Ditto.
+ * libc/machine/spu/putc.c: Ditto.
+ * libc/machine/spu/putchar.c: Ditto.
+ * libc/machine/spu/puts.c: Ditto.
+ * libc/machine/spu/remove.c: Ditto.
+ * libc/machine/spu/rename.c: Ditto.
+ * libc/machine/spu/scanf.c: Ditto.
+ * libc/machine/spu/setvbuf.c: Ditto.
+ * libc/machine/spu/snprintf.c: Ditto.
+ * libc/machine/spu/sprintf.c: Ditto.
+ * libc/machine/spu/sscanf.c: Ditto.
+ * libc/machine/spu/tmpfile.c: Ditto.
+ * libc/machine/spu/tmpnam.c: Ditto.
+ * libc/machine/spu/ungetc.c: Ditto.
+ * libc/machine/spu/vfprintf.c: Ditto.
+ * libc/machine/spu/vfscanf.c: Ditto.
+ * libc/machine/spu/vprintf.c: Ditto.
+ * libc/machine/spu/vscanf.c: Ditto.
+ * libc/machine/spu/vsnprintf.c: Ditto.
+ * libc/machine/spu/vsprintf.c: Ditto.
+ * libc/machine/spu/vsscanf.c: Ditto.
+
2007-05-23 Eric Blake <ebb9@byu.net>
* libc/stdio/vfscanf.c (__SVFSCANF_R): Support scanf(%1$s).
diff --git a/newlib/libc/machine/spu/fclose.c b/newlib/libc/machine/spu/fclose.c
index bbf4c60..4e1b825 100644
--- a/newlib/libc/machine/spu/fclose.c
+++ b/newlib/libc/machine/spu/fclose.c
@@ -46,7 +46,7 @@ _DEFUN (fclose, (fp),
ret = fp->_fp;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FCLOSE, &ret);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FCLOSE, &ret);
__sfp_free(fp);
diff --git a/newlib/libc/machine/spu/feof.c b/newlib/libc/machine/spu/feof.c
index 521dbe1..25e3a8f 100644
--- a/newlib/libc/machine/spu/feof.c
+++ b/newlib/libc/machine/spu/feof.c
@@ -46,9 +46,6 @@ _DEFUN (feof, (fp),
result = fp->_fp;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FEOF, &result);
-
-
- return result;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FEOF, &result);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/ferror.c b/newlib/libc/machine/spu/ferror.c
index b1a48f4..ac747ef 100644
--- a/newlib/libc/machine/spu/ferror.c
+++ b/newlib/libc/machine/spu/ferror.c
@@ -46,9 +46,6 @@ _DEFUN (ferror, (fp),
result = fp->_fp;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FERROR, &result);
-
-
- return result;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FERROR, &result);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fflush.c b/newlib/libc/machine/spu/fflush.c
index ea81e06..7037f49 100644
--- a/newlib/libc/machine/spu/fflush.c
+++ b/newlib/libc/machine/spu/fflush.c
@@ -45,9 +45,6 @@ _DEFUN (fflush, (fp),
result = fp->_fp;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FFLUSH, &result);
-
-
- return result;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FFLUSH, &result);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fgetc.c b/newlib/libc/machine/spu/fgetc.c
index 103b4ff..8152032 100644
--- a/newlib/libc/machine/spu/fgetc.c
+++ b/newlib/libc/machine/spu/fgetc.c
@@ -46,8 +46,6 @@ _DEFUN (fgetc, (fp),
result = fp->_fp;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FGETC, &result);
-
- return result;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FGETC, &result);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fgetpos.c b/newlib/libc/machine/spu/fgetpos.c
index 09c435a..aa7b6f0 100644
--- a/newlib/libc/machine/spu/fgetpos.c
+++ b/newlib/libc/machine/spu/fgetpos.c
@@ -49,18 +49,12 @@ _DEFUN (fgetpos, (fp, pos),
_fpos_t * pos)
{
c99_fgetpos_t arg;
- int* result;
CHECK_INIT(_REENT);
- result = (int*)&arg;
-
arg.fp = fp->_fp;
arg.pos = pos;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FGETPOS, &arg);
-
-
- return *result;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FGETPOS, &arg);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fgets.c b/newlib/libc/machine/spu/fgets.c
index da6fbaf..8167fd1 100644
--- a/newlib/libc/machine/spu/fgets.c
+++ b/newlib/libc/machine/spu/fgets.c
@@ -51,7 +51,6 @@ _DEFUN (fgets, (buf, n, fp),
int n _AND
FILE * fp)
{
- char** ret;
c99_fgets_t args;
CHECK_INIT(_REENT);
@@ -59,10 +58,7 @@ _DEFUN (fgets, (buf, n, fp),
args.buf = buf;
args.n = n;
args.fp = fp->_fp;
- ret = (char**) &args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FGETS, &args);
-
- return *ret;
+ return (char*) __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FGETS, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fileno.c b/newlib/libc/machine/spu/fileno.c
index 36809e4..867a6b8 100644
--- a/newlib/libc/machine/spu/fileno.c
+++ b/newlib/libc/machine/spu/fileno.c
@@ -47,8 +47,6 @@ _DEFUN (fileno, (fp),
ret = fp->_fp;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FILENO, &ret);
-
- return ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FILENO, &ret);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fopen.c b/newlib/libc/machine/spu/fopen.c
index 1a471ca..20b3667 100644
--- a/newlib/libc/machine/spu/fopen.c
+++ b/newlib/libc/machine/spu/fopen.c
@@ -49,7 +49,7 @@ _DEFUN (fopen, (file, mode),
_CONST char *file _AND
_CONST char *mode)
{
- int *ret;
+ int ret;
c99_fopen_t args;
FILE *fp;
struct _reent *ptr = _REENT;
@@ -63,12 +63,11 @@ _DEFUN (fopen, (file, mode),
args.file = file;
args.mode = mode;
- ret = (int *) &args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FOPEN, &args);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FOPEN, &args);
- if (*ret) {
- fp->_fp = *ret;
+ if (ret) {
+ fp->_fp = ret;
return fp;
}
else {
diff --git a/newlib/libc/machine/spu/fprintf.c b/newlib/libc/machine/spu/fprintf.c
index 0fe3083..08b4b1c 100644
--- a/newlib/libc/machine/spu/fprintf.c
+++ b/newlib/libc/machine/spu/fprintf.c
@@ -59,13 +59,11 @@ typedef struct
int
fprintf(FILE * fp, _CONST char *fmt,...)
{
- int* ret;
+ int ret;
c99_fprintf_t args;
CHECK_INIT(_REENT);
- ret = (int*) &args;
-
args.fp = fp->_fp;
args.fmt = (char*) fmt;
@@ -75,9 +73,9 @@ fprintf(FILE * fp, _CONST char *fmt,...)
va_start (args.ap);
#endif
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFPRINTF, &args);
+ ret =__send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFPRINTF, &args);
va_end (args.ap);
- return *ret;
+ return ret;
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fputc.c b/newlib/libc/machine/spu/fputc.c
index 9d890d0..bf25526 100644
--- a/newlib/libc/machine/spu/fputc.c
+++ b/newlib/libc/machine/spu/fputc.c
@@ -50,17 +50,13 @@ fputc (c, fp)
int c;
register FILE *fp;
{
- int* ret;
c99_fputc_t args;
CHECK_INIT(_REENT);
args.ch = c;
args.fp = fp->_fp;
- ret = (int*)&args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FPUTC, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FPUTC, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fputs.c b/newlib/libc/machine/spu/fputs.c
index d85e828..2b5d175 100644
--- a/newlib/libc/machine/spu/fputs.c
+++ b/newlib/libc/machine/spu/fputs.c
@@ -50,17 +50,13 @@ _DEFUN (fputs, (s, fp),
char _CONST * s _AND
FILE * fp)
{
- int* ret;
c99_fputs_t args;
CHECK_INIT(_REENT);
args.s = s;
args.fp = fp->_fp;
- ret = (int*)&args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FPUTS, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FPUTS, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fread.c b/newlib/libc/machine/spu/fread.c
index 840449d..f3c420f 100644
--- a/newlib/libc/machine/spu/fread.c
+++ b/newlib/libc/machine/spu/fread.c
@@ -55,7 +55,6 @@ _DEFUN (fread, (buf, size, count, fp),
size_t count _AND
FILE * fp)
{
- size_t* ret;
c99_fread_t args;
CHECK_INIT(_REENT);
@@ -64,10 +63,7 @@ _DEFUN (fread, (buf, size, count, fp),
args.size = size;
args.count = count;
args.fp = fp->_fp;
- ret = (size_t*) &args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FREAD, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FREAD, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/freopen.c b/newlib/libc/machine/spu/freopen.c
index 12839e8..9f19a68 100644
--- a/newlib/libc/machine/spu/freopen.c
+++ b/newlib/libc/machine/spu/freopen.c
@@ -52,7 +52,7 @@ _DEFUN (freopen, (file, mode, fp),
const char *mode _AND
FILE *fp)
{
- int *ret;
+ int ret;
c99_freopen_t args;
CHECK_INIT(_REENT);
@@ -60,12 +60,11 @@ _DEFUN (freopen, (file, mode, fp),
args.file = file;
args.mode = mode;
args.fp = fp->_fp;
- ret = (int *) &args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FREOPEN, &args);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FREOPEN, &args);
- if (*ret) {
- fp->_fp = *ret;
+ if (ret) {
+ fp->_fp = ret;
return fp;
}
else {
diff --git a/newlib/libc/machine/spu/fscanf.c b/newlib/libc/machine/spu/fscanf.c
index b97f413..b47d930 100644
--- a/newlib/libc/machine/spu/fscanf.c
+++ b/newlib/libc/machine/spu/fscanf.c
@@ -58,13 +58,11 @@ typedef struct
fscanf(FILE *fp, _CONST char *fmt, ...)
{
- int* ret;
+ int ret;
c99_vfscanf_t args;
CHECK_INIT(_REENT);
- ret = (int*) &args;
-
args.fp = fp->_fp;
args.fmt = (char*) fmt;
#ifdef _HAVE_STDC
@@ -74,9 +72,9 @@ fscanf(FILE *fp, _CONST char *fmt, ...)
#endif
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFSCANF, &args);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFSCANF, &args);
va_end (args.ap);
- return *ret;
+ return ret;
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fseek.c b/newlib/libc/machine/spu/fseek.c
index 50d2116..dc74533 100644
--- a/newlib/libc/machine/spu/fseek.c
+++ b/newlib/libc/machine/spu/fseek.c
@@ -52,7 +52,6 @@ _DEFUN (fseek, (fp, offset, whence),
long offset _AND
int whence)
{
- int* ret;
c99_fseek_t args;
CHECK_INIT(_REENT);
@@ -60,10 +59,7 @@ _DEFUN (fseek, (fp, offset, whence),
args.fp = fp->_fp;
args.offset = offset;
args.whence = whence;
- ret = (int*)&args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FSEEK, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FSEEK, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fsetpos.c b/newlib/libc/machine/spu/fsetpos.c
index 6bd4236..3bd0dde 100644
--- a/newlib/libc/machine/spu/fsetpos.c
+++ b/newlib/libc/machine/spu/fsetpos.c
@@ -49,17 +49,13 @@ _DEFUN (fsetpos, (iop, pos),
FILE * iop _AND
_CONST _fpos_t * pos)
{
- int* ret;
c99_fsetpos_t args;
CHECK_INIT(_REENT);
args.fp = iop->_fp;
args.pos = pos;
- ret = (int*)&args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FSETPOS, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FSETPOS, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/ftell.c b/newlib/libc/machine/spu/ftell.c
index 66df462..4782e5e 100644
--- a/newlib/libc/machine/spu/ftell.c
+++ b/newlib/libc/machine/spu/ftell.c
@@ -47,8 +47,6 @@ _DEFUN (ftell, (fp),
ret = fp->_fp;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FTELL, &ret);
-
- return ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FTELL, &ret);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/fwrite.c b/newlib/libc/machine/spu/fwrite.c
index 5cb45e0..3804165 100644
--- a/newlib/libc/machine/spu/fwrite.c
+++ b/newlib/libc/machine/spu/fwrite.c
@@ -55,7 +55,6 @@ _DEFUN (fwrite, (buf, size, count, fp),
size_t count _AND
FILE * fp)
{
- size_t* ret;
c99_fwrite_t args;
CHECK_INIT(_REENT);
@@ -64,10 +63,7 @@ _DEFUN (fwrite, (buf, size, count, fp),
args.size = size;
args.count = count;
args.fp = fp->_fp;
- ret = (size_t*) &args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FWRITE, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FWRITE, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/getc.c b/newlib/libc/machine/spu/getc.c
index 6787990..213bada 100644
--- a/newlib/libc/machine/spu/getc.c
+++ b/newlib/libc/machine/spu/getc.c
@@ -49,8 +49,6 @@ getc (fp)
ret = fp->_fp;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETC, &ret);
-
- return ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETC, &ret);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/getchar.c b/newlib/libc/machine/spu/getchar.c
index eb105e5..68247ef 100644
--- a/newlib/libc/machine/spu/getchar.c
+++ b/newlib/libc/machine/spu/getchar.c
@@ -45,8 +45,6 @@ getchar ()
CHECK_STD_INIT(_REENT);
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETCHAR, &ret);
-
- return ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETCHAR, &ret);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/gets.c b/newlib/libc/machine/spu/gets.c
index a46ab6a..2ac05db 100644
--- a/newlib/libc/machine/spu/gets.c
+++ b/newlib/libc/machine/spu/gets.c
@@ -44,8 +44,6 @@ gets (buf)
/* The return value gets written over buf
*/
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETS, &buf);
-
- return buf;
+ return (char*) __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETS, &buf);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/printf.c b/newlib/libc/machine/spu/printf.c
index c5a2924..bf3658b 100644
--- a/newlib/libc/machine/spu/printf.c
+++ b/newlib/libc/machine/spu/printf.c
@@ -35,13 +35,11 @@ printf (fmt, va_alist)
va_dcl
#endif
{
- int* ret;
+ int ret;
c99_printf_t args;
CHECK_STD_INIT(_REENT);
- ret = (int*) &args;
-
args.fmt = fmt;
#ifdef _HAVE_STDC
va_start (args.ap, fmt);
@@ -49,10 +47,10 @@ printf (fmt, va_alist)
va_start (args.ap);
#endif
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VPRINTF, &args);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VPRINTF, &args);
va_end (args.ap);
- return *ret;
+ return ret;
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/putc.c b/newlib/libc/machine/spu/putc.c
index 239bf2f..dc478d3 100644
--- a/newlib/libc/machine/spu/putc.c
+++ b/newlib/libc/machine/spu/putc.c
@@ -50,18 +50,14 @@ putc (c, fp)
int c;
register FILE *fp;
{
- int* ret;
c99_putc_t args;
CHECK_INIT(_REENT);
args.ch = c;
args.fp = fp->_fp;
- ret = (int*)&args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTC, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTC, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/putchar.c b/newlib/libc/machine/spu/putchar.c
index 5cf9ed4..67eb599 100644
--- a/newlib/libc/machine/spu/putchar.c
+++ b/newlib/libc/machine/spu/putchar.c
@@ -14,9 +14,7 @@ putchar (c)
/* c gets overwritten before return */
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTCHAR, &c);
-
- return c;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTCHAR, &c);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/puts.c b/newlib/libc/machine/spu/puts.c
index b5ed3d2..06f4b87 100644
--- a/newlib/libc/machine/spu/puts.c
+++ b/newlib/libc/machine/spu/puts.c
@@ -12,9 +12,7 @@ _DEFUN (puts, (s),
/* The return value gets written over s
*/
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTS, &s);
-
- return (int)s;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTS, &s);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/remove.c b/newlib/libc/machine/spu/remove.c
index 56b0886..930a980 100644
--- a/newlib/libc/machine/spu/remove.c
+++ b/newlib/libc/machine/spu/remove.c
@@ -41,8 +41,6 @@ remove (filename)
/* The return value gets written over buf
*/
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_REMOVE, &filename);
-
- return (int)filename;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_REMOVE, &filename);
}
diff --git a/newlib/libc/machine/spu/rename.c b/newlib/libc/machine/spu/rename.c
index 0117c56..bf58fbd 100644
--- a/newlib/libc/machine/spu/rename.c
+++ b/newlib/libc/machine/spu/rename.c
@@ -48,13 +48,9 @@ rename (old, new)
_CONST char *old;
_CONST char *new;
{
- int *ret;
c99_rename_t args;
args.old = old;
args.new = new;
- ret = (int*) &args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_RENAME, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_RENAME, &args);
}
diff --git a/newlib/libc/machine/spu/scanf.c b/newlib/libc/machine/spu/scanf.c
index 76c47ff..29157a3 100644
--- a/newlib/libc/machine/spu/scanf.c
+++ b/newlib/libc/machine/spu/scanf.c
@@ -56,13 +56,11 @@ typedef struct
scanf(_CONST char *fmt, ...)
{
- int* ret;
+ int ret;
c99_vscanf_t args;
CHECK_STD_INIT(_REENT);
- ret = (int*) &args;
-
args.fmt = (char*) fmt;
#ifdef _HAVE_STDC
va_start (args.ap, fmt);
@@ -71,10 +69,10 @@ scanf(_CONST char *fmt, ...)
#endif
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSCANF, &args);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSCANF, &args);
va_end (args.ap);
- return *ret;
+ return ret;
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/setvbuf.c b/newlib/libc/machine/spu/setvbuf.c
index b41b4b7..32da292 100644
--- a/newlib/libc/machine/spu/setvbuf.c
+++ b/newlib/libc/machine/spu/setvbuf.c
@@ -56,7 +56,6 @@ _DEFUN (setvbuf, (fp, buf, mode, size),
int mode _AND
size_t size)
{
- int* ret;
c99_setvbuf_t args;
CHECK_INIT(_REENT);
@@ -65,11 +64,8 @@ _DEFUN (setvbuf, (fp, buf, mode, size),
args.buf = buf;
args.mode = mode;
args.size = size;
- ret = (int*)&args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_SETVBUF, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_SETVBUF, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/snprintf.c b/newlib/libc/machine/spu/snprintf.c
index d48dc60..98d7f57 100644
--- a/newlib/libc/machine/spu/snprintf.c
+++ b/newlib/libc/machine/spu/snprintf.c
@@ -63,13 +63,11 @@ _DEFUN(snprintf, (str, size, fmt),
size_t size _AND
_CONST char *fmt _DOTS)
{
- int* ret;
+ int ret;
c99_snprintf_t args;
CHECK_STR_INIT(_REENT);
- ret = (int*) &args;
-
args.str = str;
args.size = size;
args.fmt = fmt;
@@ -79,10 +77,10 @@ _DEFUN(snprintf, (str, size, fmt),
va_start (args.ap);
#endif
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSNPRINTF, &args);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSNPRINTF, &args);
va_end (args.ap);
- return *ret;
+ return ret;
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/sprintf.c b/newlib/libc/machine/spu/sprintf.c
index 37a319e..b4f7dad 100644
--- a/newlib/libc/machine/spu/sprintf.c
+++ b/newlib/libc/machine/spu/sprintf.c
@@ -60,13 +60,11 @@ _DEFUN(sprintf, (str, fmt),
char *str _AND
_CONST char *fmt _DOTS)
{
- int* ret;
+ int ret;
c99_sprintf_t args;
CHECK_STR_INIT(_REENT);
- ret = (int*) &args;
-
args.str = str;
args.fmt = fmt;
#ifdef _HAVE_STDC
@@ -75,10 +73,10 @@ _DEFUN(sprintf, (str, fmt),
va_start (args.ap);
#endif
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSPRINTF, &args);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSPRINTF, &args);
va_end (args.ap);
- return *ret;
+ return ret;
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/sscanf.c b/newlib/libc/machine/spu/sscanf.c
index 3697c17..669c6e5 100644
--- a/newlib/libc/machine/spu/sscanf.c
+++ b/newlib/libc/machine/spu/sscanf.c
@@ -61,13 +61,11 @@ _DEFUN(sscanf, (str, fmt),
_CONST char *str _AND
_CONST char *fmt _DOTS)
{
- int* ret;
+ int ret;
c99_sscanf_t args;
CHECK_STR_INIT(_REENT);
- ret = (int*) &args;
-
args.str = str;
args.fmt = fmt;
#ifdef _HAVE_STDC
@@ -76,10 +74,10 @@ _DEFUN(sscanf, (str, fmt),
va_start (args.ap);
#endif
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSSCANF, &args);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSSCANF, &args);
va_end (args.ap);
- return *ret;
+ return ret;
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/sys/syscall.h b/newlib/libc/machine/spu/sys/syscall.h
index ca44b7d..3a358a6 100644
--- a/newlib/libc/machine/spu/sys/syscall.h
+++ b/newlib/libc/machine/spu/sys/syscall.h
@@ -1,4 +1,4 @@
#ifndef _SYS_SYSCALL_H
#define _SYS_SYSCALL_H
-void __send_to_ppe(unsigned int signalcode, unsigned int opcode, void *data);
+int __send_to_ppe(unsigned int signalcode, unsigned int opcode, void *data);
#endif
diff --git a/newlib/libc/machine/spu/tmpfile.c b/newlib/libc/machine/spu/tmpfile.c
index 662b8f6..c66f783 100644
--- a/newlib/libc/machine/spu/tmpfile.c
+++ b/newlib/libc/machine/spu/tmpfile.c
@@ -50,7 +50,7 @@ _DEFUN_VOID (tmpfile)
return NULL;
}
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_TMPFILE, &ret);
+ ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_TMPFILE, &ret);
if (ret) {
fp->_fp = ret;
diff --git a/newlib/libc/machine/spu/tmpnam.c b/newlib/libc/machine/spu/tmpnam.c
index d0fe39b..5cbf279 100644
--- a/newlib/libc/machine/spu/tmpnam.c
+++ b/newlib/libc/machine/spu/tmpnam.c
@@ -38,10 +38,7 @@ char *
_DEFUN (tmpnam, (s),
char *s)
{
- char **ret = &s;
/* The return value gets written over buf
*/
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_TMPNAM, &s);
-
- return *ret;
+ return (char*) __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_TMPNAM, &s);
}
diff --git a/newlib/libc/machine/spu/ungetc.c b/newlib/libc/machine/spu/ungetc.c
index 29736b3..631e71d 100644
--- a/newlib/libc/machine/spu/ungetc.c
+++ b/newlib/libc/machine/spu/ungetc.c
@@ -50,18 +50,14 @@ ungetc (c, fp)
int c;
register FILE *fp;
{
- int* ret;
c99_ungetc_t args;
CHECK_INIT(_REENT);
args.c = c;
args.fp = fp->_fp;
- ret = (int*)&args;
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_UNGETC, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_UNGETC, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/vfprintf.c b/newlib/libc/machine/spu/vfprintf.c
index a9f8bfc..f46c802 100644
--- a/newlib/libc/machine/spu/vfprintf.c
+++ b/newlib/libc/machine/spu/vfprintf.c
@@ -62,20 +62,15 @@ _DEFUN (vfprintf, (fp, fmt0, ap),
_CONST char *fmt0 _AND
va_list ap)
{
- int* ret;
c99_vfprintf_t args;
CHECK_INIT(_REENT);
- ret = (int*) &args;
-
args.fp = fp->_fp;
args.fmt = (char*) fmt0;
va_copy(args.ap,ap);
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFPRINTF, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFPRINTF, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/vfscanf.c b/newlib/libc/machine/spu/vfscanf.c
index 6849cf5..4de496b 100644
--- a/newlib/libc/machine/spu/vfscanf.c
+++ b/newlib/libc/machine/spu/vfscanf.c
@@ -62,20 +62,15 @@ _DEFUN (vfscanf, (fp, fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- int* ret;
c99_vfscanf_t args;
CHECK_INIT(_REENT);
- ret = (int*) &args;
-
args.fp = fp->_fp;
args.fmt = (char*) fmt;
va_copy(args.ap,ap);
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFSCANF, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFSCANF, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/vprintf.c b/newlib/libc/machine/spu/vprintf.c
index eca0158..32b86d8 100644
--- a/newlib/libc/machine/spu/vprintf.c
+++ b/newlib/libc/machine/spu/vprintf.c
@@ -27,19 +27,14 @@ _DEFUN (vprintf, (fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- int* ret;
c99_vprintf_t args;
CHECK_STD_INIT(_REENT);
- ret = (int*) &args;
-
args.fmt = fmt;
va_copy(args.ap,ap);
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VPRINTF, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VPRINTF, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/vscanf.c b/newlib/libc/machine/spu/vscanf.c
index 8571e5c..4f68bfe 100644
--- a/newlib/libc/machine/spu/vscanf.c
+++ b/newlib/libc/machine/spu/vscanf.c
@@ -59,19 +59,14 @@ _DEFUN (vscanf, (fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- int* ret;
c99_vscanf_t args;
CHECK_STD_INIT(_REENT);
- ret = (int*) &args;
-
args.fmt = (char*) fmt;
va_copy(args.ap,ap);
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSCANF, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSCANF, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/vsnprintf.c b/newlib/libc/machine/spu/vsnprintf.c
index 09d4292..575cf82 100644
--- a/newlib/libc/machine/spu/vsnprintf.c
+++ b/newlib/libc/machine/spu/vsnprintf.c
@@ -33,21 +33,16 @@ _DEFUN (vsnprintf, (str, size, fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- int* ret;
c99_vsnprintf_t args;
CHECK_STR_INIT(_REENT);
- ret = (int*) &args;
-
args.str = str;
args.size = size;
args.fmt = fmt;
va_copy(args.ap,ap);
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSNPRINTF, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSNPRINTF, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/vsprintf.c b/newlib/libc/machine/spu/vsprintf.c
index b36a1a0..f69b940 100644
--- a/newlib/libc/machine/spu/vsprintf.c
+++ b/newlib/libc/machine/spu/vsprintf.c
@@ -31,20 +31,15 @@ _DEFUN (vsprintf, (str, fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- int* ret;
c99_vsprintf_t args;
CHECK_STR_INIT(_REENT);
- ret = (int*) &args;
-
args.str = str;
args.fmt = (char*) fmt;
va_copy(args.ap,ap);
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSPRINTF, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSPRINTF, &args);
}
#endif /* ! _REENT_ONLY */
diff --git a/newlib/libc/machine/spu/vsscanf.c b/newlib/libc/machine/spu/vsscanf.c
index cd8e1eb..bd76cfc 100644
--- a/newlib/libc/machine/spu/vsscanf.c
+++ b/newlib/libc/machine/spu/vsscanf.c
@@ -62,20 +62,15 @@ _DEFUN (vsscanf, (str, fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- int* ret;
c99_vsscanf_t args;
CHECK_STR_INIT(_REENT);
- ret = (int*) &args;
-
args.str = str;
args.fmt = (char*) fmt;
va_copy(args.ap,ap);
- __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSSCANF, &args);
-
- return *ret;
+ return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSSCANF, &args);
}
#endif /* ! _REENT_ONLY */