[PATCH,V2 1/9] include: libsframe: add APIs for SFrame header flags

Indu Bhagat indu.bhagat@oracle.com
Sat Jun 7 05:42:13 GMT 2025


On 6/6/25 2:37 AM, Jan Beulich wrote:
> On 04.06.2025 09:08, Indu Bhagat via Binutils wrote:
>> --- a/libsframe/sframe.c
>> +++ b/libsframe/sframe.c
>> @@ -988,6 +988,16 @@ sframe_decoder_get_version (sframe_decoder_ctx *dctx)
>>     return dhp->sfh_preamble.sfp_version;
>>   }
>>   
>> +/* Get the section flags from the SFrame decoder context DCTX.  */
>> +
>> +uint8_t
>> +sframe_decoder_get_flags (sframe_decoder_ctx *dctx)
> 
> While I understand the function parameter can't become pointer-to-const, ...
> 
>> +{
>> +  sframe_header *dhp;
> 
> ... this one clearly can be, and ...
> 
>> +  dhp = sframe_decoder_get_header (dctx);
> 
> ... this can be the initializer of the variable.
> 
>> +  return dhp->sfh_preamble.sfp_flags;
>> +}
>> +
>>   /* Get the SFrame's fixed FP offset given the decoder context CTX.  */
>>   int8_t
>>   sframe_decoder_get_fixed_fp_offset (sframe_decoder_ctx *ctx)
>> @@ -1402,6 +1412,16 @@ sframe_encoder_get_version (sframe_encoder_ctx *encoder)
>>     return ehp->sfh_preamble.sfp_version;
>>   }
>>   
>> +/* Get the section flags from the SFrame encoder context ENCODER.  */
>> +
>> +uint8_t
>> +sframe_encoder_get_flags (sframe_encoder_ctx *encoder)
>> +{
>> +  sframe_header *ehp;
>> +  ehp = sframe_encoder_get_header (encoder);
>> +  return ehp->sfh_preamble.sfp_flags;
>> +}
> 
> Same comments here then.
> 
> Okay with these adjustments.
> 

I have made these changes. Thanks



More information about the Binutils mailing list