From d2b20e25bd1208cfcf6add9930ed2e0a6458fa86 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Wed, 18 May 2011 17:51:03 +0200 Subject: [PATCH] TIL: nested functions are a gcc extension. So un-nest them to be more standards compliant (cherry picked from commit f105b357822bfcbae17cac517771e0414eea76fa) --- lcd/decoder.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lcd/decoder.c b/lcd/decoder.c index 012c97e..65d0484 100644 --- a/lcd/decoder.c +++ b/lcd/decoder.c @@ -4,18 +4,10 @@ #define MAXCHR (24*3) static uint8_t buf[MAXCHR]; -uint8_t * pk_decode(const uint8_t * data,int * len){ - int length=*len; // Length of character bytestream - int height; // Height of character in bytes - int hoff; // bit position for non-integer heights - uint8_t * bufptr=buf; // Output buffer for decoded character - - height=(font->u8Height-1)/8+1; - hoff=font->u8Height%8; - // Local function: Get next nibble. int ctr=0; // offset for next nibble int hilo=0; // 0= high nibble next, 1=low nibble next + const uint8_t * data; char gnn(){ // Get next nibble static int byte; int val; @@ -44,6 +36,17 @@ uint8_t * pk_decode(const uint8_t * data,int * len){ return retval; }; + +uint8_t * pk_decode(const uint8_t * ldata,int * len){ + data=ldata; + int length=*len; // Length of character bytestream + int height; // Height of character in bytes + int hoff; // bit position for non-integer heights + uint8_t * bufptr=buf; // Output buffer for decoded character + + height=(font->u8Height-1)/8+1; + hoff=font->u8Height%8; + #define DYN (12) // Decoder parameter: Fixed value for now. int repeat=0; // Decoder internal: repeat colum? int curbit=0; // Decoder internal: current bit (1 or 0)