]> git.tdb.fi Git - gldbg.git/commitdiff
Make tmpalloc global variables static
authorMikko Rasa <tdb@tdb.fi>
Thu, 18 Nov 2010 13:40:50 +0000 (13:40 +0000)
committerMikko Rasa <tdb@tdb.fi>
Thu, 18 Nov 2010 13:40:50 +0000 (13:40 +0000)
Functions don't need to be declared extern
Report how many bytes were left if a decode error occurs
Remove an obsoleve method from gldbg.h

source/gldbg.h
source/gldump.c
source/tmpalloc.c
source/tmpalloc.h

index d8b56f825e2c92b0135f16e4bfd2b3db0f67fca7..e53998251e3821bef667526e5346de0717741a22 100644 (file)
@@ -44,7 +44,6 @@ private:
        void tick();
        void check_child();
        void read_stream();
        void tick();
        void check_child();
        void read_stream();
-       long ptrace(int, void *, void *);
        virtual void sighandler(int);
 };
 
        virtual void sighandler(int);
 };
 
index 79896c2fa4bad9c902726e949d03015b899160ae..c7dbf5e69283b59c32f622421bbaf700377559e7 100644 (file)
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
                ret = gldecoder_decode(dec, ptr, end-ptr);
                if(ret<0)
                {
                ret = gldecoder_decode(dec, ptr, end-ptr);
                if(ret<0)
                {
-                       fprintf(stderr, "Decode error\n");
+                       fprintf(stderr, "Decode error with %d bytes left\n", end-ptr);
                        break;
                }
                ptr += ret;
                        break;
                }
                ptr += ret;
index 56d955e5a3dd73966b1ed1d13927ce3652e34737..26b6d08f87148bf0301579f587b28d4ca9adae0b 100644 (file)
@@ -8,9 +8,9 @@ Distributed under the GPL
 #include <stdlib.h>
 #include "tmpalloc.h"
 
 #include <stdlib.h>
 #include "tmpalloc.h"
 
-void *buffer = 0;
-unsigned buf_size = 8192;
-unsigned offset = 0;
+static void *buffer = 0;
+static unsigned buf_size = 8192;
+static unsigned offset = 0;
 
 void *tmpalloc(unsigned size)
 {
 
 void *tmpalloc(unsigned size)
 {
index dc673ca3e817c9bc16a5516e476075153a596feb..0ca29a5c9783929232a8fa2ae93eec16a3787d2c 100644 (file)
@@ -12,12 +12,12 @@ Distributed under the GPL
 Allocates a temporary memory region.  The returned memory comes from a shared
 pool and will get reused eventually.
 */
 Allocates a temporary memory region.  The returned memory comes from a shared
 pool and will get reused eventually.
 */
-extern void *tmpalloc(unsigned);
+void *tmpalloc(unsigned);
 
 /**
 Frees the shared pool used by tmpalloc.  It will be recreated if tmpalloc is
 called again.
 */
 
 /**
 Frees the shared pool used by tmpalloc.  It will be recreated if tmpalloc is
 called again.
 */
-extern void tmpfree();
+void tmpfree();
 
 #endif
 
 #endif