--- therion-5.3.11/thimport.cxx	Fri Aug 30 15:01:56 2013
+++ therion-5.3.11/thimport.cxx	Mon Sep  2 13:55:06 2013
@@ -269,7 +269,6 @@
   static thmbuffer psurv, csurv;
   static long active_survey;
   static thsurvey * prevpsurvey;
-  thdataobject * prevobjptr;
   long i, l;
   bx = sn;
   char * buff = bx.get_buffer(), * rv;
@@ -319,7 +318,6 @@
               // if not, create this survey
               prevcsptr = this->db->csurveyptr;
               prevctx = this->db->ccontext;
-              prevobjptr = 
               this->db->csurveyptr = csurvey;
               if (csurvey == NULL) {
                 this->db->lcsobjectptr = this;
--- therion-5.3.11/thexpuni.cxx	Thu Jan 19 22:40:58 2012
+++ therion-5.3.11/thexpuni.cxx	Mon Sep  2 13:10:34 2013
@@ -697,7 +697,7 @@
             scrap = (thscrap*) cmi->object;
             xu.parse_scrap(scrap);
             if (xu.m_part_list.size() > 0) {
-              double x(0.0), y(0.0), z(0.0), px(0.0), py(0.0), pz(0.0);
+              double x(0.0), y(0.0), z(0.0), px(0.0), py(0.0);
               bool inside;
               std::list<thexpuni_part>::iterator it;
               std::list<thexpuni_data>::iterator ip;
@@ -722,7 +722,6 @@
                   inside = true;
                   px = x;
                   py = y;
-                  pz = z;
                 }
                 if (inside) {
                   ip = it->m_point_list.begin();
--- therion-5.3.11/thepsparse.cxx	Sun May 30 10:11:10 2010
+++ therion-5.3.11/thepsparse.cxx	Mon Sep  2 13:57:29 2013
@@ -146,6 +146,12 @@
   closed=false;
   fillstroke = -1;
   transformation.clear();
+  transf[0] = 0;
+  transf[1] = 0;
+  transf[2] = 0;
+  transf[3] = 0;
+  transf[4] = 0;
+  transf[5] = 0;
 }
 
 MP_path::MP_path() {
--- therion-5.3.11/thattr.cxx	Sun Dec 23 05:12:45 2012
+++ therion-5.3.11/thattr.cxx	Mon Sep  2 13:03:40 2013
@@ -587,8 +587,6 @@
 {
   // Create file.
   FILE * f;
-  thattr_attr * ca;
-  thattr_field * cf;
   thattr_obj_list::iterator oi, oinext;
   thattr_id2attr_map::iterator ai;
   thattr_field_list::iterator fli;
@@ -617,8 +615,6 @@
 
   
   // Insert objects and write fields.
-  const char * value;
-  bool hasone;
   int clevel, nlevel;
   clevel = 0;
   for(oi = this->m_obj_list.begin(); oi != this->m_obj_list.end();) {
@@ -764,7 +760,7 @@
       }
       fprintf(f,"<td align=\"%s\"", alstr);
       if (m_tree && header_value) {
-        fprintf(f," style=\"padding-left:+%u\"", 12 * oi->m_tree_level);
+        fprintf(f," style=\"padding-left:+%u\"", 12 * (unsigned)oi->m_tree_level);
         oinext = oi;
         oinext++;
         if ((oinext != this->m_obj_list.end()) && (oinext->m_tree_level > oi->m_tree_level)) {
--- therion-5.3.11/thdb2d.cxx	Thu Nov  8 07:39:22 2012
+++ therion-5.3.11/thdb2d.cxx	Mon Sep  2 13:09:46 2013
@@ -827,7 +827,6 @@
     }
     
     thmap * mapp;
-    thscrap * scrapp;
     switch (optr->get_class_id()) {
       case TT_MAP_CMD:
         mapp = (thmap *) optr;
@@ -845,7 +844,6 @@
         break;
 
       case TT_SCRAP_CMD:
-        scrapp = (thscrap *) optr;
         if (citem->name.survey != NULL)
           ththrow(("%s [%d] -- not a map reference -- %s@%s",
             citem->source.name, citem->source.line, 
@@ -880,7 +878,6 @@
   thdb2dji * citem = jptr->first_item, * prev_item;
   thpoint * pointp;
   thline * linep;
-  thscrap * scrapp;
   thdb2dprj * cprj;
   int otype;
   while (citem != NULL) {
@@ -921,7 +918,6 @@
     
     switch (otype) {
       case TT_SCRAP_CMD:
-        scrapp = (thscrap*) optr;
         prev_item = citem->prev_item;
         if (prev_item != NULL) {
           if (!(prev_item->object->is(TT_SCRAP_CMD))) {
--- therion-5.3.11/thdb1d.h	Thu Nov  8 06:29:40 2012
+++ therion-5.3.11/thdb1d.h	Mon Sep  2 12:58:23 2013
@@ -157,7 +157,7 @@
    */
    
   thdb1ds() : uid(0), x(0), y(0), z(0), name(NULL), comment(NULL), survey(NULL), fixcontext(NULL), 
-    data(NULL), data_priority(0), temps(TT_TEMPSTATION_NONE),
+    data(), data_priority(0), temps(TT_TEMPSTATION_NONE),
     flags(TT_STATIONFLAG_NONE), mark(TT_DATAMARK_TEMP), extend(TT_EXTENDFLAG_NORMAL), 
     adjusted(false), fixed(false), placed(0), sdx(0.0), sdy(0.0), sdz(0.0),
     explored(thnan) {}
@@ -169,7 +169,7 @@
    
   thdb1ds(const char * n, class thsurvey * ps) : uid(0), x(0), y(0), z(0), name(n), 
     comment(NULL), survey(ps), fixcontext(NULL),  
-    data(NULL), data_priority(0), temps(TT_TEMPSTATION_NONE),
+    data(), data_priority(0), temps(TT_TEMPSTATION_NONE),
     flags(TT_STATIONFLAG_NONE),
     mark(TT_DATAMARK_TEMP), extend(TT_EXTENDFLAG_NORMAL), mark_station(false), 
     adjusted(false), fixed(false), placed(0), sdx(0.0), sdy(0.0), sdz(0.0),
--- therion-5.3.11/thsymbolset.cxx	Sun Dec 23 03:50:38 2012
+++ therion-5.3.11/thsymbolset.cxx	Mon Sep  2 13:01:12 2013
@@ -807,10 +807,8 @@
   thbuffer texb;
   texb.guarantee(128);
   unsigned symn = 0;
-  bool isin[thsymbolset_size];
   
   for(int i = 0; i < thsymbolset_size; i++)
-    isin[i] = true;
 	if (layout->legend == TT_LAYOUT_LEGEND_ALL) {
 		this->export_symbol_show_group(mpf, SYMX_POINT_FLAG);
 	}
@@ -832,7 +830,6 @@
 // vlozi figure do metapostu
 #define insfig(mid,txt) \
   if (((mid == 0) || (isused(mid))) && (strlen(txt) > 0)) {\
-    isin[mid] = false;\
     LEGENDITEM = LEGENDLIST.insert(LEGENDLIST.end(),dummlr); \
     fprintf(mpf,"beginfig(%d);\n",sfig); \
     fprintf(mpf,"clean_legend_box;\n"); \
--- therion-5.3.11/thexpmap.cxx	Wed Oct 31 02:27:34 2012
+++ therion-5.3.11/thexpmap.cxx	Mon Sep  2 13:10:23 2013
@@ -1104,7 +1104,7 @@
   th2ddataobject * op2;
   bool export_sections, export_outlines_only;
   double shx, shy;
-  unsigned long sclevel, bmlevel;
+  unsigned long bmlevel;
   legenddata ldata;
 
   bool anyprev, anyprevabove = false, anyprevbelow = false;
@@ -1339,7 +1339,6 @@
     bmlevel = 0;
     while (cbm != NULL) {
       cmi = cbm->bm->last_item;
-      sclevel = 0;
       // !!! Tu pridat aj ine druhy - teda ABOVE a BELOW
       export_outlines_only = ((cbm->mode == TT_MAPITEM_ABOVE) ||
         (cbm->mode == TT_MAPITEM_BELOW)) && (!cbm->m_target->previewed)
--- therion-5.3.11/extern/poly2tri/common/shapes.cc	Thu Jan 19 21:42:59 2012
+++ therion-5.3.11/extern/poly2tri/common/shapes.cc	Mon Sep  2 13:05:42 2013
@@ -86,11 +86,6 @@
 Point* Triangle::OppositePoint(Triangle& t, Point& p)
 {
   Point *cw = t.PointCW(p);
-  double x = cw->x;
-  double y = cw->y;
-  x = p.x;
-  y = p.y;
-  Point* ham = PointCW(*cw);
   return PointCW(*cw);
 }
 
--- therion-5.3.11/extern/poly2tri/sweep/sweep_context.cc	Sat Sep 25 20:33:04 2010
+++ therion-5.3.11/extern/poly2tri/sweep/sweep_context.cc	Mon Sep  2 13:06:55 2013
@@ -47,7 +47,7 @@
 void SweepContext::AddHole(std::vector<Point*> polyline)
 {
   InitEdges(polyline);
-  for(int i = 0; i < polyline.size(); i++) {
+  for(unsigned i = 0; i < polyline.size(); i++) {
     points_.push_back(polyline[i]);
   }
 }
@@ -72,7 +72,7 @@
   double ymax(points_[0]->y), ymin(points_[0]->y);
 
   // Calculate bounds.
-  for (int i = 0; i < points_.size(); i++) {
+  for (unsigned i = 0; i < points_.size(); i++) {
     Point& p = *points_[i];
     if (p.x > xmax)
       xmax = p.x;
@@ -192,7 +192,7 @@
         delete ptr;
     }
 
-     for(int i = 0; i < edge_list.size(); i++) {
+    for(unsigned i = 0; i < edge_list.size(); i++) {
         delete edge_list[i];
     }
 
--- therion-5.3.11/extern/poly2tri/sweep/sweep.cc	Thu Feb  2 01:02:56 2012
+++ therion-5.3.11/extern/poly2tri/sweep/sweep.cc	Mon Sep  2 13:06:29 2013
@@ -51,8 +51,8 @@
   for (int i = 1; i < tcx.point_count(); i++) {
     Point& point = *tcx.GetPoint(i);
     Node* node = &PointEvent(tcx, point);
-    for (int i = 0; i < point.edge_list.size(); i++) {
-      EdgeEvent(tcx, point.edge_list[i], node);
+    for (unsigned j = 0; j < point.edge_list.size(); j++) {
+      EdgeEvent(tcx, point.edge_list[j], node);
     }
   }
 }
@@ -814,7 +814,7 @@
 Sweep::~Sweep() {
 
     // Clean up memory
-    for(int i = 0; i < nodes_.size(); i++) {
+    for(unsigned i = 0; i < nodes_.size(); i++) {
         delete nodes_[i];
     }
 
--- therion-5.3.11/extern/poly2tri/sweep/advancing_front.h	Sat Sep 25 20:33:04 2010
+++ therion-5.3.11/extern/poly2tri/sweep/advancing_front.h	Mon Sep  2 13:00:24 2013
@@ -48,12 +48,12 @@
 
   double value;
 
-  Node(Point& p) : point(&p), triangle(NULL), value(p.x), next(NULL), prev(NULL)
+  Node(Point& p) : point(&p), triangle(NULL), next(NULL), prev(NULL), value(p.x)
   {
   }
 
-  Node(Point& p, Triangle& t) : point(&p), triangle(&t), value(p.x),
-    next(NULL), prev(NULL)
+  Node(Point& p, Triangle& t) : point(&p), triangle(&t),
+    next(NULL), prev(NULL), value(p.x)
   {
   }
 
--- therion-5.3.11/thdataleg.cxx	Thu Oct 25 23:49:53 2012
+++ therion-5.3.11/thdataleg.cxx	Mon Sep  2 13:08:49 2013
@@ -172,13 +172,12 @@
 //    }
 //  }
   
-  double dx, dy, dz, dL, dl, dT, dC, ddx, ddy, ddz, dh, dZ;
+  double dx, dy, dz, dL, dl, dT, dC, ddx, ddy, ddz, dZ;
 #define setd(a,b,v) if (thisnan(b)) a = v; else a = b;
   setd(dx, this->x_sd, 0.057735026919);
   setd(dy, this->y_sd, 0.057735026919);
   setd(dz, this->z_sd, 0.057735026919);
   setd(dL, this->length_sd, 0.1);
-  setd(dh, this->length_sd, 0.1);
   setd(dl, this->counter_sd, 0.1);
   setd(dZ, this->depth_sd, 0.1);
   setd(dT, this->bearing_sd, 1.0);
--- therion-5.3.11/thdb1d.cxx	Thu Nov  8 10:36:51 2012
+++ therion-5.3.11/thdb1d.cxx	Mon Sep  2 12:59:23 2013
@@ -2486,7 +2486,7 @@
   thdb1d_loop_leg * ll;
   thsurvey * ss;   
 	int totlen = 6 - strlen(thdeflocale.format_length_units()) + 1;
-  thdb1ds * ps, * prev_ps, * first_ps;
+  thdb1ds * ps;
   unsigned long psid, prev_psid, first_psid;
   
   thlog.printf("\n\n######################### loop errors ##########################\n");
@@ -2508,14 +2508,12 @@
     else
       psid = ll->leg->from.id;
     ps = &(this->station_vec[psid - 1]);
-    first_ps = ps;
     first_psid = psid;
     thlog.printf("%s", ps->name);
     if ((ss == NULL) || (ss->id != ps->survey->id)) {
       ss = ps->survey;
       thlog.printf("@%s", ss->get_full_name());
     }
-    prev_ps = ps;
     prev_psid = psid;
     while (ll != NULL) {
     
@@ -2556,7 +2554,6 @@
         }
       }
 
-      prev_ps = ps;
       prev_psid = psid;
       ll = ll->next_leg;
     }
--- therion-5.3.11/thline.cxx	Sat Nov 10 07:09:49 2012
+++ therion-5.3.11/thline.cxx	Mon Sep  2 13:10:09 2013
@@ -1120,7 +1120,6 @@
       int from, int to, int dbglevel)
 {
   thdb2dlp * lp = this->first_point;
-  thdb2dpt * prev_pt = NULL;
 //  double xt, yt, d;
   unsigned last = 0;
   bool dnu = false;
@@ -1134,7 +1133,6 @@
         fprintf(out->file," -- ");
         lp->point->export_mp(out,dbglevel);
       }
-      prev_pt = lp->point;
     } 
     else if (dnu) {
       if ((lp->cp1 != NULL) && (lp->cp2 != NULL)) {
@@ -1153,7 +1151,6 @@
         lp->point->export_mp(out,dbglevel);
       fprintf(out->file,"\n");
     }
-    prev_pt = lp->point;
     lp = lp->nextlp;
     last++;
   }
--- therion-5.3.11/thgeomag.cxx	Sat May 26 10:51:30 2007
+++ therion-5.3.11/thgeomag.cxx	Mon Sep  2 13:00:47 2013
@@ -58,7 +58,7 @@
   static double roots[nmax+1][nmax+1][2];
 
 
-  double yearfrac,sr,r,theta,c,s,psi,fn,fn_0,B_r,B_theta,B_phi,X,Y,Z;
+  double yearfrac,sr,r,theta,c,s,psi,fn,fn_0,B_r,B_theta,B_phi,X,Y; // Z
   double sinpsi, cospsi, inv_s;
 
   static int been_here = 0;
@@ -195,7 +195,7 @@
   cospsi = cos(psi);
   X = -B_theta * cospsi - B_r * sinpsi;
   Y = B_phi;
-  Z = B_theta * sinpsi - B_r * cospsi;
+  /* Z = B_theta * sinpsi - B_r * cospsi; */
 
   /*    field[0]=B_r;
   field[1]=B_theta;
--- therion-5.3.11/thpoint.cxx	Sat Nov 10 09:32:11 2012
+++ therion-5.3.11/thpoint.cxx	Mon Sep  2 13:09:59 2013
@@ -1144,7 +1144,7 @@
   int npar = this->db->db2d.mbf.get_size();
   char ** pars = this->db->db2d.mbf.get_buffer();
   int sv, ux, vx, sv2;
-  bool parsev, quest, quest2;
+  bool quest, quest2;
   double dv, dv2;
   int sign, sign2;
   thtflength lentf;
@@ -1154,7 +1154,6 @@
 
     case TT_POINT_TYPE_EXTRA:
       ux = 0;
-      parsev = false;
       switch (npar) {
         case 1:
           break;
@@ -1182,7 +1181,6 @@
       
     case TT_POINT_TYPE_HEIGHT:
       ux = 0;
-      parsev = false;
       switch (npar) {
         case 1:
           break;
@@ -1249,7 +1247,6 @@
     case TT_POINT_TYPE_PASSAGE_HEIGHT:
       ux = 0;
       vx = 0;
-      parsev = false;
       switch (npar) {
         case 1:
           break;
--- therion-5.3.11/loch/lxImgIO.h	Tue Dec 12 21:35:40 2006
+++ therion-5.3.11/loch/lxImgIO.h	Mon Sep  2 13:17:19 2013
@@ -13,7 +13,7 @@
 typedef unsigned char uchar;
 #endif
 
-extern char * lxImgIOError;
+extern const char * lxImgIOError;
 
 // struct for handling images
 struct lxImageRGB {
--- therion-5.3.11/loch/lxFile.cxx	Sat Nov 10 21:21:00 2012
+++ therion-5.3.11/loch/lxFile.cxx	Mon Sep  2 13:29:09 2013
@@ -754,6 +754,7 @@
   while (!feof(this->m_file)) {
     getline(&lnp, &lns, this->m_file);
     nt = lxFile__SplitTokens((unsigned char *) lnp, &(tok[0]), 16);
+    (void)nt;
     switch (*(tok[0])) {
       case 'M':
       case 'D':
@@ -881,7 +882,6 @@
   tmpSurvey->m_namePtr = this->m_surveysData.AppendStr(sname);
   delete [] sname;
 
-  int last_result;
   std::map<std::string, lxFileStation*> label_map;
   std::map<std::string, lxFileStation*>::iterator lmi;
   std::map<imp3Dpos, lxFileStation*> pos_map;
@@ -955,7 +955,6 @@
           }
         }
         stPtrPrev = stPtr;
-        last_result = result;
         break;
 
       case img_XSECT:
--- therion-5.3.11/loch/lxData.cxx	Sat Nov 10 22:33:46 2012
+++ therion-5.3.11/loch/lxData.cxx	Mon Sep  2 13:18:08 2013
@@ -256,9 +256,8 @@
 {
 
   wxString inpln, flags, filename;
-  wxUint32 id1, id2, nid, lnNum, scrapWallsNpt, currentXpt = 0,
+  wxUint32 id1, id2, nid, scrapWallsNpt, currentXpt = 0,
 		surfaceNpt;
-  wxInt32 xMode;
   double fpos[3], norm[3];
 
   lxLRUD lrud;
@@ -266,7 +265,6 @@
   lxDataStation st;
   lxDataShot sh;
   lxDataSurvey sv;
-  bool err;
 
   this->Clear();
 
@@ -279,9 +277,6 @@
   //vtkVoidArray * cldata_array = vtkVoidArray::New();
   vtkIntArray * cldata_array = vtkIntArray::New();
   cldata_array->SetName("Temp");
-  err = false;
-  lnNum = 0;
-  xMode = -1;
 	surfaceNpt = 0;
   lxVec tmpVec;
   
--- therion-5.3.11/loch/lxGUI.cxx	Sun Nov 25 07:03:21 2012
+++ therion-5.3.11/loch/lxGUI.cxx	Mon Sep  2 13:18:36 2013
@@ -1116,7 +1116,6 @@
     wxFileSystem::AddHandler(new wxZipFSHandler);
     // Use a double-buffered visual if available, as it will give much smoother
     // animation.
-    bool double_buffered = true;
     int wx_gl_attribs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
     if (!InitGLVisual(wx_gl_attribs)) {
 	int wx_gl_attribs_no_db[] = { WX_GL_RGBA, 0 };
@@ -1126,7 +1125,6 @@
 	    wxMessageBox(m,_T("Loch") , wxOK | wxCENTRE | wxICON_EXCLAMATION);
 	    exit(1);
 	}
-	double_buffered = false;
     }
 
 
--- therion-5.3.11/loch/lxR2P.c	Sun Oct  1 08:12:06 2006
+++ therion-5.3.11/loch/lxR2P.c	Mon Sep  2 13:08:09 2013
@@ -33,10 +33,8 @@
                             GLX_DOUBLEBUFFER,
                             None };
    int scrnum;
-   Window root;
    scrnum = DefaultScreen( r2pc->dpy );
-   root = RootWindow( r2pc->dpy, scrnum );
-   
+ 
    r2pc->visinfo = glXChooseVisual( r2pc->dpy, scrnum, (int *) sbAttrib );
    if (!r2pc->visinfo) {
       r2pc->visinfo = glXChooseVisual( r2pc->dpy, scrnum, (int *) dbAttrib );
--- therion-5.3.11/loch/lxImgIO.cxx	Tue Dec 12 21:35:40 2006
+++ therion-5.3.11/loch/lxImgIO.cxx	Mon Sep  2 12:58:07 2013
@@ -446,6 +446,6 @@
 }
 
 
-char * lxImgIOError = "unknown";
+const char * lxImgIOError = "unknown";
 
 
