reverted rule_count back to size_t, as it is passed as pointer (fixes 64bit issues)
This commit is contained in:
@@ -484,12 +484,12 @@ static void write_to_chunk(private_generator_t *this,chunk_t *data)
|
|||||||
*/
|
*/
|
||||||
static void generate_payload (private_generator_t *this,payload_t *payload)
|
static void generate_payload (private_generator_t *this,payload_t *payload)
|
||||||
{
|
{
|
||||||
int i;
|
int i, offset_start;
|
||||||
this->data_struct = payload;
|
size_t rule_count;
|
||||||
int rule_count, offset_start;
|
|
||||||
encoding_rule_t *rules;
|
encoding_rule_t *rules;
|
||||||
payload_type_t payload_type;
|
payload_type_t payload_type;
|
||||||
|
|
||||||
|
this->data_struct = payload;
|
||||||
payload_type = payload->get_type(payload);
|
payload_type = payload->get_type(payload);
|
||||||
/* spi size has to get reseted */
|
/* spi size has to get reseted */
|
||||||
this->last_spi_size = 0;
|
this->last_spi_size = 0;
|
||||||
@@ -500,7 +500,7 @@ static void generate_payload (private_generator_t *this,payload_t *payload)
|
|||||||
payload_type_names, payload_type);
|
payload_type_names, payload_type);
|
||||||
|
|
||||||
/* each payload has its own encoding rules */
|
/* each payload has its own encoding rules */
|
||||||
payload->get_encoding_rules(payload,&rules,&rule_count);
|
payload->get_encoding_rules(payload, &rules, &rule_count);
|
||||||
|
|
||||||
for (i = 0; i < rule_count;i++)
|
for (i = 0; i < rule_count;i++)
|
||||||
{
|
{
|
||||||
@@ -517,7 +517,7 @@ static void generate_payload (private_generator_t *this,payload_t *payload)
|
|||||||
case ATTRIBUTE_TYPE:
|
case ATTRIBUTE_TYPE:
|
||||||
case CONFIGURATION_ATTRIBUTE_LENGTH:
|
case CONFIGURATION_ATTRIBUTE_LENGTH:
|
||||||
{
|
{
|
||||||
generate_u_int_type(this, rules[i].type,rules[i].offset);
|
generate_u_int_type(this, rules[i].type, rules[i].offset);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RESERVED_BIT:
|
case RESERVED_BIT:
|
||||||
|
|||||||
@@ -371,7 +371,8 @@ static status_t parse_payload(private_parser_t *this,
|
|||||||
{
|
{
|
||||||
payload_t *pld;
|
payload_t *pld;
|
||||||
void *output;
|
void *output;
|
||||||
int rule_count, payload_length = 0, spi_size = 0, attribute_length = 0;
|
size_t rule_count;
|
||||||
|
int payload_length = 0, spi_size = 0, attribute_length = 0;
|
||||||
u_int16_t ts_type = 0;
|
u_int16_t ts_type = 0;
|
||||||
bool attribute_format = FALSE;
|
bool attribute_format = FALSE;
|
||||||
int rule_number;
|
int rule_number;
|
||||||
@@ -396,7 +397,7 @@ static status_t parse_payload(private_parser_t *this,
|
|||||||
output = pld;
|
output = pld;
|
||||||
|
|
||||||
/* parse the payload with its own rulse */
|
/* parse the payload with its own rulse */
|
||||||
pld->get_encoding_rules(pld, &(this->rules), &rule_count);
|
pld->get_encoding_rules(pld, &this->rules, &rule_count);
|
||||||
for (rule_number = 0; rule_number < rule_count; rule_number++)
|
for (rule_number = 0; rule_number < rule_count; rule_number++)
|
||||||
{
|
{
|
||||||
rule = &(this->rules[rule_number]);
|
rule = &(this->rules[rule_number]);
|
||||||
|
|||||||
Reference in New Issue
Block a user