> -----Original Message-----
> From: [email protected] [mailto:lng-odp-
> [email protected]] On Behalf Of ext Ola Liljedahl
> Sent: Wednesday, January 28, 2015 12:48 PM
> To: LNG ODP Mailman List
> Subject: [lng-odp] odp_cpumask.h
> 
>  * @param str    Output buffer
>  * @param len    Size of string length (incl. ending zero)
>  */
> void odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, int len);
> 
> Why don't we use size_t for the"len" parameter?
> 
> -- Ola


It's an object size, so it can be changed to size_t (similar to e.g. 
snprintf()).

Packet data len/offsets, buffer sizes, packet/bytes counts etc, should be 
uintxx_t - but object sizes should be size_t.


Answer to: What happens if len < output length? Maybe we copy the snprintf 
definition (except output also ending zero). Return number chars written (incl. 
str ending zero), otherwise return number of chars that would have been 
outputted (return >len and clip output).

-Petri

_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to