narrowing error - where can I configure [-Wnarrowing] #634
Unanswered
wmjenkinson
asked this question in
Q&A
Replies: 1 comment
-
|
Unfortunately from this description I cannot see, what is causing the error(s). You can specify additional compiler options in your Makefile before the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
ERROR FIXED - NEW ERROR - structured binding declaration.
I have the following array:
uint16_t pat8[] = { 32,32,16, // width,height,bits 0x1840,0x38c0,0x4100,0x4940,0x4940,0x5161,0x4961,0x2060,0x1860,0x4960,0x4940,0x4940,0x4940,0x4920,0x4940,0x4941, 0x2060,0x4100,0x4920,0x4940,0x4940,0x4940,0x4120,0x1840,0x4960,0x59a1,0x5161,0x4940,0x4940,0x4100,0x4120,0x38e0, 0x5181,0x1020,0x38e0,0x4960,0x5181,0x4961,0x2060,0x4120,0x4120,0x1860,0x5160,0x4940,0x4940,0x4940,0x4920,0x4940, 0x5161,0x2060,0x4100,0x4940,0x4940,0x4940,0x2080,0x4940,0x2080,0x5181,0x59a1,0x5181,0x4960,0x4940,0x4100,0x38e0,And I get the error:
pat2.h:14:14: error: structured binding declaration cannot have type 'uint16_t' {aka 'short unsigned int'} 14 | uint16_t pat2[] = { | ^~ pat2.h:14:14: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' pat2.h:14:14: error: empty structured binding declarationThen I have:
if(bgMode==0) backgroundPattern(t, pat2);Gives the error:
gfx3d.h:470:44: error: expected primary-expression before ')' token
470 | if(bgMode==0) backgroundPattern(t, pat2);
Called Function:
void backgroundPattern(int32_t i, uint16_t *pat) { int32_t x,y,xp,yp; xp = 25*fastSin(4*i)/256+50; // 256 not MAXSIN=255 to avoid jumping at max sin value yp = 25*fastSin(5*i)/256+50+yFr; for(y=0;y<NLINES;y++) for(x=0;x<WD_3D;x++) frBuf[SCR_WD*y+x] = pat[((y+yp)&0x1f)*32 + ((x+xp)&0x1f)]; }Beta Was this translation helpful? Give feedback.
All reactions