[OpenWrt-Devel] [PATCH] libubox: use const *attr in getters

Peter Stadler peter.stadler at student.uibk.ac.at
Wed Jan 29 04:15:14 EST 2020


thank you for your fast reply.

It is not faster/smaller as the getters are indirections to blobmsg_data 
(optimized they should have the same performance).

The problem arises, when you have a `const struct blob_attr *` and want 
to get the values: In C++ you cannot pass them to the get-functions 
without removing the constness. You could pass them to `blobmsg_data`, 
but the getters would be the cleaner way as their name is more verbose 
(and they handle the format).

So, it is (should be) more a cosmetic change that reflects the usage.


P.S.: I am also happy if the patch is not included. I just think, it is 
better to have them const at this place, too (I am not seeing any 
reasons, why it would we better to have them non-const).

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list