Canonicalise identifier names
[pspp-builds.git] / lib / gtksheet / psppire-axis-impl.c
index 0505d1a51e5247f474d34c434abeb5cc198196fb..58e2871660254de1fd4db6406a0736e08ce1210a 100644 (file)
@@ -41,19 +41,24 @@ struct axis_node
 };
 
 static gint
-get_unit_at_pixel (const PsppireAxis *axis, glong pixel)
+unit_at_pixel (const PsppireAxis *axis, glong pixel)
 {
   PsppireAxisImpl *a = PSPPIRE_AXIS_IMPL (axis);
 
   unsigned long int start;
+  struct tower_node *n;
+  struct axis_node *an;
+  gfloat fraction;
 
-  struct tower_node *n = tower_lookup (&a->pixel_tower, pixel, &start);
+  g_return_val_if_fail (pixel >= 0, -1);
 
-  struct axis_node *an = tower_data (n, struct axis_node, pixel_node);
+  n = tower_lookup (&a->pixel_tower, pixel, &start);
+  an = tower_data (n, struct axis_node, pixel_node);
 
-  gfloat fraction = (pixel - start) / (gfloat) tower_node_get_size (&an->pixel_node);
+  fraction = (pixel - start) / (gfloat) tower_node_get_size (&an->pixel_node);
 
-  return  tower_node_get_level (&an->unit_node) + fraction * tower_node_get_size (&an->unit_node);
+  return  tower_node_get_level (&an->unit_node)
+    + fraction * tower_node_get_size (&an->unit_node);
 }
 
 
@@ -68,7 +73,7 @@ unit_count (const PsppireAxis *axis)
 
 /* Returns the pixel at the start of UNIT */
 static glong
-pixel_start (const PsppireAxis *axis, gint unit)
+start_pixel (const PsppireAxis *axis, gint unit)
 {
   gfloat fraction;
   PsppireAxisImpl *a = PSPPIRE_AXIS_IMPL (axis);
@@ -134,8 +139,8 @@ psppire_impl_iface_init (PsppireAxisIface *iface)
 {
   iface->unit_size = unit_size;
   iface->unit_count = unit_count;
-  iface->pixel_start = pixel_start;
-  iface->get_unit_at_pixel = get_unit_at_pixel;
+  iface->start_pixel = start_pixel;
+  iface->unit_at_pixel = unit_at_pixel;
   iface->total_size = total_size;
 }