[GRASS-SVN] r74218 - grass/trunk/include/iostream
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Mar 9 12:27:08 PST 2019
Author: mmetz
Date: 2019-03-09 12:27:08 -0800 (Sat, 09 Mar 2019)
New Revision: 74218
Modified:
grass/trunk/include/iostream/ami_sort_impl.h
grass/trunk/include/iostream/ami_stream.h
grass/trunk/include/iostream/embuffer.h
grass/trunk/include/iostream/empq_adaptive_impl.h
grass/trunk/include/iostream/empq_impl.h
grass/trunk/include/iostream/mem_stream.h
Log:
iostream: reduce compiler warnings
Modified: grass/trunk/include/iostream/ami_sort_impl.h
===================================================================
--- grass/trunk/include/iostream/ami_sort_impl.h 2019-03-09 20:19:25 UTC (rev 74217)
+++ grass/trunk/include/iostream/ami_sort_impl.h 2019-03-09 20:27:08 UTC (rev 74218)
@@ -101,7 +101,7 @@
size_t makeRun_Block(AMI_STREAM<T> *instream, T* data,
unsigned int run_size, Compare *cmp) {
AMI_err err;
- off_t new_run_size;
+ off_t new_run_size = 0;
//read next run from input stream
err = instream->read_array(data, run_size, &new_run_size);
@@ -256,7 +256,7 @@
delete str;
}
- };
+ }
SDEBUG MM_manager.print();
//release the run memory!
delete [] data;
@@ -265,7 +265,7 @@
SDEBUG MM_manager.print();
return runList;
-};
+}
Modified: grass/trunk/include/iostream/ami_stream.h
===================================================================
--- grass/trunk/include/iostream/ami_stream.h 2019-03-09 20:19:25 UTC (rev 74217)
+++ grass/trunk/include/iostream/ami_stream.h 2019-03-09 20:27:08 UTC (rev 74218)
@@ -315,7 +315,7 @@
//size_t usage;
//main_memory_usage(&usage, MM_STREAM_USAGE_CURRENT);
//MM_manager.register_allocation(usage);
-};
+}
@@ -378,7 +378,7 @@
//*sub_stream = (AMI_base_stream < T > *)substr;
*sub_stream = substr;
return AMI_ERROR_NO_ERROR;
-};
+}
@@ -417,8 +417,8 @@
return (st_size / sizeof(T));
#else
- struct stat buf;
- if (stat(path, &buf) == -1) {
+ struct stat statbuf;
+ if (stat(path, &statbuf) == -1) {
perror("AMI_STREAM::stream_len(): fstat failed ");
DEBUG_ASSERT assert(0);
exit(1);
@@ -426,11 +426,11 @@
//debug stream_len:
DEBUG_STREAM_LEN fprintf(stderr, "%s: length = %lld sizeof(T)=%lud\n",
- path, (long long int)buf.st_size, sizeof(T));
+ path, (long long int)statbuf.st_size, sizeof(T));
- return (buf.st_size / sizeof(T));
+ return (statbuf.st_size / sizeof(T));
#endif
-};
+}
@@ -443,7 +443,7 @@
strcpy(*stream_name, path);
return AMI_ERROR_NO_ERROR;
-};
+}
// Return the path name of this stream.
template<class T>
@@ -450,7 +450,7 @@
const char *
AMI_STREAM<T>::name() const {
return path;
-};
+}
@@ -508,7 +508,7 @@
break;
}
return AMI_ERROR_NO_ERROR;
-};
+}
@@ -534,7 +534,7 @@
//size_t usage;
//main_memory_usage(&usage, MM_STREAM_USAGE_CURRENT);
//MM_manager.register_deallocation(usage);
- };
+ }
@@ -563,7 +563,7 @@
*elt = &read_tmp;
return AMI_ERROR_NO_ERROR;
}
-};
+}
@@ -596,7 +596,7 @@
if(lenp) *lenp = nobj;
return AMI_ERROR_NO_ERROR;
}
-};
+}
@@ -623,7 +623,7 @@
return AMI_ERROR_NO_ERROR;
}
-};
+}
/**********************************************************************/
@@ -649,7 +649,7 @@
}
return AMI_ERROR_NO_ERROR;
}
-};
+}
/**********************************************************************/
@@ -656,7 +656,7 @@
template<class T>
void AMI_STREAM<T>::persist(persistence p) {
per = p;
-};
+}
@@ -669,16 +669,16 @@
// if you are careful.
template<class T>
char *AMI_STREAM<T>::sprint() {
- static char buf[BUFSIZ];
- sprintf(buf, "[AMI_STREAM %s %ld]", path, (long)stream_len());
- return buf;
-};
+ static char desc[BUFSIZ];
+ sprintf(desc, "[AMI_STREAM %s %ld]", path, (long)stream_len());
+ return desc;
+}
/**********************************************************************/
template<class T>
int AMI_STREAM<T>::eof() {
return eof_reached;
-};
+}
#endif // _AMI_STREAM_H
Modified: grass/trunk/include/iostream/embuffer.h
===================================================================
--- grass/trunk/include/iostream/embuffer.h 2019-03-09 20:19:25 UTC (rev 74217)
+++ grass/trunk/include/iostream/embuffer.h 2019-03-09 20:27:08 UTC (rev 74218)
@@ -487,12 +487,12 @@
//initialize the <arity> streams to NULL, deleted[], streamsize[]
//and name[]
- for (unsigned int i=0; i< arity; i++) {
- data[i] = NULL;
- deleted[i] = 0;
- streamsize[i] = 0;
+ for (unsigned int ui=0; ui< arity; ui++) {
+ data[ui] = NULL;
+ deleted[ui] = 0;
+ streamsize[ui] = 0;
#ifdef SAVE_MEMORY
- name[i] = NULL;
+ name[ui] = NULL;
#endif
}
//set index
Modified: grass/trunk/include/iostream/empq_adaptive_impl.h
===================================================================
--- grass/trunk/include/iostream/empq_adaptive_impl.h 2019-03-09 20:19:25 UTC (rev 74217)
+++ grass/trunk/include/iostream/empq_adaptive_impl.h 2019-03-09 20:27:08 UTC (rev 74218)
@@ -75,7 +75,7 @@
<< ( (float)inMem/ (1<< 20)) << "MB" << endl;
initPQ(inMem);
-};
+}
//------------------------------------------------------------
@@ -97,7 +97,7 @@
initPQ(mm_avail);
-};
+}
//------------------------------------------------------------
@@ -160,7 +160,7 @@
im = new MinMaxHeap<T>(pqsize);
assert(im);
em = NULL;
-};
+}
template<class T, class Key>
@@ -177,7 +177,7 @@
delete em;
break;
}
-};
+}
@@ -200,7 +200,7 @@
break;
}
return m;
-};
+}
@@ -225,7 +225,7 @@
break;
}
return v;
-};
+}
//return true if full
@@ -273,7 +273,7 @@
break;
}
return v;
-};
+}
/* switch over to using an external priority queue */
template<class T, class Key>
@@ -332,7 +332,7 @@
break;
}
return v;
-};
+}
//return the nb of elements in the structure
template<class T, class Key>
@@ -384,7 +384,7 @@
break;
}
return v;
-};
+}
@@ -418,7 +418,7 @@
break;
}
return v;
-};
+}
template<class T, class Key>
void
@@ -507,6 +507,6 @@
#ifndef NDEBUG
assert(sizeCheck == size());
#endif
-};
+}
#endif
Modified: grass/trunk/include/iostream/empq_impl.h
===================================================================
--- grass/trunk/include/iostream/empq_impl.h 2019-03-09 20:19:25 UTC (rev 74217)
+++ grass/trunk/include/iostream/empq_impl.h 2019-03-09 20:27:08 UTC (rev 74218)
@@ -1009,7 +1009,7 @@
}
if (!pq->empty()) {
T pqmax;
- bool ok;
+
ok = pq->max(pqmax);
assert(ok);
// cout << "insert " << x << " max: " << pqmax << "\n";
Modified: grass/trunk/include/iostream/mem_stream.h
===================================================================
--- grass/trunk/include/iostream/mem_stream.h 2019-03-09 20:19:25 UTC (rev 74217)
+++ grass/trunk/include/iostream/mem_stream.h 2019-03-09 20:27:08 UTC (rev 74218)
@@ -83,7 +83,7 @@
curr = datap;
len = lenv;
-};
+}
/**********************************************************************/
@@ -93,7 +93,7 @@
return len;
-};
+}
@@ -108,7 +108,7 @@
strcpy(*stream_name, path);
return AMI_ERROR_NO_ERROR;
-};
+}
/**********************************************************************/
@@ -128,7 +128,7 @@
/**********************************************************************/
template<class T>
MEM_STREAM<T>::~MEM_STREAM(void) {
-};
+}
@@ -144,7 +144,7 @@
*elt = curr;
curr++;
return AMI_ERROR_NO_ERROR;
-};
+}
@@ -162,7 +162,7 @@
*curr = elt;
curr++;
return AMI_ERROR_NO_ERROR;
-};
+}
/**********************************************************************/
@@ -177,6 +177,6 @@
static char buf[BUFSIZ];
sprintf(buf, "[MEM_STREAM %d]", stream_len());
return buf;
-};
+}
#endif // _MEM_STREAM_H
More information about the grass-commit
mailing list