Mercurial > public > ostc4
comparison FontPack/base_upperRegion.c @ 699:01f40cb1057e
Cleanup warnings:
The code still contained several warnings which have now been resolved. Big thank you to Thomas :-)
author | Ideenmodellierer |
---|---|
date | Tue, 18 Oct 2022 20:56:19 +0200 |
parents | 0172431fbad9 |
children |
comparison
equal
deleted
inserted
replaced
698:2c2b9c6eb089 | 699:01f40cb1057e |
---|---|
113 #define ASSERT(e) \ | 113 #define ASSERT(e) \ |
114 do { if( ! (e) ) { ++errors; printf("FAIL at %3d: %s \n", __LINE__, #e); errorflag = 1;} } while(0) | 114 do { if( ! (e) ) { ++errors; printf("FAIL at %3d: %s \n", __LINE__, #e); errorflag = 1;} } while(0) |
115 | 115 |
116 #define ASSERT_RANGE(e, min, max) ASSERT(min <= e); ASSERT( e <= max) | 116 #define ASSERT_RANGE(e, min, max) ASSERT(min <= e); ASSERT( e <= max) |
117 | 117 |
118 #if DEBUG_STLINK_V2 | |
118 extern void initialise_monitor_handles(void); | 119 extern void initialise_monitor_handles(void); |
120 #endif | |
119 | 121 |
120 static int errors = 0; | 122 static int errors = 0; |
121 static uint8_t errorflag = 0; | 123 static uint8_t errorflag = 0; |
122 | 124 |
123 int main(void) | 125 int main(void) |
147 | 149 |
148 ASSERT_RANGE(&ImgOSTC, (tImage*)&__upper_font_data, (tImage*)&__upper_font_data_end); | 150 ASSERT_RANGE(&ImgOSTC, (tImage*)&__upper_font_data, (tImage*)&__upper_font_data_end); |
149 | 151 |
150 for(const tFont* font = & __font_directory; font < &__font_directory_end; ++font) | 152 for(const tFont* font = & __font_directory; font < &__font_directory_end; ++font) |
151 { | 153 { |
152 printf("Font: %x\n",font); | 154 printf("Font: %x\n",(unsigned int)font); |
153 // Check END-OF-DIRECTORY magic marker | 155 // Check END-OF-DIRECTORY magic marker |
154 if( font->length == (uint32_t)-1 ) | 156 if( font->length == (uint32_t)-1 ) |
155 { | 157 { |
156 ASSERT( font == &FontT144 + 1 ); | 158 ASSERT( font == &FontT144 + 1 ); |
157 break; | 159 break; |
181 ASSERT_RANGE(image->width, font->spacesize, font->spacesize2Monospaced); | 183 ASSERT_RANGE(image->width, font->spacesize, font->spacesize2Monospaced); |
182 #endif | 184 #endif |
183 ASSERT(image->height == font->height); | 185 ASSERT(image->height == font->height); |
184 if(errorflag) | 186 if(errorflag) |
185 { | 187 { |
186 printf("image %x: h=%d fonth=%d\n",image,image->height,font->height); | 188 printf("image %x: h=%d fonth=%d\n",(unsigned int)image,image->height,font->height); |
187 errorflag = 0; | 189 errorflag = 0; |
188 } | 190 } |
189 // Uncompress image bytes | 191 // Uncompress image bytes |
190 const uint8_t* byte = image->data; | 192 const uint8_t* byte = image->data; |
191 ASSERT_RANGE(byte, (uint8_t*)&__upper_font_data, (uint8_t*)&__upper_font_data_end); | 193 ASSERT_RANGE(byte, (uint8_t*)&__upper_font_data, (uint8_t*)&__upper_font_data_end); |