[Git][NTPsec/ntpsec][master] Simplify an argunent profile.
Eric S. Raymond
gitlab at mg.gitlab.com
Sun Dec 25 11:06:33 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
aaeb2f71 by Eric S. Raymond at 2016-12-25T06:05:50-05:00
Simplify an argunent profile.
- - - - -
3 changed files:
- include/ntp_fp.h
- libparse/data_mbg.c
- libparse/mfp_mul.c
Changes:
=====================================
include/ntp_fp.h
=====================================
--- a/include/ntp_fp.h
+++ b/include/ntp_fp.h
@@ -366,7 +366,7 @@ extern char * prettydate (l_fp *);
extern char * gmprettydate (l_fp *);
extern char * gmprettydate (l_fp *);
extern char * rfc3339date (l_fp *);
-extern l_fp mfp_mul (int32_t, uint32_t, int32_t, uint32_t);
+extern l_fp mfp_mul (l_fp, int32_t, uint32_t);
extern void set_sys_fuzz (double);
extern void get_ostime (struct timespec *tsp);
=====================================
libparse/data_mbg.c
=====================================
--- a/libparse/data_mbg.c
+++ b/libparse/data_mbg.c
@@ -326,7 +326,7 @@ get_mbg_lla(
else
if (i != ALT)
{ /* convert to degrees (* 180/PI) */
- lla[i] = mfp_mul(lla[i].l_i, lla[i].l_uf, rad2deg_i, rad2deg_f);
+ lla[i] = mfp_mul(lla[i], rad2deg_i, rad2deg_f);
}
}
}
=====================================
libparse/mfp_mul.c
=====================================
--- a/libparse/mfp_mul.c
+++ b/libparse/mfp_mul.c
@@ -28,8 +28,7 @@
l_fp
mfp_mul(
- int32_t a_i,
- uint32_t a_f,
+ l_fp a_op,
int32_t b_i,
uint32_t b_f
)
@@ -40,6 +39,8 @@ mfp_mul(
unsigned long b[4]; /* operand b */
unsigned long c[6]; /* result c - 5 items for performance - see below */
unsigned long carry;
+ int32_t a_i = lfpsint(a_op);
+ uint32_t a_f = lfpfrac(a_op);
l_fp out;
int neg = 0;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/aaeb2f71d37bc3aad4f47bcfc546db8621de3cf8
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161225/2bb8a1a6/attachment.html>
More information about the vc
mailing list