From cf8bcd1d6359b6e83ec0cfb7f4a1c82ceb50004c Mon Sep 17 00:00:00 2001 From: Paul Hollinsky Date: Sun, 30 May 2021 02:55:00 -0700 Subject: [PATCH] Examples: Interactive C: Fix initializers --- examples/c/interactive/src/main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/c/interactive/src/main.c b/examples/c/interactive/src/main.c index 0f2daaf..a118885 100644 --- a/examples/c/interactive/src/main.c +++ b/examples/c/interactive/src/main.c @@ -31,7 +31,7 @@ void printAllDevices() { printf("No devices found! Please scan for new devices.\n"); } for(int i = 0; i < numDevices; i++) { - char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = {}; + char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = { 0 }; size_t descriptionLength = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION; // Updates productDescription and descriptionLength for each device @@ -272,7 +272,7 @@ int main() { selectedDevice = selectDevice(); // Get the product description for the device - char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = {}; + char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = { 0 }; size_t descriptionLength = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION; icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength); @@ -333,7 +333,7 @@ int main() { selectedDevice = selectDevice(); // Get the product description for the device - char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = {}; + char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = { 0 }; size_t descriptionLength = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION; icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength); @@ -381,7 +381,7 @@ int main() { selectedDevice = selectDevice(); // Get the product description for the device - char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = {}; + char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = { 0 }; size_t descriptionLength = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION; icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength); @@ -440,7 +440,7 @@ int main() { selectedDevice = selectDevice(); // Get the product description for the device - char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = {}; + char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = { 0 }; size_t descriptionLength = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION; icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength); @@ -515,7 +515,7 @@ int main() { selectedDevice = selectDevice(); // Get the product description for the device - char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = {}; + char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = { 0 }; size_t descriptionLength = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION; icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength); @@ -570,7 +570,7 @@ int main() { selectedDevice = selectDevice(); // Get the product description for the device - char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = {}; + char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = { 0 }; size_t descriptionLength = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION; icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength); @@ -596,7 +596,7 @@ int main() { selectedDevice = selectDevice(); // Get the product description for the device - char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = {}; + char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = { 0 }; size_t descriptionLength = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION; icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength); @@ -722,13 +722,13 @@ int main() { selectedDevice = selectDevice(); // Get the product description for the device - char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = {}; + char productDescription[ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION] = { 0 }; size_t descriptionLength = ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION; icsneo_describeDevice(selectedDevice, productDescription, &descriptionLength); printf("Termination is "); const bool val = icsneo_isTerminationEnabledFor(selectedDevice, ICSNEO_NETID_HSCAN); - neoevent_t err = {}; + neoevent_t err = { 0 }; if(icsneo_getLastError(&err)) { printf("not available at this time: %s\n\n", err.description); break;