gcalctool r2159 - trunk/gcalctool



Author: rancell
Date: Sat Aug  9 06:40:18 2008
New Revision: 2159
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2159&view=rev

Log:
Streamline display code

Added:
   trunk/gcalctool/register.c
   trunk/gcalctool/register.h
Modified:
   trunk/gcalctool/Makefile.am
   trunk/gcalctool/display.c
   trunk/gcalctool/functions.c
   trunk/gcalctool/functions.h

Modified: trunk/gcalctool/Makefile.am
==============================================================================
--- trunk/gcalctool/Makefile.am	(original)
+++ trunk/gcalctool/Makefile.am	Sat Aug  9 06:40:18 2008
@@ -31,6 +31,8 @@
 	parser.c \
 	parser.h \
 	parser_mac.h \
+	register.c \
+	register.h \
 	gtk.c \
 	ui.h \
         unittest.c \

Modified: trunk/gcalctool/display.c
==============================================================================
--- trunk/gcalctool/display.c	(original)
+++ trunk/gcalctool/display.c	Sat Aug  9 06:40:18 2008
@@ -29,6 +29,7 @@
 #include "functions.h"
 #include "ui.h"
 #include "ce_parser.h" // For ce_parse()
+#include "register.h"
 
 static struct exprm_state *
 get_state(GCDisplay *display)

Modified: trunk/gcalctool/functions.c
==============================================================================
--- trunk/gcalctool/functions.c	(original)
+++ trunk/gcalctool/functions.c	Sat Aug  9 06:40:18 2008
@@ -183,32 +183,6 @@
 }
 
 
-/* Return: 0 = success, otherwise failed.
- *
- * TODO: remove hardcoding from reg ranges.
- */
-
-void
-do_sto_reg(int reg, int value[MP_SIZE])
-{
-    if ((reg >= 0) && (reg <= 10))
-        mp_set_from_mp(value, v->MPmvals[reg]);
-}
-
-
-/* Return: 0 = success, otherwise failed.
- *
- * TODO: remove hardcoding from reg ranges.
- */
-
-void
-do_rcl_reg(int reg, int value[MP_SIZE])
-{
-    if ((reg >= 0) && (reg <= 10))
-        mp_set_from_mp(v->MPmvals[reg], value);
-}
-
-
 void
 do_expression(int function, int arg, int cursor)
 {

Modified: trunk/gcalctool/functions.h
==============================================================================
--- trunk/gcalctool/functions.h	(original)
+++ trunk/gcalctool/functions.h	Sat Aug  9 06:40:18 2008
@@ -23,12 +23,6 @@
 #ifndef FUNCTIONS_H
 #define FUNCTIONS_H
 
-#include "calctool.h"
-
 void do_expression(int function, int arg, int cursor);
 
-// FIXME: Not functions
-void do_rcl_reg(int reg, int value[MP_SIZE]);
-void do_sto_reg(int reg, int value[MP_SIZE]);
-
 #endif /*FUNCTIONS_H*/

Added: trunk/gcalctool/register.c
==============================================================================
--- (empty file)
+++ trunk/gcalctool/register.c	Sat Aug  9 06:40:18 2008
@@ -0,0 +1,38 @@
+
+/*  $Header$
+ *
+ *  Copyright (c) 2008 Robert Ancell
+ *           
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *           
+ *  This program is distributed in the hope that it will be useful, but 
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
+ *  General Public License for more details.
+ *           
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ *  02111-1307, USA.
+ */
+
+#include "register.h"
+#include "calctool.h"
+
+void
+do_sto_reg(int reg, int value[MP_SIZE])
+{
+    if ((reg >= 0) && (reg <= 10))
+        mp_set_from_mp(value, v->MPmvals[reg]);
+}
+
+
+void
+do_rcl_reg(int reg, int value[MP_SIZE])
+{
+    if ((reg >= 0) && (reg <= 10))
+        mp_set_from_mp(v->MPmvals[reg], value);
+}

Added: trunk/gcalctool/register.h
==============================================================================
--- (empty file)
+++ trunk/gcalctool/register.h	Sat Aug  9 06:40:18 2008
@@ -0,0 +1,30 @@
+
+/*  $Header$
+ *
+ *  Copyright (c) 2008 Robert Ancell
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ *  02111-1307, USA.
+ */
+
+#ifndef REGISTER_H
+#define REGISTER_H
+
+#include "mp.h"
+
+void do_rcl_reg(int reg, int value[MP_SIZE]);
+void do_sto_reg(int reg, int value[MP_SIZE]);
+
+#endif /*REGISTER_H*/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]