summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--src/Makefile.am2
-rw-r--r--src/controller/callbacks/reshape.c2
-rw-r--r--src/db/dbconnect.sqc12
-rw-r--r--src/model/data/base.sqc2
-rw-r--r--src/model/state/state.h3
-rw-r--r--src/util/check_error.c6
-rw-r--r--src/util/check_error_db.c13
-rw-r--r--src/util/check_error_db.h9
8 files changed, 40 insertions, 9 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index cf16798..de6226d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -39,6 +39,7 @@ libflumap_la_SOURCES = \
39 model/state/zoom_info_init.c \39 model/state/zoom_info_init.c \
40 util/ati_meminfo.c \40 util/ati_meminfo.c \
41 util/check_error.c \41 util/check_error.c \
42 util/check_error_db.c \
42 util/pick_convert.c \43 util/pick_convert.c \
43 util/sqlinfoprint.c \44 util/sqlinfoprint.c \
44 view/geometry.c \45 view/geometry.c \
@@ -78,6 +79,7 @@ noinst_HEADERS = \
78 plugin/plugin.h \79 plugin/plugin.h \
79 util/ati_meminfo.h \80 util/ati_meminfo.h \
80 util/check_error.h \81 util/check_error.h \
82 util/check_error_db.h \
81 util/pick_convert.h \83 util/pick_convert.h \
82 util/sqlinfoprint.h \84 util/sqlinfoprint.h \
83 view/geometry.h \85 view/geometry.h \
diff --git a/src/controller/callbacks/reshape.c b/src/controller/callbacks/reshape.c
index 99557b7..dedce5a 100644
--- a/src/controller/callbacks/reshape.c
+++ b/src/controller/callbacks/reshape.c
@@ -81,7 +81,7 @@ reshape (int w, int h)
81 glViewport (0, 0, (GLsizei) w, (GLsizei) h);81 glViewport (0, 0, (GLsizei) w, (GLsizei) h);
8282
83 density_legend_geometry ();83 density_legend_geometry ();
84 datarose_geometry ();84 // datarose_geometry ();
8585
86 return;86 return;
87}87}
diff --git a/src/db/dbconnect.sqc b/src/db/dbconnect.sqc
index 1e41a12..aab7bcb 100644
--- a/src/db/dbconnect.sqc
+++ b/src/db/dbconnect.sqc
@@ -1,5 +1,5 @@
1#include "dbconnect.h"1#include "dbconnect.h"
2#include "../util/check_error.h"2#include "../util/check_error_db.h"
33
4EXEC SQL INCLUDE sqlca;4EXEC SQL INCLUDE sqlca;
55
@@ -7,5 +7,13 @@ void
7dbconnect (void)7dbconnect (void)
8{8{
9 EXEC SQL CONNECT TO exp004;9 EXEC SQL CONNECT TO exp004;
10 check_error (__FILE__, __LINE__);10
11 /*
12 * Only check for a database error rather than using check_error to
13 * test for OpenGL and database errors. OpenGL may not yet be
14 * prepared and checking it prematurely could cause odd behavior.
15 */
16 check_error_db (__FILE__, __LINE__);
17
18 return;
11}19}
diff --git a/src/model/data/base.sqc b/src/model/data/base.sqc
index 41a651c..4627bea 100644
--- a/src/model/data/base.sqc
+++ b/src/model/data/base.sqc
@@ -169,7 +169,7 @@ base (void)
169 v++;169 v++;
170 }170 }
171171
172 glGenBuffers (2, S.buffers);172 glGenBuffers (NUM_BUFFERS, S.buffers);
173173
174 glBindBuffer (GL_ARRAY_BUFFER, S.buffers[BASE_VERTICES]);174 glBindBuffer (GL_ARRAY_BUFFER, S.buffers[BASE_VERTICES]);
175 glVertexPointer (2, GL_FLOAT, 0, 0);175 glVertexPointer (2, GL_FLOAT, 0, 0);
diff --git a/src/model/state/state.h b/src/model/state/state.h
index 6e4f62e..f432017 100644
--- a/src/model/state/state.h
+++ b/src/model/state/state.h
@@ -8,6 +8,7 @@
8/*8/*
9 * Buffer object identifiers.9 * Buffer object identifiers.
10 */10 */
11#define NUM_BUFFERS 2
11#define BASE_VERTICES 012#define BASE_VERTICES 0
12#define BASE_COLORS 113#define BASE_COLORS 1
1314
@@ -80,7 +81,7 @@ typedef struct
80 /*81 /*
81 * Buffer objects.82 * Buffer objects.
82 */83 */
83 unsigned int buffers[1];84 unsigned int buffers[NUM_BUFFERS];
8485
85 /*86 /*
86 * GI Identifiers indexed by row. Storage is [rows][20].87 * GI Identifiers indexed by row. Storage is [rows][20].
diff --git a/src/util/check_error.c b/src/util/check_error.c
index c47ca43..7d116e9 100644
--- a/src/util/check_error.c
+++ b/src/util/check_error.c
@@ -2,8 +2,7 @@
2#include <error.h>2#include <error.h>
3#include <errno.h>3#include <errno.h>
4#include <stdlib.h>4#include <stdlib.h>
5#include "sqlinfoprint.h"5#include "check_error_db.h"
6extern struct sqlca sqlca;
76
8void7void
9check_error (const char *filename, const unsigned int linenum)8check_error (const char *filename, const unsigned int linenum)
@@ -23,8 +22,7 @@ check_error (const char *filename, const unsigned int linenum)
23 /*22 /*
24 * Check for an error from the Database API.23 * Check for an error from the Database API.
25 */24 */
26 if (sqlinfoprint ("DB Error", &sqlca, filename, linenum) == 1)25 check_error_db (filename, linenum);
27 exit (EXIT_FAILURE);
2826
29 return;27 return;
30}28}
diff --git a/src/util/check_error_db.c b/src/util/check_error_db.c
new file mode 100644
index 0000000..a6b7f51
--- a/dev/null
+++ b/src/util/check_error_db.c
@@ -0,0 +1,13 @@
1#include "check_error_db.h"
2#include "sqlinfoprint.h"
3#include <stdlib.h>
4extern struct sqlca sqlca;
5
6void
7check_error_db (const char *filename, const unsigned int linenum)
8{
9 if (sqlinfoprint ("DB Error", &sqlca, filename, linenum) == 1)
10 exit (EXIT_FAILURE);
11
12 return;
13}
diff --git a/src/util/check_error_db.h b/src/util/check_error_db.h
new file mode 100644
index 0000000..cc8467b
--- a/dev/null
+++ b/src/util/check_error_db.h
@@ -0,0 +1,9 @@
1#ifndef CHECK_ERROR_H
2#define CHECK_ERROR_H
3
4/*
5 * Check the database library to see if an error has occurred.
6 */
7void check_error_db (const char* filename, unsigned int linenum);
8
9#endif // CHECK_ERROR_H

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.