First agentic version of removing conversion and sign-conversion#135
Closed
nayakned wants to merge 1 commit into
Closed
First agentic version of removing conversion and sign-conversion#135nayakned wants to merge 1 commit into
nayakned wants to merge 1 commit into
Conversation
warnings. - Set Wconversion and Wsign-conversion in cmake scripts. - Explicit casting for getter functions of different formats. Signed-off-by: Naresh Nayak <Naresh.Nayak@hs-furtwangen.de>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables stricter conversion warnings and updates AVTP field accessors and helper code to use explicit casts that match public return types.
Changes:
- Adds
-Wconversionand-Wsign-conversionto the global CMake compile options. - Adds explicit casts to many getter wrappers around generic AVTP field extraction.
- Adjusts selected VSS serialization/deserialization loops and example socket/time conversions.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
CMakeLists.txt |
Enables additional compiler conversion warnings. |
src/avtp/Utils.c |
Adds casts in generic field get/set bit operations. |
src/avtp/CommonHeader.c |
Casts common header getter results. |
src/avtp/Crf.c |
Casts CRF getter results. |
src/avtp/Rvf.c |
Casts RVF getter results. |
src/avtp/aaf/Aaf.c |
Casts AAF getter results. |
src/avtp/aaf/Pcm.c |
Casts PCM getter results. |
src/avtp/cvf/Cvf.c |
Casts CVF getter results. |
src/avtp/cvf/H264.c |
Casts H264 timestamp getter. |
src/avtp/cvf/Jpeg2000.c |
Casts JPEG2000 getter results. |
src/avtp/cvf/Mjpeg.c |
Casts MJPEG getter results. |
src/avtp/acf/custom/Vss.c |
Updates VSS padding, getters, loops, and serialization casts. |
include/avtp/acf/Abb.h |
Casts ABB inline getter results. |
include/avtp/acf/AcfCommon.h |
Casts ACF common length getter. |
include/avtp/acf/Can.h |
Casts CAN inline getter results. |
include/avtp/acf/CanBrief.h |
Casts CAN Brief inline getter results. |
include/avtp/acf/CanBriefV2.h |
Casts CAN Brief V2 inline getter results. |
include/avtp/acf/CanV2.h |
Casts CAN V2 inline getter results. |
include/avtp/acf/CanXl.h |
Casts CAN XL inline getter results. |
include/avtp/acf/CanXlBrief.h |
Casts CAN XL Brief inline getter results. |
include/avtp/acf/FlexRay.h |
Casts FlexRay inline getter results. |
include/avtp/acf/Gbb.h |
Casts GBB inline getter results. |
include/avtp/acf/Gisf.h |
Casts GISF inline getter and length calculations. |
include/avtp/acf/Gpc.h |
Casts GPC inline getter results. |
include/avtp/acf/Lin.h |
Casts LIN inline getter results. |
include/avtp/acf/Most.h |
Casts MOST inline getter results. |
include/avtp/acf/Ntscf.h |
Casts NTSCF inline getter results. |
include/avtp/acf/Sensor.h |
Casts Sensor inline getter results. |
include/avtp/acf/SensorBrief.h |
Casts Sensor Brief inline getter results. |
include/avtp/acf/Tscf.h |
Casts TSCF inline getter results. |
examples/common/common.c |
Adds casts in example time and socket helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+99
to
+100
| tspec->tv_sec = (__time_t)(ptime / NSEC_PER_SEC); | ||
| tspec->tv_nsec = (__syscall_slong_t)(ptime % NSEC_PER_SEC); |
|
|
||
| uint8_t Avtp_Vss_GetAcfMsgLength(const Avtp_Vss_t* const pdu) { | ||
| return GET_FIELD(AVTP_VSS_FIELD_ACF_MSG_LENGTH); | ||
| return (uint8_t)GET_FIELD(AVTP_VSS_FIELD_ACF_MSG_LENGTH); |
| @@ -339,7 +341,7 @@ void Avtp_Vss_GetVssData(const Avtp_Vss_t* const pdu, VssData_t* val) { | |||
| val->data_uint64_array->data_length = Avtp_BeToCpu16(*(const uint16_t*)vss_data_ptr); | |||
| vss_data_ptr += 2; | |||
| if (val->data_int64_array->data != NULL) { | |||
| } | ||
|
|
||
| // Set the length and padding fields | ||
| padded_length = vss_length + padSize; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
warnings.