[gnumeric] nlsolve: use a g_assert for hinting gcc about number of vars.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] nlsolve: use a g_assert for hinting gcc about number of vars.
- Date: Mon, 9 Jul 2018 23:59:34 +0000 (UTC)
commit c53474627319c103bd8a9cdd3e8199e220b3a194
Author: Morten Welinder <terra gnome org>
Date: Mon Jul 9 19:58:36 2018 -0400
nlsolve: use a g_assert for hinting gcc about number of vars.
Kills a warning.
plugins/nlsolve/gnm-nlsolve.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/plugins/nlsolve/gnm-nlsolve.c b/plugins/nlsolve/gnm-nlsolve.c
index 396f12094..dcf207800 100644
--- a/plugins/nlsolve/gnm-nlsolve.c
+++ b/plugins/nlsolve/gnm-nlsolve.c
@@ -321,6 +321,9 @@ rosenbrock_iter (GnmNlsolve *nl)
gnm_float eps = gnm_pow2 (-16);
int safety = 0;
+ // Give gcc a few hints.
+ g_assert (n >= 0 && n < (1<<20));
+
if (nl->tentative) {
nl->tentative--;
if (nl->tentative == 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]