Commit 5f078cc8 authored by Sergei Golubchik's avatar Sergei Golubchik

compilation errors on sparc sun studio 10

1. unused static inline functions are only removed at -xO4,
   otherwise test binaries will depend on various mysys
   symbols that they don't use. Link test with libmysys.

2. Sphinx - don't instantiate (explicitly) templates before
   they're defined. Or, rather, don't instantiate them explicitly at
   all.

3. GIS - don't use anonymous unions and structs.
parent 2a478178
This diff is collapsed.
...@@ -188,7 +188,7 @@ public: ...@@ -188,7 +188,7 @@ public:
double x,y; double x,y;
Gcalc_coord1 ix, iy; Gcalc_coord1 ix, iy;
int top_node; int top_node;
}; } shape;
struct struct
{ {
/* nt_intersection */ /* nt_intersection */
...@@ -197,21 +197,21 @@ public: ...@@ -197,21 +197,21 @@ public:
const Info *p2; const Info *p2;
const Info *p3; const Info *p3;
const Info *p4; const Info *p4;
void *intersection_data; void *data;
int equal_intersection; int equal;
}; } intersection;
struct struct
{ {
/* nt_eq_node */ /* nt_eq_node */
const Info *node; const Info *node;
void *eq_data; void *data;
}; } eq;
}; } node;
bool is_bottom() const bool is_bottom() const
{ GCALC_DBUG_ASSERT(type == nt_shape_node); return !left; } { GCALC_DBUG_ASSERT(type == nt_shape_node); return !node.shape.left; }
bool is_top() const bool is_top() const
{ GCALC_DBUG_ASSERT(type == nt_shape_node); return top_node; } { GCALC_DBUG_ASSERT(type == nt_shape_node); return node.shape.top_node; }
bool is_single_node() const bool is_single_node() const
{ return is_bottom() && is_top(); } { return is_bottom() && is_top(); }
...@@ -383,7 +383,7 @@ public: ...@@ -383,7 +383,7 @@ public:
inline const point *c_get_next() const inline const point *c_get_next() const
{ return (const point *)next; } { return (const point *)next; }
inline bool is_bottom() const { return !next_pi; } inline bool is_bottom() const { return !next_pi; }
gcalc_shape_info get_shape() const { return pi->shape; } gcalc_shape_info get_shape() const { return pi->node.shape.shape; }
inline point *get_next() { return (point *)next; } inline point *get_next() { return (point *)next; }
inline const point *get_next() const { return (const point *)next; } inline const point *get_next() const { return (const point *)next; }
/* Compare the dx_dy parameters regarding the horiz_dir */ /* Compare the dx_dy parameters regarding the horiz_dir */
......
...@@ -1243,7 +1243,7 @@ inline int Gcalc_operation_reducer::get_single_result(res_point *res, ...@@ -1243,7 +1243,7 @@ inline int Gcalc_operation_reducer::get_single_result(res_point *res,
GCALC_DBUG_RETURN(1); GCALC_DBUG_RETURN(1);
} }
else else
if (storage->single_point(res->pi->x, res->pi->y)) if (storage->single_point(res->pi->node.shape.x, res->pi->node.shape.y))
GCALC_DBUG_RETURN(1); GCALC_DBUG_RETURN(1);
free_result(res); free_result(res);
GCALC_DBUG_RETURN(0); GCALC_DBUG_RETURN(0);
...@@ -1269,8 +1269,8 @@ int Gcalc_operation_reducer::get_result_thread(res_point *cur, ...@@ -1269,8 +1269,8 @@ int Gcalc_operation_reducer::get_result_thread(res_point *cur,
} }
else else
{ {
x= cur->pi->x; x= cur->pi->node.shape.x;
y= cur->pi->y; y= cur->pi->node.shape.y;
} }
if (storage->add_point(x, y)) if (storage->add_point(x, y))
GCALC_DBUG_RETURN(1); GCALC_DBUG_RETURN(1);
......
...@@ -636,10 +636,10 @@ static double count_edge_t(const Gcalc_heap::Info *ea, ...@@ -636,10 +636,10 @@ static double count_edge_t(const Gcalc_heap::Info *ea,
double &ex, double &ey, double &vx, double &vy, double &ex, double &ey, double &vx, double &vy,
double &e_sqrlen) double &e_sqrlen)
{ {
ex= eb->x - ea->x; ex= eb->node.shape.x - ea->node.shape.x;
ey= eb->y - ea->y; ey= eb->node.shape.y - ea->node.shape.y;
vx= v->x - ea->x; vx= v->node.shape.x - ea->node.shape.x;
vy= v->y - ea->y; vy= v->node.shape.y - ea->node.shape.y;
e_sqrlen= ex * ex + ey * ey; e_sqrlen= ex * ex + ey * ey;
return (ex * vx + ey * vy) / e_sqrlen; return (ex * vx + ey * vy) / e_sqrlen;
} }
...@@ -655,8 +655,8 @@ static double distance_to_line(double ex, double ey, double vx, double vy, ...@@ -655,8 +655,8 @@ static double distance_to_line(double ex, double ey, double vx, double vy,
static double distance_points(const Gcalc_heap::Info *a, static double distance_points(const Gcalc_heap::Info *a,
const Gcalc_heap::Info *b) const Gcalc_heap::Info *b)
{ {
double x= a->x - b->x; double x= a->node.shape.x - b->node.shape.x;
double y= a->y - b->y; double y= a->node.shape.y - b->node.shape.y;
return sqrt(x * x + y * y); return sqrt(x * x + y * y);
} }
...@@ -1697,7 +1697,7 @@ double Item_func_distance::val_real() ...@@ -1697,7 +1697,7 @@ double Item_func_distance::val_real()
continue; continue;
count_distance: count_distance:
if (cur_point->shape >= obj2_si) if (cur_point->node.shape.shape >= obj2_si)
continue; continue;
cur_point_edge= !cur_point->is_bottom(); cur_point_edge= !cur_point->is_bottom();
...@@ -1705,13 +1705,13 @@ count_distance: ...@@ -1705,13 +1705,13 @@ count_distance:
{ {
/* We only check vertices of object 2 */ /* We only check vertices of object 2 */
if (dist_point->type != Gcalc_heap::nt_shape_node || if (dist_point->type != Gcalc_heap::nt_shape_node ||
dist_point->shape < obj2_si) dist_point->node.shape.shape < obj2_si)
continue; continue;
/* if we have an edge to check */ /* if we have an edge to check */
if (dist_point->left) if (dist_point->node.shape.left)
{ {
t= count_edge_t(dist_point, dist_point->left, cur_point, t= count_edge_t(dist_point, dist_point->node.shape.left, cur_point,
ex, ey, vx, vy, e_sqrlen); ex, ey, vx, vy, e_sqrlen);
if ((t>0.0) && (t<1.0)) if ((t>0.0) && (t<1.0))
{ {
...@@ -1722,7 +1722,7 @@ count_distance: ...@@ -1722,7 +1722,7 @@ count_distance:
} }
if (cur_point_edge) if (cur_point_edge)
{ {
t= count_edge_t(cur_point, cur_point->left, dist_point, t= count_edge_t(cur_point, cur_point->node.shape.left, dist_point,
ex, ey, vx, vy, e_sqrlen); ex, ey, vx, vy, e_sqrlen);
if ((t>0.0) && (t<1.0)) if ((t>0.0) && (t<1.0))
{ {
......
...@@ -598,8 +598,10 @@ protected: ...@@ -598,8 +598,10 @@ protected:
void SendFloat ( float v ) { SendDword ( sphF2DW(v) ); } void SendFloat ( float v ) { SendDword ( sphF2DW(v) ); }
}; };
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
template int CSphSEQuery::ParseArray<uint32> ( uint32 **, const char * ); template int CSphSEQuery::ParseArray<uint32> ( uint32 **, const char * );
template int CSphSEQuery::ParseArray<longlong> ( longlong **, const char * ); template int CSphSEQuery::ParseArray<longlong> ( longlong **, const char * );
#endif
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MY_ADD_TESTS(bitmap base64 my_vsnprintf my_atomic my_rdtsc lf my_malloc MY_ADD_TESTS(bitmap base64 my_atomic my_rdtsc lf my_malloc my_getopt dynstring
my_getopt dynstring
LINK_LIBRARIES mysys) LINK_LIBRARIES mysys)
MY_ADD_TESTS(my_vsnprintf LINK_LIBRARIES strings mysys)
IF(WIN32) IF(WIN32)
MY_ADD_TESTS(my_delete LINK_LIBRARIES mysys) MY_ADD_TESTS(my_delete LINK_LIBRARIES mysys)
......
MY_ADD_TESTS(strings LINK_LIBRARIES strings) MY_ADD_TESTS(strings LINK_LIBRARIES strings mysys)
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