Conversation
| { | ||
| if (strcmp(device_type, "CPU") == 0 && strcmp(sensor_name, "temp1") == 0) | ||
| { | ||
| return 1; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
| return 1; | ||
| } | ||
|
|
||
| if (strcmp(device_type, "GPU") == 0 && |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.1 rule Note
| if (strcmp(device_type, "GPU") == 0 && | ||
| (strstr(sensor_name, "GPU") || strstr(sensor_name, "gpu"))) | ||
| { | ||
| return 1; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
| */ | ||
| static int is_temperature_valid(float temperature) | ||
| { | ||
| return temperature >= -50.0f && temperature <= 150.0f; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.1 rule Note
| const char *sensor_name = json_string_value(name_val); | ||
| float temperature = (float)json_number_value(temp_val); | ||
|
|
||
| if (!is_temperature_valid(temperature)) |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.6 rule Note
| if (!devices || !json_is_array(devices)) | ||
| { | ||
| json_decref(root); | ||
| return NULL; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
| float *temperature, int *found_flag) | ||
| { | ||
| const char *device_type = extract_device_type_from_json(device); | ||
| if (!device_type || *found_flag) |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.6 rule Note
| { | ||
| const char *device_type = extract_device_type_from_json(device); | ||
| if (!device_type || *found_flag) | ||
| return; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
|
|
||
| if (strcmp(device_type, target_type) == 0) | ||
| { | ||
| if (temperature) |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 14.4 rule Note
| initialize_temperature_outputs(temp_cpu, temp_gpu); | ||
|
|
||
| json_t *root = parse_json_and_get_devices(json); | ||
| if (!root) |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.6 rule Note
No description provided.