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:
parent
eadc01177e
commit
d2b20e25bd
|
@ -4,18 +4,10 @@
|
||||||
#define MAXCHR (24*3)
|
#define MAXCHR (24*3)
|
||||||
static uint8_t buf[MAXCHR];
|
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.
|
// Local function: Get next nibble.
|
||||||
int ctr=0; // offset for next nibble
|
int ctr=0; // offset for next nibble
|
||||||
int hilo=0; // 0= high nibble next, 1=low nibble next
|
int hilo=0; // 0= high nibble next, 1=low nibble next
|
||||||
|
const uint8_t * data;
|
||||||
char gnn(){ // Get next nibble
|
char gnn(){ // Get next nibble
|
||||||
static int byte;
|
static int byte;
|
||||||
int val;
|
int val;
|
||||||
|
@ -44,6 +36,17 @@ uint8_t * pk_decode(const uint8_t * data,int * len){
|
||||||
return retval;
|
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.
|
#define DYN (12) // Decoder parameter: Fixed value for now.
|
||||||
int repeat=0; // Decoder internal: repeat colum?
|
int repeat=0; // Decoder internal: repeat colum?
|
||||||
int curbit=0; // Decoder internal: current bit (1 or 0)
|
int curbit=0; // Decoder internal: current bit (1 or 0)
|
||||||
|
|
Loading…
Reference in New Issue