fix return values
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 3 Apr 2003 09:28:48 +0000 (09:28 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 3 Apr 2003 09:28:48 +0000 (09:28 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2469 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/lib/_decdptr.c
device/lib/_gptrget.c
device/lib/_gptrgetc.c
device/lib/_gptrput.c
device/lib/_mulint.c

index ff5b1ea7cdf783d0f33acc6c8c76f7a3d871ae8a..006f8d90676cd37bfaf30247046951231cdccbbd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-04-03  Bernhard Held <bernhard@bernhardheld.de>
+
+       * _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 <bernhard@bernhardheld.de>
 
        * Makefile.common.in: unused PORT, SCC and SAS removed, fixed docdir
index 00f9326b1850b72cda0bb0cba930abdb5de72f64..30fe9a71dadc6bf4de8ac20a17cff7a26967fb62 100644 (file)
    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
index ca8bc1bdb81758b1ce042c71de8ad56a1e412ed7..0fbdd39ba6dd8ff7aeb2e752e3472bbe97d66c8e 100644 (file)
    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
index 00506fb86980c5f665c889314b223074267a816a..459562b972336225e6686a5e6384ce933745acb6 100644 (file)
    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
index 51b5ffa8f2951ea20452c8475815abfff9b335a6..3ae66a2d76bc1fd483831cf024d1a45111ce78ad 100644 (file)
    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
index 8c2c5121d9a8fb8a0afabd6e7026a00976bc0432..85121bc9e108887efe3f92c8c02d9814f1a9f97c 100644 (file)
@@ -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
 {