Fix compiler errors on TI compiler
*/
/* Standard includes. */
+#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -88,7 +89,7 @@ TEST_GROUP_RUNNER( Full_Serializer_CBOR )
TEST( Full_Serializer_CBOR, Encoder_init_with_null_buffer )
{
- IotSerializerEncoderObject_t encoderObject = { 0 };
+ IotSerializerEncoderObject_t encoderObject = { .type = ( IotSerializerDataType_t ) 0 };
TEST_ASSERT_EQUAL( IOT_SERIALIZER_SUCCESS,
_encoder.init( &encoderObject, NULL, 0 ) );
@@ -234,6 +235,7 @@ TEST( Full_Serializer_CBOR, Encoder_open_map )
TEST( Full_Serializer_CBOR, Encoder_open_array )
{
+ uint8_t i = 0;
IotSerializerEncoderObject_t arrayObject = IOT_SERIALIZER_ENCODER_CONTAINER_INITIALIZER_ARRAY;
int64_t numberArray[] = { 3, 2, 1 };
@@ -241,7 +243,7 @@ TEST( Full_Serializer_CBOR, Encoder_open_array )
TEST_ASSERT_EQUAL( IOT_SERIALIZER_SUCCESS,
_encoder.openContainer( &_encoderObject, &arrayObject, 3 ) );
- for( uint8_t i = 0; i < 3; i++ )
+ for( i = 0; i < 3; i++ )
{
TEST_ASSERT_EQUAL( IOT_SERIALIZER_SUCCESS,
_encoder.append( &arrayObject, IotSerializer_ScalarSignedInt( numberArray[ i ] ) ) );
@@ -264,7 +266,7 @@ TEST( Full_Serializer_CBOR, Encoder_open_array )
TEST_ASSERT_EQUAL( CborNoError,
cbor_value_enter_container( &outermostValue, &arrayValue ) );
- for( uint8_t i = 0; i < 3; i++ )
+ for( i = 0; i < 3; i++ )
{
TEST_ASSERT_EQUAL( CborIntegerType, cbor_value_get_type( &arrayValue ) );
TEST_ASSERT_EQUAL( CborNoError, cbor_value_get_int64( &arrayValue, &number ) );
@@ -325,6 +327,7 @@ TEST( Full_Serializer_CBOR, Encoder_map_nest_map )
TEST( Full_Serializer_CBOR, Encoder_map_nest_array )
{
+ uint8_t i = 0;
IotSerializerEncoderObject_t mapObject = IOT_SERIALIZER_ENCODER_CONTAINER_INITIALIZER_MAP;
IotSerializerEncoderObject_t arrayObject = IOT_SERIALIZER_ENCODER_CONTAINER_INITIALIZER_ARRAY;
@@ -336,7 +339,7 @@ TEST( Full_Serializer_CBOR, Encoder_map_nest_array )
TEST_ASSERT_EQUAL( IOT_SERIALIZER_SUCCESS,
_encoder.openContainerWithKey( &mapObject, "array", &arrayObject, 3 ) );
- for( uint8_t i = 0; i < 3; i++ )
+ for( i = 0; i < 3; i++ )
{
TEST_ASSERT_EQUAL( IOT_SERIALIZER_SUCCESS,
_encoder.append( &arrayObject, IotSerializer_ScalarSignedInt( numberArray[ i ] ) ) );
@@ -367,7 +370,7 @@ TEST( Full_Serializer_CBOR, Encoder_map_nest_array )
TEST_ASSERT_EQUAL( CborNoError,
cbor_value_enter_container( &array, &arrayElement ) );
- for( uint8_t i = 0; i < 3; i++ )
+ for( i = 0; i < 3; i++ )
{
TEST_ASSERT_EQUAL( CborIntegerType, cbor_value_get_type( &arrayElement ) );
TEST_ASSERT_EQUAL( CborNoError, cbor_value_get_int64( &arrayElement, &number ) );
