mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 17:38:32 -04:00
AP_Scripting: generator: dont initalise trivial types
This commit is contained in:
parent
32d6919ae2
commit
0772af5539
@ -1138,28 +1138,28 @@ void emit_checker(const struct type t, int arg_number, int skipped, const char *
|
|||||||
arg_number = arg_number + NULLABLE_ARG_COUNT_BASE;
|
arg_number = arg_number + NULLABLE_ARG_COUNT_BASE;
|
||||||
switch (t.type) {
|
switch (t.type) {
|
||||||
case TYPE_BOOLEAN:
|
case TYPE_BOOLEAN:
|
||||||
fprintf(source, "%sbool data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%sbool data_%d;\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_FLOAT:
|
case TYPE_FLOAT:
|
||||||
fprintf(source, "%sfloat data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%sfloat data_%d;\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_INT8_T:
|
case TYPE_INT8_T:
|
||||||
fprintf(source, "%sint8_t data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%sint8_t data_%d;\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_INT16_T:
|
case TYPE_INT16_T:
|
||||||
fprintf(source, "%sint16_t data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%sint16_t data_%d;\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_INT32_T:
|
case TYPE_INT32_T:
|
||||||
fprintf(source, "%sint32_t data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%sint32_t data_%d;\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_UINT8_T:
|
case TYPE_UINT8_T:
|
||||||
fprintf(source, "%suint8_t data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%suint8_t data_%d;\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_UINT16_T:
|
case TYPE_UINT16_T:
|
||||||
fprintf(source, "%suint16_t data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%suint16_t data_%d;\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_UINT32_T:
|
case TYPE_UINT32_T:
|
||||||
fprintf(source, "%suint32_t data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%suint32_t data_%d;\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_AP_OBJECT:
|
case TYPE_AP_OBJECT:
|
||||||
case TYPE_NONE:
|
case TYPE_NONE:
|
||||||
@ -1169,7 +1169,7 @@ void emit_checker(const struct type t, int arg_number, int skipped, const char *
|
|||||||
fprintf(source, "%schar * data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%schar * data_%d = {};\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_ENUM:
|
case TYPE_ENUM:
|
||||||
fprintf(source, "%suint32_t data_%d = {};\n", indentation, arg_number);
|
fprintf(source, "%suint32_t data_%d;\n", indentation, arg_number);
|
||||||
break;
|
break;
|
||||||
case TYPE_USERDATA:
|
case TYPE_USERDATA:
|
||||||
fprintf(source, "%s%s data_%d = {};\n", indentation, t.data.ud.name, arg_number);
|
fprintf(source, "%s%s data_%d = {};\n", indentation, t.data.ud.name, arg_number);
|
||||||
|
Loading…
Reference in New Issue
Block a user