From 25c67b0a1e595b185bce13eeb752dbf92343133c Mon Sep 17 00:00:00 2001
From: Etienne Brateau <etienne.brateau@ensiie.fr>
Date: Wed, 23 Jan 2019 22:20:41 +0100
Subject: [PATCH] Move sortshints into utils.h

---
 include/utils.h |  1 +
 src/log.c       | 19 -------------------
 src/page.c      |  1 +
 src/utils.c     | 19 +++++++++++++++++++
 4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/include/utils.h b/include/utils.h
index 27e06be..7be2a4c 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -4,4 +4,5 @@
 void readreal(char s_[], double *r);
 void stamp(long *i);
 void getword(char *buf, char *wrd);
+void sortshints(short *x, short *y);
 #endif
diff --git a/src/log.c b/src/log.c
index 7be162c..eb25f11 100644
--- a/src/log.c
+++ b/src/log.c
@@ -559,25 +559,6 @@ static void getbool(char *buf, int *b)
 }
 
 
-/*=================  SORTSHINTS  =================*/
-/*=                                              =*/
-/*=  Put two shortint variables into increasing  =*/
-/*=     numerical order.                         =*/
-/*=                                              =*/
-/*================================================*/
-
-void sortshints(short *x, short *y)
-{
-	short temp;
-
-	if (*x <= *y)
-		return;
-	temp = *x;
-	*x = *y;
-	*y = temp;
-}
-
-
 /*=================  TESTPROBE  ==================*/
 /*=                                              =*/
 /*=  Find which wire, pin, or gate the Probe     =*/
diff --git a/src/page.c b/src/page.c
index 8ac31da..576bd01 100644
--- a/src/page.c
+++ b/src/page.c
@@ -5,6 +5,7 @@
 #include "logfont.h"
 #include "utils.h"
 #include "page.h"
+#include "log.h"
 
 void chpage(log_page *page)
 {
diff --git a/src/utils.c b/src/utils.c
index e0d82a2..1a6d126 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -105,3 +105,22 @@ void readreal(char *s_, double *r)
 	strcpy(s, str2);
 	dounits(s, r);
 }
+
+/*=================  SORTSHINTS  =================*/
+/*=                                              =*/
+/*=  Put two shortint variables into increasing  =*/
+/*=     numerical order.                         =*/
+/*=                                              =*/
+/*================================================*/
+
+void sortshints(short *x, short *y)
+{
+	short temp;
+
+	if (*x <= *y)
+		return;
+	temp = *x;
+	*x = *y;
+	*y = temp;
+}
+
-- 
GitLab