Skip to content

First agentic version of removing conversion and sign-conversion#135

Closed
nayakned wants to merge 1 commit into
mainfrom
cmake/warnings_on
Closed

First agentic version of removing conversion and sign-conversion#135
nayakned wants to merge 1 commit into
mainfrom
cmake/warnings_on

Conversation

@nayakned
Copy link
Copy Markdown
Collaborator

warnings.

  • Set Wconversion and Wsign-conversion in cmake scripts.
  • Explicit casting for getter functions of different formats.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -Wconversion and -Wsign-conversion to 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 thread examples/common/common.c
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);
Comment thread src/avtp/acf/custom/Vss.c

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);
Comment thread src/avtp/acf/custom/Vss.c
@@ -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) {
Comment thread src/avtp/acf/custom/Vss.c
}

// Set the length and padding fields
padded_length = vss_length + padSize;
@nayakned nayakned closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants