VOL-513: Support ASFVOLT16 Adapter in Swarm Mode -VOL-467 Phase 1 - Polling Mode

Follow up changes to do the following.

1) Remove reduntant spaces in the code
2) Change the grpc-c stream write mechanism from non-blocking to blocking
3) Increase the bal_indication queue size from 25 to 1000
4) Compilation warning fixes

Change-Id: I3917d526d4db59601ca9d8468f66f4219d735e17
diff --git a/device_simulator/voltha_bal_driver.c b/device_simulator/voltha_bal_driver.c
index 83a83ef..c430b64 100755
--- a/device_simulator/voltha_bal_driver.c
+++ b/device_simulator/voltha_bal_driver.c
@@ -96,7 +96,7 @@
    /*
     * Write reply back to the client
     */
-   ret_val = context->gcc_stream->write(context, &bal_reboot, 0);
+   ret_val = context->gcc_stream->write(context, &bal_reboot, -1);
    is_grpc_write_pending(ret_val);
 
    grpc_c_status_t status;
@@ -142,7 +142,7 @@
    /*
     * Write reply back to the client
     */
-   ret_val = context->gcc_stream->write(context, &bal_err, 0);
+   ret_val = context->gcc_stream->write(context, &bal_err, -1);
    is_grpc_write_pending(ret_val);
 
    grpc_c_status_t status;
@@ -204,7 +204,7 @@
     get_stats.data = &stat_data;
     get_stats.key = &stat_key;
 
-    ret_val = context->gcc_stream->write(context, &get_stats, 0);
+    ret_val = context->gcc_stream->write(context, &get_stats, -1);
     is_grpc_write_pending(ret_val);
 
     grpc_c_status_t status;
@@ -266,7 +266,7 @@
     * Write reply back to the client
     */
 
-   ret_val = context->gcc_stream->write(context, &bal_err, 0);
+   ret_val = context->gcc_stream->write(context, &bal_err, -1);
    is_grpc_write_pending(ret_val);
 
    grpc_c_status_t status;
@@ -428,7 +428,7 @@
    /*
     * Write reply back to the client
     */
-   ret_val = context->gcc_stream->write(context, &bal_err, 0);
+   ret_val = context->gcc_stream->write(context, &bal_err, -1);
    is_grpc_write_pending(ret_val);
 
    grpc_c_status_t status;
@@ -495,15 +495,15 @@
 
 void bal_get_ind__free_mem_group_ind(BalIndications *balIndCfg)
 {
-   int i = 0;
+   unsigned int i = 0;
    free(balIndCfg->group_ind->data->flows->val);
    free(balIndCfg->group_ind->data->flows);
    for (i = 0; i < balIndCfg->group_ind->data->members->n_val; i++)
    {
       free(balIndCfg->group_ind->data->members->val[i]->queue);
       free(balIndCfg->group_ind->data->members->val[i]->action);
+      free(balIndCfg->group_ind->data->members->val[i]);
    }
-   free(balIndCfg->group_ind->data->members->val);
    free(balIndCfg->group_ind->data->members);
    free(balIndCfg->group_ind->data);
    free(balIndCfg->group_ind->key);
@@ -525,7 +525,7 @@
 {
    free(balIndCfg->interface_los->data);
    free(balIndCfg->interface_los->hdr);
-   free(balIndCfg->interface_los); 
+   free(balIndCfg->interface_los);
    free(balIndCfg);
 }
 
@@ -707,7 +707,7 @@
        case BAL_INDICATIONS__U_ACCESS_TERM_IND:
           bal_get_ind__free_mem_access_term_ind(balIndCfg);
           break;
- 
+
        case BAL_INDICATIONS__U_ACCESS_TERM_IND_OP_STATE:
           bal_get_ind__free_mem_access_term_ind_op_state(balIndCfg);
           break;
@@ -777,7 +777,7 @@
           break;
 
        default:
-          ASFVOLT_LOG(ASFVOLT_ERROR, "Unknown case %lu\n", balIndCfg->u_case);
+          ASFVOLT_LOG(ASFVOLT_ERROR, "Unknown case %u\n", balIndCfg->u_case);
           break;
     }
 }
@@ -803,7 +803,7 @@
    pthread_mutex_lock(&bal_ind_queue_lock);
    node = get_bal_indication_node();
    pthread_mutex_unlock(&bal_ind_queue_lock);
-     
+
    if(node != NULL)
    {
       bal_indication = node->bal_indication;
@@ -823,7 +823,7 @@
     * Write reply back to the client
     */
 
-   ret_val = context->gcc_stream->write(context, bal_indication, 0);
+   ret_val = context->gcc_stream->write(context, bal_indication, -1);
    is_grpc_write_pending(ret_val);
 
    grpc_c_status_t status;
@@ -836,7 +836,7 @@
    {
       ASFVOLT_LOG(ASFVOLT_ERROR, "Failed to write status\n");
    }
-   
+
    /*Free memory for 'bal_indication' and 'node'*/
    if (bal_indication->ind_present)
    {