Commit e9985077 authored by Alexey Botchkov's avatar Alexey Botchkov

GIS library code cleanup.

GCALC_DBUG_OFF and related infrastructure defined so we can enable/disable debugging conveniently.

per-file comments:
  sql/gcalc_slicescan.cc
GIS library code cleanup.
  sql/gcalc_slicescan.h
GIS library code cleanup.
  sql/gcalc_tools.cc
GIS library code cleanup.
  sql/gcalc_tools.h
GIS library code cleanup.
parent 6e7d578b
This diff is collapsed.
......@@ -17,6 +17,16 @@
#ifndef GCALC_SLICESCAN_INCLUDED
#define GCALC_SLICESCAN_INCLUDED
#ifndef DBUG_OFF
#define GCALC_CHECK_WITH_FLOAT
#else
#define GCALC_DBUG_OFF
#endif /*DBUG_OFF*/
#define GCALC_DBUG_PRINT(b) DBUG_PRINT("Gcalc", b)
#define GCALC_DBUG_ENTER(a) DBUG_ENTER("Gcalc "a)
#define GCALC_DBUG_RETURN(r) DBUG_RETURN(r)
#define GCALC_DBUG_ASSERT(r) DBUG_ASSERT(r)
/*
Gcalc_dyn_list class designed to manage long lists of same-size objects
......@@ -102,12 +112,6 @@ typedef long long coord2;
#define C_SCALE 1e13
#define COORD_BASE 2
#ifndef DBUG_OFF
//#define GCALC_CHECK_WITH_FLOAT
#define NO_TESTING
#else
#define NO_TESTING
#endif /*DBUG_OFF*/
class Gcalc_internal_coord
{
......@@ -349,22 +353,17 @@ public:
class point : public Gcalc_dyn_list::Item
{
public:
#ifdef TMP_BLOCK
double x;
double dx_dy;
int horiz_dir;
#endif /*TMP_BLOCK*/
Gcalc_coord1 dx;
Gcalc_coord1 dy;
Gcalc_heap::Info *pi;
Gcalc_heap::Info *next_pi;
sc_thread_id thread;
const Gcalc_coord1 *l_border;
const Gcalc_coord1 *r_border;
int always_on_left;
const point *intersection_link;
Gcalc_scan_events event;
#ifdef TO_REMOVE
point *next_link;
#endif /*TO_REMOVE*/
inline const point *c_get_next() const
{ return (const point *)next; }
......@@ -377,10 +376,6 @@ public:
void copy_all(const point *from);
/* Compare the dx_dy parameters regarding the horiz_dir */
/* returns -1 if less, 0 if equal, 1 if bigger */
#ifdef TMP_BLOCK
static int cmp_dx_dy(int horiz_dir_a, double dx_dy_a,
int horiz_dir_b, double dx_dy_b);
#endif /*TMP_BLOCK*/
static int cmp_dx_dy(const Gcalc_coord1 *dx_a,
const Gcalc_coord1 *dy_a,
const Gcalc_coord1 *dx_b,
......@@ -409,10 +404,6 @@ public:
int n_row;
sc_thread_id thread_a;
sc_thread_id thread_b;
#ifdef TMP_BLOCK
double x;
double y;
#endif /*TMP_BLOCK*/
const Gcalc_heap::Intersection_info *ii;
inline intersection *get_next() { return (intersection *)next; }
};
......@@ -430,9 +421,6 @@ public:
const Gcalc_heap::Info *pi;
const Gcalc_heap::Intersection_info *isc;
};
#ifdef TMP_BLOCK
double y;
#endif /*TMP_BLOCK*/
slice_state() : slice(NULL) {}
void clear_event_position()
{
......
This diff is collapsed.
......@@ -222,9 +222,9 @@ public:
int get_result(Gcalc_result_receiver *storage);
void reset();
#ifndef DBUG_OFF
#ifndef GCALC_DBUG_OFF
int n_res_points;
#endif /*DBUG_OFF*/
#endif /*GCALC_DBUG_OFF*/
class res_point : public Gcalc_dyn_list::Item
{
public:
......@@ -235,23 +235,19 @@ public:
const Gcalc_heap::Intersection_info *ii;
res_point *first_poly_node;
};
#ifdef TMP_BLOCK
union
{
#endif /*TMP_BLOCK*/
res_point *outer_poly;
uint32 poly_position;
#ifdef TMP_BLOCK
};
#endif /*TMP_BLOCK*/
res_point *up;
res_point *down;
res_point *glue;
Gcalc_function::shape_type type;
Gcalc_dyn_list::Item **prev_hook;
#ifndef DBUG_OFF
#ifndef GCALC_DBUG_OFF
int point_n;
#endif /*DBUG_OFF*/
#endif /*GCALC_DBUG_OFF*/
void set(const Gcalc_scan_iterator *si);
res_point *get_next() { return (res_point *)next; }
};
......
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