• Eugene Kosov's avatar
    fix gcc optimized build · 4c80dcda
    Eugene Kosov authored
    ../sql/spatial.cc: In member function ‘double Gis_point::calculate_haversine(const Geometry*, double, int*)’:
    ../sql/spatial.cc:1093:45: error: ‘y1r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1093 |   res= 2*sphere_radius*asin((sqrt(dlat + cos(y1r)*cos(y2r)*dlong)));
          |                                          ~~~^~~~~
    ../sql/spatial.cc:1092:20: error: ‘x1r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1092 |   dlong=  sin((x2r - x1r)/2)*sin((x2r - x1r)/2);
          |               ~~~~~^~~~~~
    ../sql/spatial.cc:1093:54: error: ‘y2r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1093 |   res= 2*sphere_radius*asin((sqrt(dlat + cos(y1r)*cos(y2r)*dlong)));
          |                                                   ~~~^~~~~
    ../sql/spatial.cc:1092:20: error: ‘x2r’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1092 |   dlong=  sin((x2r - x1r)/2)*sin((x2r - x1r)/2);
          |               ~~~~~^~~~~~
    c
    4c80dcda
spatial.cc 85.9 KB