comparison miscutil/gsmrec-dump.c @ 128:a5ffec18e4cd

test programs: use printf %d format for codec parameters Even though all codec params (both FR and EFR) are small unsigned integers, we use signed int16_t data type for both, for interface reasons: in the case of FR it's the gsm_signal type of libgsm, and in the case of EFR it's the Word16 type of ETSI codec guts. Therefore, the correct printf format is %d, not %u, when the objective is to see what's in the variables (what the compiler sees) and catch any bugs.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 11 Dec 2022 04:00:13 +0000
parents edd2e20e7090
children 3816ba89a5a0
comparison
equal deleted inserted replaced
127:4af99bf8671a 128:a5ffec18e4cd
50 case 0xC0: 50 case 0xC0:
51 printf("EFR SID=%d LPC", EFR_sid_classify(frame)); 51 printf("EFR SID=%d LPC", EFR_sid_classify(frame));
52 EFR_frame2params(frame, params); 52 EFR_frame2params(frame, params);
53 n = 0; 53 n = 0;
54 for (i = 0; i < 5; i++) 54 for (i = 0; i < 5; i++)
55 printf(" %u", params[n++]); 55 printf(" %d", params[n++]);
56 putchar('\n'); 56 putchar('\n');
57 for (i = 0; i < 4; i++) { 57 for (i = 0; i < 4; i++) {
58 putchar(' '); 58 putchar(' ');
59 for (j = 0; j < 13; j++) 59 for (j = 0; j < 13; j++)
60 printf(" %u", params[n++]); 60 printf(" %d", params[n++]);
61 putchar('\n'); 61 putchar('\n');
62 } 62 }
63 break; 63 break;
64 case 0xD0: 64 case 0xD0:
65 fputs("FR", stdout); 65 fputs("FR", stdout);
66 gsm_explode(dummy_state, frame, params); 66 gsm_explode(dummy_state, frame, params);
67 n = 0; 67 n = 0;
68 for (i = 0; i < 8; i++) 68 for (i = 0; i < 8; i++)
69 printf(" %u", params[n++]); 69 printf(" %d", params[n++]);
70 putchar('\n'); 70 putchar('\n');
71 for (i = 0; i < 4; i++) { 71 for (i = 0; i < 4; i++) {
72 putchar(' '); 72 putchar(' ');
73 for (j = 0; j < 17; j++) 73 for (j = 0; j < 17; j++)
74 printf(" %u", params[n++]); 74 printf(" %d", params[n++]);
75 putchar('\n'); 75 putchar('\n');
76 } 76 }
77 break; 77 break;
78 } 78 }
79 } 79 }