Mark some arrays as const
This commit is contained in:
parent
fbbafc6909
commit
b0e1a1ecc4
|
@ -170,8 +170,8 @@ SR_PRIV int testo_request_packet(const struct sr_dev_inst *sdi)
|
||||||
* Testo 175/177/400/650/950/435/635/735/445/645/945/946/545. */
|
* Testo 175/177/400/650/950/435/635/735/445/645/945/946/545. */
|
||||||
SR_PRIV gboolean testo_check_packet_prefix(unsigned char *buf, int len)
|
SR_PRIV gboolean testo_check_packet_prefix(unsigned char *buf, int len)
|
||||||
{
|
{
|
||||||
|
static const unsigned char check[] = { 0x21, 0, 0, 0, 1 };
|
||||||
int i;
|
int i;
|
||||||
unsigned char check[] = { 0x21, 0, 0, 0, 1 };
|
|
||||||
|
|
||||||
if (len < 5)
|
if (len < 5)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -269,13 +269,13 @@ static void decode_buf(struct sr_dev_inst *sdi, unsigned char *data)
|
||||||
|
|
||||||
SR_PRIV int victor_dmm_receive_data(struct sr_dev_inst *sdi, unsigned char *buf)
|
SR_PRIV int victor_dmm_receive_data(struct sr_dev_inst *sdi, unsigned char *buf)
|
||||||
{
|
{
|
||||||
|
static const unsigned char obfuscation[DMM_DATA_SIZE] = "jodenxunickxia";
|
||||||
|
static const unsigned char shuffle[DMM_DATA_SIZE] = {
|
||||||
|
6, 13, 5, 11, 2, 7, 9, 8, 3, 10, 12, 0, 4, 1
|
||||||
|
};
|
||||||
GString *dbg;
|
GString *dbg;
|
||||||
int i;
|
int i;
|
||||||
unsigned char data[DMM_DATA_SIZE];
|
unsigned char data[DMM_DATA_SIZE];
|
||||||
unsigned char obfuscation[DMM_DATA_SIZE] = "jodenxunickxia";
|
|
||||||
unsigned char shuffle[DMM_DATA_SIZE] = {
|
|
||||||
6, 13, 5, 11, 2, 7, 9, 8, 3, 10, 12, 0, 4, 1
|
|
||||||
};
|
|
||||||
|
|
||||||
for (i = 0; i < DMM_DATA_SIZE && buf[i] == 0; i++);
|
for (i = 0; i < DMM_DATA_SIZE && buf[i] == 0; i++);
|
||||||
if (i == DMM_DATA_SIZE) {
|
if (i == DMM_DATA_SIZE) {
|
||||||
|
|
Loading…
Reference in New Issue