Change in libosmocore[master]: add osmo_float_str_to_micros and osmo_micros_to_float_str

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Oct 1 09:54:23 UTC 2020


pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/20331 )

Change subject: add osmo_float_str_to_micros and osmo_micros_to_float_str
......................................................................


Patch Set 1:

(2 comments)

I'm sorry but I'm missing the point for this API, please explain better.
Furthermore, do we really need this API in libosmocore? it's onyl really be used in some specific project AFAIU.
I'm simply wondering about adding really specific APIs to generic libosmocore which we use in embedded devices too.

https://gerrit.osmocom.org/c/libosmocore/+/20331/1/src/utils.c 
File src/utils.c:

https://gerrit.osmocom.org/c/libosmocore/+/20331/1/src/utils.c@1212 
PS1, Line 1212: /*! Convert a string of a floating point number to a signed int with factor of a million.
why not simply:
  double val;
  sscanf("%f", &val);
  return (int) val * 1000*1000;


https://gerrit.osmocom.org/c/libosmocore/+/20331/1/src/utils.c@1293 
PS1, Line 1293: /*! Convert an integer with a factor of a million to a floating point string.
Wy not:

double val2 = val
val2 /= 1000 * 1000;
snprintf(buf, "%f", val2);



-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20331
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib9aee749cd331712a4dcdadfb6a2dfa4c26da957
Gerrit-Change-Number: 20331
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Thu, 01 Oct 2020 09:54:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201001/5c7f6a63/attachment.htm>


More information about the gerrit-log mailing list