From: bernhardheld Date: Thu, 3 Apr 2003 09:28:48 +0000 (+0000) Subject: fix return values X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=5b28bf382c38c57d9614df68f6fb3f3b15e29bc1;p=fw%2Fsdcc fix return values git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2469 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index ff5b1ea7..006f8d90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-04-03 Bernhard Held + + * _decdptr.c: fix return values + * _gptrget.c: fix return values + * _gptrgetc.c: fix return values + * _gptrput.c: fix return values + * _mulint.c: fix return values + 2003-04-02 Bernhard Held * Makefile.common.in: unused PORT, SCC and SAS removed, fixed docdir diff --git a/device/lib/_decdptr.c b/device/lib/_decdptr.c index 00f9326b..30fe9a71 100644 --- a/device/lib/_decdptr.c +++ b/device/lib/_decdptr.c @@ -23,8 +23,12 @@ what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ -unsigned char _decdptr () +/* the return value is already in dph/dpl */ +void +_decdptr (char *gptr) { + gptr; /* hush the compiler */ + #ifdef SDCC_ds390 _asm orl dps, #0xc0 diff --git a/device/lib/_gptrget.c b/device/lib/_gptrget.c index ca8bc1bd..0fbdd39b 100644 --- a/device/lib/_gptrget.c +++ b/device/lib/_gptrget.c @@ -23,8 +23,14 @@ what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ -unsigned char _gptrget () + +/* the return value is expected to be in acc, and not in the standard + * location dpl. Therefore we choose return type void here: */ +void +_gptrget (char *gptr) { + gptr; /* hush the compiler */ + _asm ; save values passed xch a,r0 @@ -82,12 +88,16 @@ unsigned char _gptrget () pop acc xch a,r0 _endasm ; - } #ifdef SDCC_ds390 -unsigned int _gptrgetWord () +/* the return value is expected to be in acc/_ap, and not in the standard + * location dpl/dph. Therefore we choose return type void here: */ +void +_gptrgetWord (unsigned *gptr) { + gptr; /* hush the compiler */ + _asm ; ; depending on the pointer type acc. to SDCCsymt.h diff --git a/device/lib/_gptrgetc.c b/device/lib/_gptrgetc.c index 00506fb8..459562b9 100644 --- a/device/lib/_gptrgetc.c +++ b/device/lib/_gptrgetc.c @@ -23,8 +23,14 @@ what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ -unsigned char _gptrgetc () + +/* the return value is expected to be in acc, and not in the standard + * location dpl. Therefore we choose return type void here: */ +void +_gptrgetc (char *gptr) { + gptr; /* hush the compiler */ + _asm ; save values passed xch a,r0 diff --git a/device/lib/_gptrput.c b/device/lib/_gptrput.c index 51b5ffa8..3ae66a2d 100644 --- a/device/lib/_gptrput.c +++ b/device/lib/_gptrput.c @@ -23,8 +23,13 @@ what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ -unsigned char _gptrput () +/* the return value is expected to be in acc, and not in the standard + * location dpl. Therefore we choose return type void here: */ +void +_gptrput (char *gptr, char c) { + gptr; c; /* hush the compiler */ + _asm push acc ; @@ -74,7 +79,8 @@ _endasm; } #ifdef SDCC_ds390 -unsigned char _gptrputWord () +void +_gptrputWord () { _asm push acc diff --git a/device/lib/_mulint.c b/device/lib/_mulint.c index 8c2c5121..85121bc9 100644 --- a/device/lib/_mulint.c +++ b/device/lib/_mulint.c @@ -118,6 +118,8 @@ _mulsint (int a, int b) // obsolete #elif defined _MULINT_ASM_SMALL || defined _MULINT_ASM_SMALL_AUTO +/* the return value is (unsigned) int, but to hush the compiler + * we choose void here: */ void _mulint_dummy (void) _naked {