Hello,

I'm trying to search an array of structs that I built to match some  
number. However when simulating my search-loop seems to be aborted  
somehow (always at the same index).

I used the following Code:

bool isin_cdest_table(c_dest_entry int_table[], uint16_t dest) {
   int i = 0;
   c_dest_entry checking = int_table[i];
   while (((checking.t_dest) != dest) && (i < C_DEST_CID)) {
   i++;
   checking = int_table[i];
* printf("i: %hhu - checking: %hhu \n", i, checking); printfflush();
   }
   printf("ENDE i: %u \n", i); printfflush();
   if (i == (C_DEST_CID - 1)) {
   printf("NO C_DEST entry found \n"); printfflush();
   return FALSE;
   }
   else {
   entry_found_no = i;
   printf("C_DEST entry found %hhu \n", i); printfflush();
   return TRUE;
   }
   }

This function is called in CC2420ActiveMessageP.nc inside the command  
AMSend.send.
My Array has a size of 64 and the loop aborts at 12 (always). Can  
anyone help me?

The compiler gives me the following warning I can't interpret:

int format, c_dest_entry arg (arg 3) and refers to the line marked  
with an asterisk (*)

Can anyone tell me:
-WHY this is happening
-HOW I can avoid it / fix it

Thank you for your help.


_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to