浏览代码

iostream: init var, fix assert()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56932 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 年之前
父节点
当前提交
7ab4ebb68a
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      include/iostream/empq_adaptive_impl.h

+ 3 - 2
include/iostream/empq_adaptive_impl.h

@@ -468,8 +468,8 @@ EMPQueueAdaptive<T,Key>::makeExternal() {
   
   //create an AMI_stream and write in it biggest half elts of im;
   AMI_STREAM<T> *amis0 = new AMI_STREAM<T>();
-  AMI_STREAM<T> *amis1;
-  assert(amis0 && amis1);
+  AMI_STREAM<T> *amis1 = NULL;
+  assert(amis0);
   unsigned long pqsize = im->size();
   //assert(im->size() == im->get_maxsize());
   T x;
@@ -490,6 +490,7 @@ EMPQueueAdaptive<T,Key>::makeExternal() {
   //sort the stream
   baseCmpType<T> fun;
   AMI_sort(amis0, &amis1, &fun); //XXX laura: replaced this to use a cmp obj
+  assert(amis1);
   delete amis0;
   EMPQAD_DEBUG { cout << "sorted the stream\n"; cout.flush(); }