return vg_msg_cmd_array_count( code ) * vg_msg_cmd_type_size( code );
}
+static u8 vg_msg_count_bits( u32 count ){
+ assert( (count <= 16) && count );
+ return ((count-1)<<2);
+}
+
/* write a sized type */
static void vg_msg_wkvnum( vg_msg *msg, const char *key,
u8 type, u8 count, void *data ){
- u8 code = type | ((count-1)<<2);
+ u8 code = type | vg_msg_count_bits(count);
vg_msg_wbuf( msg, &code, 1 );
vg_msg_wstr( msg, key );
}
}
}
-
+ msg->error = k_vg_msg_error_OK;
msg->cur = orig;
return 0;
}
printf( "'%s': ", cmd.key );
- if( count > 1 ) printf( "'{' " );
+ if( count > 1 ) printf( "{ " );
for( u32 i=0; i<count; i++ ){
const void *p = cmd.value + size*i;
if( i+1<count ) printf(", ");
}
- if( count > 1 ) printf( "'}'" );
+ if( count > 1 ) printf( " }" );
printf( "\n" );
}
}