Commit af99c04a authored by Morten Welinder's avatar Morten Welinder
Browse files

Incredible picky cleanups.

parent 9d5bef7f
1999-05-26 Morten Welinder <terra@diku.dk>
* src/sheet-view.h: Include fix.
* src/style.h: Include fix.
* src/symbol.c (symbol_table_new): Use gnumeric_strcase_equal and
gnumeric_strcase_hash.
(g_strcase_equal): Delete.
(g_strcase_hash): Delete.
* src/eval.c (dependency_equal): Constify.
* src/sheet.c (cell_hash): Constify.
(cell_compare): Ditto.
(CRsort): Ditto.
1999-05-26 Michael Meeks <michael@imaginator.com>
* src/file.c (file_saver_is_default_format): Fixed bug causing
......
1999-05-26 Morten Welinder <terra@diku.dk>
* src/sheet-view.h: Include fix.
* src/style.h: Include fix.
* src/symbol.c (symbol_table_new): Use gnumeric_strcase_equal and
gnumeric_strcase_hash.
(g_strcase_equal): Delete.
(g_strcase_hash): Delete.
* src/eval.c (dependency_equal): Constify.
* src/sheet.c (cell_hash): Constify.
(cell_compare): Ditto.
(CRsort): Ditto.
1999-05-26 Michael Meeks <michael@imaginator.com>
* src/file.c (file_saver_is_default_format): Fixed bug causing
......
1999-05-26 Morten Welinder <terra@diku.dk>
* src/sheet-view.h: Include fix.
* src/style.h: Include fix.
* src/symbol.c (symbol_table_new): Use gnumeric_strcase_equal and
gnumeric_strcase_hash.
(g_strcase_equal): Delete.
(g_strcase_hash): Delete.
* src/eval.c (dependency_equal): Constify.
* src/sheet.c (cell_hash): Constify.
(cell_compare): Ditto.
(CRsort): Ditto.
1999-05-26 Michael Meeks <michael@imaginator.com>
* src/file.c (file_saver_is_default_format): Fixed bug causing
......
1999-05-26 Morten Welinder <terra@diku.dk>
* src/sheet-view.h: Include fix.
* src/style.h: Include fix.
* src/symbol.c (symbol_table_new): Use gnumeric_strcase_equal and
gnumeric_strcase_hash.
(g_strcase_equal): Delete.
(g_strcase_hash): Delete.
* src/eval.c (dependency_equal): Constify.
* src/sheet.c (cell_hash): Constify.
(cell_compare): Ditto.
(CRsort): Ditto.
1999-05-26 Michael Meeks <michael@imaginator.com>
* src/file.c (file_saver_is_default_format): Fixed bug causing
......
......@@ -55,8 +55,8 @@ cell_eval (Cell *cell)
static gint
dependency_equal (gconstpointer v, gconstpointer v2)
{
DependencyRange *r1 = (DependencyRange *) v;
DependencyRange *r2 = (DependencyRange *) v2;
const DependencyRange *r1 = (const DependencyRange *) v;
const DependencyRange *r2 = (const DependencyRange *) v2;
if (r1->sheet != r2->sheet)
return 0;
......
......@@ -55,8 +55,8 @@ cell_eval (Cell *cell)
static gint
dependency_equal (gconstpointer v, gconstpointer v2)
{
DependencyRange *r1 = (DependencyRange *) v;
DependencyRange *r2 = (DependencyRange *) v2;
const DependencyRange *r1 = (const DependencyRange *) v;
const DependencyRange *r2 = (const DependencyRange *) v2;
if (r1->sheet != r2->sheet)
return 0;
......
......@@ -3,6 +3,7 @@
#include "sheet.h"
#include <gtk/gtktable.h>
#include <gnome.h>
#define SHEET_VIEW_TYPE (sheet_view_get_type ())
#define SHEET_VIEW(obj) (GTK_CHECK_CAST((obj), SHEET_VIEW_TYPE, SheetView))
......
......@@ -3,6 +3,7 @@
#include "sheet.h"
#include <gtk/gtktable.h>
#include <gnome.h>
#define SHEET_VIEW_TYPE (sheet_view_get_type ())
#define SHEET_VIEW(obj) (GTK_CHECK_CAST((obj), SHEET_VIEW_TYPE, SheetView))
......
......@@ -111,7 +111,7 @@ sheet_init_dummy_stuff (Sheet *sheet)
static guint
cell_hash (gconstpointer key)
{
CellPos *ca = (CellPos *) key;
const CellPos *ca = (const CellPos *) key;
return (ca->row << 8) | ca->col;
}
......@@ -119,10 +119,10 @@ cell_hash (gconstpointer key)
static gint
cell_compare (gconstpointer a, gconstpointer b)
{
CellPos *ca, *cb;
const CellPos *ca, *cb;
ca = (CellPos *) a;
cb = (CellPos *) b;
ca = (const CellPos *) a;
cb = (const CellPos *) b;
if (ca->row != cb->row)
return 0;
......@@ -294,8 +294,8 @@ sheet_col_new (Sheet *sheet)
static gint
CRsort (gconstpointer a, gconstpointer b)
{
ColRowInfo *ia = (ColRowInfo *) a;
ColRowInfo *ib = (ColRowInfo *) b;
const ColRowInfo *ia = (const ColRowInfo *) a;
const ColRowInfo *ib = (const ColRowInfo *) b;
return (ia->pos - ib->pos);
}
......
#ifndef GNUMERIC_STYLE_H
#define GNUMERIC_STYLE_H
#include <gdk/gdk.h>
typedef struct {
char *format;
int want_am_pm;
......
......@@ -10,6 +10,7 @@
#include <ctype.h>
#include <stdio.h>
#include "symbol.h"
#include "utils.h"
SymbolTable *global_symbol_table;
......@@ -138,37 +139,12 @@ symbol_unref (Symbol *sym)
}
}
static gint
g_strcase_equal (gconstpointer v1, gconstpointer v2)
{
return strcasecmp ((const gchar*) v1, (const gchar*) v2) == 0;
}
static guint
g_strcase_hash (gconstpointer v)
{
const char *s = (const char *) v;
const char *p;
guint h = 0, g;
for (p = s; *p != '\0'; p += 1){
h = (h << 4) + toupper (*p);
if ((g = h & 0xf0000000)){
h = h ^ (g >> 24);
h = h ^ g;
}
}
return h /* % M */;
}
SymbolTable *
symbol_table_new (void)
{
SymbolTable *st = g_new (SymbolTable, 1);
st->hash = g_hash_table_new (g_strcase_hash, g_strcase_equal);
st->hash = g_hash_table_new (gnumeric_strcase_hash, gnumeric_strcase_equal);
return st;
}
......@@ -178,7 +154,7 @@ symbol_table_new (void)
* @st: The symbol table to destroy
*
* This only releases the resources associated with a SymbolTable.
* Note that the symols on the Symbol Table are not unrefed, it is
* Note that the symbols on the SymbolTable are not unrefed, it is
* up to the caller to unref them.
*/
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment