TIL: nested functions are a gcc extension.

So un-nest them to be more standards compliant
(cherry picked from commit f105b357822bfcbae17cac517771e0414eea76fa)
This commit is contained in:
Stefan `Sec` Zehl 2011-05-18 17:51:03 +02:00
parent eadc01177e
commit d2b20e25bd
1 changed files with 12 additions and 9 deletions

View File

@ -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)