<div dir="ltr"><nitpicking> this could be done in a more compact way with something like<br>><br>> static const string names[] = {"Path", "VolumeIndex", "Offset",<br>>                                "Length"};<br>
> chunk_tag = CHUNK_UNKNOWN;<br>> for(ChunkTag_t i = 0; i < CHUNK_LENGTH; i++)<br>>   if( node == names[i])<br>>   {<br>>     chunk_tag = i+1;<br>>     break;<br>>   }<br>> if(chunk_tag == CHUNK_UNKNOWN)<br>
>   return -1;<br><br><br>Hello<br>I try to implement this table<br>But have a compilation error for line<br>for(ChunkTag_t i = 0; i < CHUNK_LENGTH; i++)<br>ERROR   : ../../modules/access/dcp/dcpparser.cpp:153: 36:  invalid conversion from 'int' to 'ChunkTag_t' [-fpermissive]<br>
ERROR   : ../../modules/access/dcp/dcpparser.cpp:153: 58:  no 'operator++(int)' declared for postfix '++' [-fpermissive]<br><br>Is there a way to overridde that error ( like a typedef for ChunkTag_t')<br>
<br>defined this way<br>typedef enum {<br>    CHUNK_UNKNOWN = 0,<br>    CHUNK_PATH,<br>    CHUNK_VOL_INDEX,<br>    CHUNK_OFFSET,<br>    CHUNK_LENGTH<br>} ChunkTag_t;<br><br><div class="gmail_extra"><br></div></div>