INTEGRATION: CWS rc2regression01 (1.94.6); FILE MERGED 2003/07/04 11:17:50 hdu 1.94.6.1: #110607# avoid direct FT_*_Size calls

--- vcl/source/glyphs/gcach_ftyp.cxx
+++ vcl/source/glyphs/gcach_ftyp.cxx
@@ -2,8 +2,8 @@
  *
  *  $RCSfile: gcach_ftyp.cxx,v $
  *
- *  $Revision: 1.96 $
- *  last change: $Author: vg $ $Date: 2003-07-02 14:31:59 $
+ *  $Revision: 1.97 $
+ *  last change: $Author: vg $ $Date: 2003-07-04 12:51:04 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -97,9 +97,8 @@
 // TODO: move file mapping stuff to OSL
 #if defined(UNX)
     #if !defined(MACOSX) && !defined(HPUX)
+        // PORTERS: dlfcn is used for code dependend on FT version
         #include <dlfcn.h>
-    #else
-        // PORTERS: dlfcn is used below to determine FT version
     #endif
     #include <unistd.h>
     #include <fcntl.h>
@@ -121,7 +120,13 @@
 // -----------------------------------------------------------------------

 static FT_Library aLibFT = 0;
+
+// #110607# enable linking with old FT versions
 static int nFTVERSION = 0;
+static FT_Error (*pFTNewSize)(FT_Face,FT_Size*);
+static FT_Error (*pFTActivateSize)(FT_Size);
+static FT_Error (*pFTDoneSize)(FT_Size);
+static bool bEnableSizeFT = false;

 struct EqStr{ bool operator()(const char* a, const char* b) const { return !strcmp(a,b); } };
 typedef ::std::hash_map<const char*,FtFontFile*,::std::hash<const char*>, EqStr> FontFileList;
@@ -187,15 +192,15 @@
             mmap( NULL, mnFileSize, PROT_READ, MAP_SHARED, nFile, 0 );
         close( nFile );
 #elif defined(WIN32)
-        void* pFileDesc = CreateFile( pFileName, GENERIC_READ, FILE_SHARE_READ,
+        void* pFileDesc = ::CreateFile( pFileName, GENERIC_READ, FILE_SHARE_READ,
                         NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 );
         if( pFileDesc == INVALID_HANDLE_VALUE)
             return false;

-        mnFileSize = GetFileSize( pFileDesc, NULL );
+        mnFileSize = ::GetFileSize( pFileDesc, NULL );
         HANDLE aHandle = ::CreateFileMapping( pFileDesc, NULL, PAGE_READONLY, 0, mnFileSize, "TTF" );
         mpFileMap = (const unsigned char*)::MapViewOfFile( aHandle, FILE_MAP_READ, 0, 0, mnFileSize );
-        CloseHandle( pFileDesc );
+        ::CloseHandle( pFileDesc );
 #else
         FILE* pFile = fopen( pFileName, "rb" );
         if( !pFile )
@@ -295,8 +300,11 @@

 FT_FaceRec_* FtFontInfo::GetFaceFT()
 {
-    if( !maFaceFT && mpFontFile->Map() )
-    {
+    // get faceFT once/multiple depending on SizeFT availability
+    if( (mnRefCount++ <= 0) || !bEnableSizeFT )
+    {
+        if( !mpFontFile->Map() )
+            return NULL;
         FT_Error rc = FT_New_Memory_Face( aLibFT,
             (FT_Byte*)mpFontFile->GetBuffer(),
             mpFontFile->GetFileSize(), mnFaceNum, &maFaceFT );
@@ -304,17 +312,17 @@
             maFaceFT = NULL;
     }

-    ++mnRefCount;
     return maFaceFT;
 }

 // -----------------------------------------------------------------------

-void FtFontInfo::ReleaseFaceFT()
-{
-    if( --mnRefCount <= 0 )
-    {
-        FT_Done_Face( maFaceFT );
+void FtFontInfo::ReleaseFaceFT( FT_FaceRec_* pFaceFT )
+{
+    // release last/each depending on SizeFT availability
+    if( (--mnRefCount <= 0) || !bEnableSizeFT )
+    {
+        FT_Done_Face( pFaceFT );
         maFaceFT = NULL;
         mpFontFile->Unmap();
     }
@@ -371,28 +379,35 @@
 {
     FT_Error rcFT = FT_Init_FreeType( &aLibFT );

-#ifdef RTLD_DEFAULT
+#ifdef RTLD_DEFAULT // true if a good dlfcn.h header was included
     // Get version of freetype library to enable workarounds.
     // Freetype <= 2.0.9 does not have FT_Library_Version().
     // Using dl_sym() instead of osl_getSymbol() because latter
-    // doesn't work for oslModule=NULL
-    void (*pft_library_version)(FT_Library library,
+    // isn't designed to work with oslModule=NULL
+    void (*pFTLibraryVersion)(FT_Library library,
         FT_Int *amajor, FT_Int *aminor, FT_Int *apatch);
-    pft_library_version = (void (*)(FT_Library library,
-        FT_Int *amajor, FT_Int *aminor, FT_Int *apatch)) dlsym (RTLD_DEFAULT, "FT_Library_Version");
-
-    if (pft_library_version != NULL)
-    {
-        // XXX disable embedded bitmaps for Freetype-2.1.3 unless explicitly requested
-        // below because it crashes StarOffice on RH9
-        FT_Int nMajor = 0, nMinor = 0, nPatch = 0;
-        pft_library_version( aLibFT, &nMajor, &nMinor, &nPatch );
-        nFTVERSION = nMajor * 1000 + nMinor * 100 + nPatch;
-        if( nFTVERSION == 2103 )
-            nPrioEmbedded = 0;
-    }
+    pFTLibraryVersion = (void (*)(FT_Library library,
+        FT_Int *amajor, FT_Int *aminor, FT_Int *apatch)) dlsym( RTLD_DEFAULT, "FT_Library_Version" );
+
+    pFTNewSize      = (FT_Error(*)(FT_Face,FT_Size*)) dlsym( RTLD_DEFAULT, "FT_New_Size" );
+    pFTActivateSize = (FT_Error(*)(FT_Size)) dlsym( RTLD_DEFAULT, "FT_Activate_Size" );
+    pFTDoneSize     = (FT_Error(*)(FT_Size)) dlsym( RTLD_DEFAULT, "FT_Done_Size" );
+
+    bEnableSizeFT = (pFTNewSize!=NULL) && (pFTActivateSize!=NULL) && (pFTDoneSize!=NULL);
+
+    FT_Int nMajor = 0, nMinor = 0, nPatch = 0;
+    if( pFTLibraryVersion )
+        pFTLibraryVersion( aLibFT, &nMajor, &nMinor, &nPatch );
+    nFTVERSION = nMajor * 1000 + nMinor * 100 + nPatch;
+
+    // disable embedded bitmaps for Freetype-2.1.3 unless explicitly
+    // requested by env var below because it crashes StarOffice on RH9
+    // TODO: investigate
+    if( nFTVERSION == 2103 )
+        nPrioEmbedded = 0;
+
 #else // RTLD_DEFAULT
-    // assume systems without dlsym use supplied library
+    // assume systems where dlsym is not possible use supplied library
     nFTVERSION = FTVERSION;
 #endif

@@ -574,15 +589,15 @@
     maRecodeConverter( NULL ),
     mpLayoutEngine( NULL )
 {
-    maFaceFT = pFI->GetFaceFT();
-    if( !maFaceFT )
-        return;
-
 #ifdef HDU_DEBUG
     fprintf( stderr, "FTSF::FTSF(\"%s\", h=%d, w=%d, cs=%d)\n",
         pFI->GetFontFileName()->getStr(), rFSD.mnHeight, rFSD.mnWidth,
         pFI->GetFontData().meCharSet );
 #endif
+
+    maFaceFT = pFI->GetFaceFT();
+    if( !maFaceFT )
+        return;

     FT_Encoding eEncoding = ft_encoding_unicode;
     if( mpFontInfo->GetFontData().meCharSet == RTL_TEXTENCODING_SYMBOL )
@@ -654,8 +669,11 @@
             maRecodeConverter = rtl_createUnicodeToTextConverter( eRecodeFrom );
     }

-    rc = FT_New_Size( maFaceFT, &maSizeFT );
-    rc = FT_Activate_Size( maSizeFT );
+    if( bEnableSizeFT )
+    {
+        pFTNewSize( maFaceFT, &maSizeFT );
+        pFTActivateSize( maSizeFT );
+    }

     mnWidth = rFSD.mnWidth;
     if( !mnWidth )
@@ -699,9 +717,9 @@
         rtl_destroyUnicodeToTextConverter( maRecodeConverter );

     if( maSizeFT )
-        FT_Done_Size( maSizeFT );
-
-    mpFontInfo->ReleaseFaceFT();
+        pFTDoneSize( maSizeFT );
+
+    mpFontInfo->ReleaseFaceFT( maFaceFT );
 }

  // -----------------------------------------------------------------------
@@ -715,7 +733,8 @@

 void FreetypeServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
 {
-    FT_Activate_Size( maSizeFT );
+    if( maSizeFT )
+        pFTActivateSize( maSizeFT );

     rFactor = 0x100;

@@ -979,7 +998,8 @@

 void FreetypeServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const
 {
-    FT_Activate_Size( maSizeFT );
+    if( maSizeFT )
+        pFTActivateSize( maSizeFT );

     int nGlyphFlags;
     SplitGlyphFlags( *this, nGlyphIndex, nGlyphFlags );
@@ -1058,7 +1078,8 @@

 bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap ) const
 {
-    FT_Activate_Size( maSizeFT );
+    if( maSizeFT )
+        pFTActivateSize( maSizeFT );

     int nGlyphFlags;
     SplitGlyphFlags( *this, nGlyphIndex, nGlyphFlags );
@@ -1152,7 +1173,8 @@

 bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap ) const
 {
-    FT_Activate_Size( maSizeFT );
+    if( maSizeFT )
+        pFTActivateSize( maSizeFT );

     int nGlyphFlags;
     SplitGlyphFlags( *this, nGlyphIndex, nGlyphFlags );
@@ -1382,7 +1404,8 @@

 int FreetypeServerFont::GetGlyphKernValue( int nGlyphLeft, int nGlyphRight ) const
 {
-    FT_Activate_Size( maSizeFT );
+    if( maSizeFT )
+        pFTActivateSize( maSizeFT );

     FT_Vector aKernVal;
     FT_Error rcFT = FT_Get_Kerning( maFaceFT, nGlyphLeft, nGlyphRight,
@@ -1395,7 +1418,8 @@

 ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
 {
-    FT_Activate_Size( maSizeFT );
+    if( maSizeFT )
+        pFTActivateSize( maSizeFT );

     *ppKernPairs = NULL;
     if( !FT_HAS_KERNING( maFaceFT ) || !FT_IS_SFNT( maFaceFT ) )


Revert 239771 "SyncFS v2: Add re-initialization code for tempora..."

Lightly suspected of causing failures on CrOS:

http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%282%29/builds/9981

> SyncFS v2: Add re-initialization code for temporary service failure case
>
> Also run SyncEngineInitializer task at high priority.
>
> BUG=240165
> TEST=manual
>
> Review URL: https://codereview.chromium.org/110113003

TBR=kinuko@chromium.org

Review URL: https://codereview.chromium.org/111893007

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@239923 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/browser/sync_file_system/drive_backend/sync_engine.cc
+++ chrome/browser/sync_file_system/drive_backend/sync_engine.cc
@@ -148,9 +148,6 @@
 void SyncEngine::RegisterOrigin(
     const GURL& origin,
     const SyncStatusCallback& callback) {
-  if (!metadata_database_ && drive_service_->HasRefreshToken())
-    PostInitializeTask();
-
   task_manager_->ScheduleSyncTaskAtPriority(
       scoped_ptr<SyncTask>(new RegisterAppTask(this, origin.host())),
       SyncTaskManager::PRIORITY_HIGH,
@@ -333,9 +330,6 @@
 }

 void SyncEngine::OnNotificationReceived() {
-  if (service_state_ == REMOTE_SERVICE_TEMPORARY_UNAVAILABLE)
-    UpdateServiceState(REMOTE_SERVICE_OK, "Got push notification for Drive.");
-
   should_check_remote_change_ = true;
   MaybeScheduleNextTask();
 }
@@ -443,9 +437,8 @@
                                 task_runner_.get(),
                                 drive_service_.get(),
                                 base_dir_.Append(kDatabaseName));
-  task_manager_->ScheduleSyncTaskAtPriority(
+  task_manager_->ScheduleSyncTask(
       scoped_ptr<SyncTask>(initializer),
-      SyncTaskManager::PRIORITY_HIGH,
       base::Bind(&SyncEngine::DidInitialize, weak_ptr_factory_.GetWeakPtr(),
                  initializer));
 }


Fixed the check for HTTP support in cURL

--- src/posix/net.cpp
+++ src/posix/net.cpp
@@ -73,6 +73,7 @@
             http = true;
             break;
         }
+        i++;
     }

     if(!http || !(data->features & CURL_VERSION_SSL))


Removed default glyph colour_bar. Tracker item 2376, https://tracker.physiomeproject.org/show_bug.cgi?id=2376

--- source/graphics/glyph.cpp
+++ source/graphics/glyph.cpp
@@ -1043,88 +1043,6 @@
 	return (glyph);
 } /* make_glyph_axes */

-struct GT_object *make_glyph_colour_bar(const char *name, struct Graphics_font *font)
-{
-	char *graphics_object_name,*number_format;
-	float bar_length,bar_radius,extend_length,tick_length;
-	int number_of_components,return_code,tick_divisions;
-	struct Graphical_material *label_material,*material;
-	struct GT_object *graphics_object = NULL;
-	struct Spectrum *spectrum;
-	Triple bar_axis,bar_centre,side_axis;
-	struct Colour colour;
-
-	ENTER(make_glyph_colour_bar);
-	if (name)
-	{
-		/* initialise defaults */
-		graphics_object_name = duplicate_string(name);
-		number_format = duplicate_string("%+.4e");
-		/* must access it now, because we deaccess it later */
-		label_material = CREATE(Graphical_material)("red");
-		colour.red = 1;
-		colour.green = 0;
-		colour.blue = 0;
-		Graphical_material_set_diffuse(label_material, &colour);
-		material = CREATE(Graphical_material)("green");
-		colour.red = 0;
-		colour.green = 1;
-		colour.blue = 0;
-		Graphical_material_set_diffuse(material, &colour);
-		spectrum=CREATE(Spectrum)("spectrum_modify_temp");
-		Spectrum_set_simple_type(spectrum,BLUE_TO_RED_SPECTRUM);
-		Spectrum_set_minimum_and_maximum(spectrum,0,1);
-		number_of_components=3;
-		bar_centre[0]=0.0;
-		bar_centre[1]=0.0;
-		bar_centre[2]=0.0;
-		bar_axis[0]=0.0;
-		bar_axis[1]=1.0;
-		bar_axis[2]=0.0;
-		side_axis[0]=1.0;
-		side_axis[1]=0.0;
-		side_axis[2]=0.0;
-		bar_length=1.6;
-		extend_length=0.06;
-		bar_radius=0.06;
-		tick_length=0.04;
-		tick_divisions=10;
-
-		if (!create_Spectrum_colour_bar(&graphics_object,
-				graphics_object_name,spectrum,/*component_number*/0,
-				bar_centre,bar_axis,side_axis,
-				bar_length,bar_radius,extend_length,tick_divisions,tick_length,
-				number_format,material,label_material, font))
-		{
-			display_message(ERROR_MESSAGE,
-				"gfx_create_colour_bar.  Could not create colour bar");
-			return_code=0;
-		}
-		DEACCESS(Spectrum)(&spectrum);
-		if (number_format)
-		{
-			DEALLOCATE(number_format);
-		}
-		if (graphics_object_name)
-		{
-			DEALLOCATE(graphics_object_name);
-		}
-
-		if (!graphics_object)
-		{
-			display_message(ERROR_MESSAGE,"make_glyph_colour_bar.  Error creating glyph");
-		}
-	}
-	else
-	{
-		display_message(ERROR_MESSAGE,"make_glyph_axes.  Invalid argument(s)");
-		graphics_object=(struct GT_object *)NULL;
-	}
-	LEAVE;
-
-	return (graphics_object);
-} /* make_glyph_colour_bar */
-
 struct GT_object *make_glyph_cone(const char *name,int number_of_segments_around)
 /*******************************************************************************
 LAST MODIFIED : 19 October 1998
@@ -2192,10 +2110,6 @@
 		{
 			ADD_OBJECT_TO_LIST(GT_object)(glyph,glyph_list);
 		}
-		if (glyph=make_glyph_colour_bar("colour_bar",font))
-		{
-			ADD_OBJECT_TO_LIST(GT_object)(glyph,glyph_list);
-		}
 		if (glyph=make_glyph_cone("cone",12))
 		{
 			ADD_OBJECT_TO_LIST(GT_object)(glyph,glyph_list);


add missing variable initialization (Maarten and valgrind).

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@5777 27541ba8-7e3a-0410-8455-c3a389f83636


sim: add validation to make sure there is memory where we're loading the kernel

--- src/sim/system.cc
+++ src/sim/system.cc
@@ -266,6 +266,13 @@
          * Load the kernel code into memory
          */
         if (params()->kernel != "")  {
+            // Validate kernel mapping before loading binary
+            if (!(isMemAddr(kernelStart & loadAddrMask) &&
+                            isMemAddr(kernelEnd & loadAddrMask))) {
+                fatal("Kernel is mapped to invalid location (not memory). "
+                      "kernelStart 0x(%x) - kernelEnd 0x(%x)\n", kernelStart,
+                      kernelEnd);
+            }
             // Load program sections into memory
             kernel->loadSections(physProxy, loadAddrMask);


fix compilation error due to missng netinet/in.h include.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@16417 27541ba8-7e3a-0410-8455-c3a389f83636


Kraken : Lint de raptor

Kraken : Lint de raptor

--- source/routing/raptor.cpp
+++ source/routing/raptor.cpp
@@ -52,12 +52,9 @@
     auto &current_boarding_types = boarding_types[count];
     for(auto stop_point_idx = marked_sp.find_first(); stop_point_idx != marked_sp.npos;
         stop_point_idx = marked_sp.find_next(stop_point_idx)) {
-
-
         //On cherche le meilleur jpp du stop point
         const type::StopPoint* stop_point = data.pt_data.stop_points[stop_point_idx];
         if(stop_point->accessible(required_properties)) {
-
             DateTime best_arrival = v.worst_datetime();
             type::idx_t best_jpp = type::invalid_idx;

@@ -90,20 +87,12 @@
                        }
                     }
                 }
-
-
-
                 //On va maintenant chercher toutes les connexions et on marque tous les journey_pattern_points concernés
-
                 //On récupère l'index dans les footpath
                 const pair_int & index = (v.clockwise()) ? data.dataRaptor.footpath_index_forward[stop_point_idx] :
                                                          data.dataRaptor.footpath_index_backward[stop_point_idx];
-
-                int prec_duration = -1;
+                //int prec_duration = -1;
                 DateTime next = v.worst_datetime(),
-                               previous = labels[count][best_jpp];
-
-
                          previous = current_labels[best_jpp];
                 it += index.first - last;
                 const auto end = it + index.second;
@@ -112,14 +101,10 @@
                     const type::StopPointConnection* spc = *it;
                     const auto destination = spc->destination;
                     next = v.combine(previous, spc->duration); // ludo
-                    if(!destination->accessible(required_properties)) continue; //{
+                    if(destination->accessible(required_properties)) {
                         for(auto destination_jpp : destination->journey_pattern_point_list) {
                             type::idx_t destination_jpp_idx = destination_jpp->idx;
                             if(best_jpp != destination_jpp_idx) {
-                                /*if(spc->duration != prec_duration) {
-                                    next = v.combine(previous, spc->duration);
-                                    prec_duration = spc->duration;
-                                }*/
                                 if(v.comp(next, best_labels[destination_jpp_idx]) || next == best_labels[destination_jpp_idx]) {
                                     best_labels[destination_jpp_idx] = next;
                                     current_labels[destination_jpp_idx] = next;
@@ -133,11 +118,10 @@
                                 }
                             }
                         }
-                    //}
+                    }
                 }
                 last = index.first + index.second;
             }
-
         }
     }
 }
@@ -490,7 +474,6 @@
                             const type::StopTime* st = *it_st;
                             workingDt = tmp_dt;
                             BOOST_ASSERT(visitor.comp(labels_temp, workingDt) || labels_temp == workingDt);
-                            BOOST_ASSERT(tmp_dt >= 0);
                             l_zone = st->local_traffic_zone;
                         }
                     }


Changed the algorythm for finding precisionModel type (current way did
not work): now if you specify a scale precisionModel will be FIXED,
otherwise it will be FLOATING.

git-svn-id: 6c2b1bd10c324c49ea9d9e6e31006a80e70507cb@367 5242fede-7e19-0410-aef8-94bd7d2200fb

--- source/test/XMLTester.cpp
+++ source/test/XMLTester.cpp
@@ -13,6 +13,11 @@
  *
  **********************************************************************
  * $Log$
+ * Revision 1.39  2004/05/14 07:19:59  strk
+ * Changed the algorythm for finding precisionModel type (current way did
+ * not work): now if you specify a scale precisionModel will be FIXED,
+ * otherwise it will be FLOATING.
+ *
  * Revision 1.38  2004/05/07 13:23:51  strk
  * Memory leaks fixed.
  *
@@ -127,14 +132,16 @@
 	xml.ResetPos();
 	xml.FindElem("run");
 	xml.FindChildElem("precisionModel");
-	precisionModel=xml.GetChildAttrib("type");
-
-	if (precisionModel=="FLOATING") {
+	/* This does not seem to work... */
+	//precisionModel=xml.GetChildAttrib("type");
+	string scaleStr=xml.GetChildAttrib("scale");
+
+	if ( scaleStr == "" ) {
 		pm=new PrecisionModel();
-		cout << "Precision Model: " << precisionModel << endl;
+		cout << "Precision Model: FLOATING" << endl;
 	} else {
 		char* stopstring;
-		string scaleStr=xml.GetChildAttrib("scale");
+		//string scaleStr=xml.GetChildAttrib("scale");
 		string offsetXStr=xml.GetChildAttrib("offsetx");
 		string offsetYStr=xml.GetChildAttrib("offsety");

@@ -142,9 +149,9 @@
 		double offsetX=strtod(offsetXStr.c_str(),&stopstring);
 		double offsetY=strtod(offsetYStr.c_str(),&stopstring);
 		pm=new PrecisionModel(scale,offsetX,offsetY);
-		cout << "Precision Model: FIXED" << endl;
+		cout << "Precision Model: FIXED (scale: "<<scale<<", offsetX: "<<offsetX<<", offsetY: "<<offsetY<<")" << endl;
 	}
-	r=new WKTReader(new GeometryFactory(pm,10));
+	r=new WKTReader(new GeometryFactory(pm));
 	w=new WKTWriter();
 	gA=NULL;
 	gB=NULL;


disable reuse port test=develop (#16704)

--- paddle/fluid/imperative/nccl_context.cc
+++ paddle/fluid/imperative/nccl_context.cc
@@ -33,8 +33,7 @@
   // creating socket fd
   if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0)
     PADDLE_THROW("create server fd failed");
-  if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT, &opt,
-                 sizeof(opt)))
+  if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)))
     PADDLE_THROW("set socket opt failed");

   address.sin_family = AF_INET;


Update key_value.cpp

Update key_value.cpp

--- examples/key_value.cpp
+++ examples/key_value.cpp
@@ -7,9 +7,9 @@
  database.
  To perform this we create schema with table `key_value` and two columns: key:string and value:string. There is no
  primary key so we are unable to use CRUD functions like `get`, `get_no_throw`, `remove`, `update`. And there is no need to use
- these functions actually. We use non-CRUD functions `remove_all`, `insert` (it is non-CRUSH cause it doesn't require a table to have a
+ these functions actually. We use non-CRUD functions `remove_all`, `insert` (it is non-CRUD cause it doesn't require a table to have a
  primary key column) and `get_all`. `setValue` function takes two string arguments: key and value. It creates a KeyValue
- object (KeyValue is a class mapped to storage) with arguments and performs a transaction. Within this transaction
+ object (KeyValue is a class mapped to the storage) with arguments and performs a transaction. Within this transaction
  first we call `REMOVE FROM key_value WHERE key = '%key%'` and next `INSERT INTO key_value values (%key%, %value%)`.
  After this there is a row in the `key_value` table with key and value passed into `setValue` function.
  `getValue` performs `get_all` with specific condition: `SELECT * FROM key_value WHERE key = '%key%'` and returns a front value if result


phosphor-rsyslog-conf: react to hostname change

The rsyslog client caches the hostname when it starts up (hostname is
included in logs that are streamed out). If someone changes hostname via
REST API for example, the same won't reflect in rsyslog logs at the
server.

Listen to the hostname changed D-Bus signal from systemd, and restart
rsyslogd when this happens. This ensures logs are streamed out with the
updated hostname.

Change-Id: Ied2b401e621314ef7c25e97dc93f86a429fb4077
Signed-off-by: Deepak Kodihalli <54105a30055f1e07853b8ee7a2f0d75d22ed98c1@in.ibm.com>

--- phosphor-rsyslog-config/server-conf.hpp
+++ phosphor-rsyslog-config/server-conf.hpp
@@ -14,6 +14,7 @@
 using namespace phosphor::logging;
 using NetworkClient = sdbusplus::xyz::openbmc_project::Network::server::Client;
 using Iface = sdbusplus::server::object::object<NetworkClient>;
+namespace sdbusRule = sdbusplus::bus::match::rules;

 /** @class Server
  *  @brief Configuration for rsyslog server
@@ -40,7 +41,13 @@
                const std::string& path,
                const char* filePath) :
             Iface(bus, path.c_str(), true),
-            configFilePath(filePath)
+            configFilePath(filePath),
+            hostnameChange(
+                bus,
+                sdbusRule::propertiesChanged(
+                    "/org/freedesktop/hostname1", "org.freedesktop.hostname1"),
+                std::bind(std::mem_fn(&Server::hostnameChanged),
+                    this, std::placeholders::_1))
         {
             try
             {
@@ -97,6 +104,16 @@
         void restore(const char* filePath);

         std::string configFilePath{};
+
+        /** @brief React to hostname change
+         *  @param[in] msg - sdbusplus message
+         */
+        void hostnameChanged(sdbusplus::message::message& msg)
+        {
+            restart();
+        }
+
+        sdbusplus::bus::match_t hostnameChange;
 };

 } // namespace rsyslog_config


Ensure that the shouldQuery() signal fires at least once.

--- tests/TestCache.cpp
+++ tests/TestCache.cpp
@@ -58,6 +58,7 @@
     QMdnsEngine::Cache cache;
     cache.addRecord(record);

+    QSignalSpy shouldQuerySpy(&cache, SIGNAL(shouldQuery(Record)));
     QSignalSpy recordExpiredSpy(&cache, SIGNAL(recordExpired(Record)));

     // The record should be in the cache
@@ -69,6 +70,7 @@
     // After entering the event loop, the record should have been purged and
     // the recordExpired() signal emitted
     QVERIFY(!cache.lookupRecord(record.name(), record.type(), record));
+    QVERIFY(shouldQuerySpy.count() > 0);
     QCOMPARE(recordExpiredSpy.count(), 1);
 }


Added test for additional operator overload

--- tests/TestExtra.cpp
+++ tests/TestExtra.cpp
@@ -207,6 +207,32 @@
 	CHECK_LONG("b3", 0, 1, lastFailed);
 	CHECK_LONG("b4", 0, 0, lastFailed);
 }
+
+const char	*testMissingTests6 =
+"int operator-(char[] a, b){ return int(a) - int(b); }\r\n\
+int operator*(char[] a, b){ return int(a) * int(b); }\r\n\
+int operator/(char[] a, b){ return int(a) / int(b); }\r\n\
+int operator%(char[] a, b){ return int(a) % int(b); }\r\n\
+int operator**(char[] a, b){ return int(a) ** int(b); }\r\n\
+int operator<<(char[] a, b){ return int(a) << int(b); }\r\n\
+int operator>>(char[] a, b){ return int(a) >> int(b); }\r\n\
+int operator&(char[] a, b){ return int(a) & int(b); }\r\n\
+int operator|(char[] a, b){ return int(a) | int(b); }\r\n\
+int operator^(char[] a, b){ return int(a) ^ int(b); }\r\n\
+\r\n\
+assert((\"22\" - \"5\") == (22 - 5));\r\n\
+assert((\"22\" * \"5\") == (22 * 5));\r\n\
+assert((\"22\" / \"5\") == (22 / 5));\r\n\
+assert((\"22\" % \"5\") == (22 % 5));\r\n\
+assert((\"22\" ** \"5\") == (22 ** 5));\r\n\
+assert((\"22\" << \"5\") == (22 << 5));\r\n\
+assert((\"22\" >> \"1\") == (22 >> 1));\r\n\
+assert((\"22\" & \"5\") == (22 & 5));\r\n\
+assert((\"22\" | \"5\") == (22 | 5));\r\n\
+assert((\"22\" ^ \"5\") == (22 ^ 5));\r\n\
+\r\n\
+return 1;";
+TEST_RESULT("Group of tests 6", testMissingTests6, "1");

 const char	*testStaticIf1 =
 "int a = 4;\r\n\


unified entities per second mesaurement

unified entities per second mesaurement

--- tests/benchmark.cpp
+++ tests/benchmark.cpp
@@ -36,8 +36,7 @@
     }

-    state.SetBytesProcessed(int64_t(state.iterations()) *
-        int64_t(state.range(0))*sizeof(int));
+    state.SetItemsProcessed(state.iterations() * int64_t(state.range(0)));
 }

 template< class IterT, class ContainerT >
@@ -114,4 +113,4 @@
 BENCHMARK_TEMPLATE(benchmark_iteration_map, tyti::any_iterator<std::pair<const int, int>>)->Range(MY_RANGE_START, MY_RANGE_END)->Unit(tu)->RangeMultiplier(range_multi);
 BENCHMARK_TEMPLATE(benchmark_iteration_map, tyti::any_iterator_virtual<std::pair<const int,int>>)->Range(MY_RANGE_START, MY_RANGE_END)->Unit(tu)->RangeMultiplier(range_multi);

-BENCHMARK_MAIN();+BENCHMARK_MAIN();


Perforce-side fix for <FRQU-211>

Perforce-side fix for <FRQU-211>

--- vcnc-server/js-extension/src/cnctrq/cnctrqWorkspaceWorker.cc
+++ vcnc-server/js-extension/src/cnctrq/cnctrqWorkspaceWorker.cc
@@ -157,35 +157,33 @@
       Nan::Set(rtn
                , Nan::New("error_description_brief").ToLocalChecked()
                , Nan::New(error_description_brief.c_str()).ToLocalChecked());
-      if (!_errcode) {
-        switch (_operation) {
-        case op_children:
-        {
+      switch (_operation) {
+      case op_children:
+      {
 //          std::cout << "Workspace children\n";
-          string_type arr_ws;
-          _workspace_list.ExportJson(arr_ws, true);
+        string_type arr_ws;
+        _workspace_list.ExportJson(arr_ws, true);
 //          std::cout << "arr_ws: " << arr_ws << "\n";
-          Nan::Set(rtn
-                   , Nan::New("ws_children").ToLocalChecked()
-                   , Nan::New(arr_ws.c_str()).ToLocalChecked());
-        }
+        Nan::Set(rtn
+                 , Nan::New("ws_children").ToLocalChecked()
+                 , Nan::New(arr_ws.c_str()).ToLocalChecked());
+      }
+      break;
+      case op_delete:
+        // intentionally empty
         break;
-        case op_delete:
-          // intentionally empty
-          break;
-        case op_get:
-        {
-          Nan::Set(rtn
-                   , Nan::New("ws").ToLocalChecked()
-                   , Nan::New(_workspace.ExportJson(true).c_str()).ToLocalChecked());
-        }
+      case op_get:
+      {
+        Nan::Set(rtn
+                 , Nan::New("ws").ToLocalChecked()
+                 , Nan::New(_workspace.ExportJson(true).c_str()).ToLocalChecked());
+      }
+      break;
+      case op_set:
         break;
-        case op_set:
-          break;
-        default:
-          std::cerr << "cnctrqWorkspaceWorker: ASSERTION" << std::endl;
-          assert(0);
-        }
+      default:
+        std::cerr << "cnctrqWorkspaceWorker: ASSERTION" << std::endl;
+        assert(0);
       }
       //
       //  Prepare for callback


fix update.boxmc.length() when some of the lengths are zero

--- hoomd/hpmc/UpdaterBoxMC.cc
+++ hoomd/hpmc/UpdaterBoxMC.cc
@@ -499,7 +499,22 @@
     // Volume change

     // Choose a lattice vector if non-isotropic volume changes
-    unsigned int i = rand_select(rng, Ndim - 1);
+    unsigned int nonzero_dim = 0;
+    for (unsigned int i = 0; i < Ndim; ++i)
+        if (m_Length_delta[i] != 0.0)
+            nonzero_dim++;
+
+    unsigned int i = rand_select(rng, nonzero_dim-1);
+    for (unsigned int j = 0; j < Ndim; ++j)
+        if (m_Length_delta[j] == 0.0 && i == j)
+            ++i;
+
+    if (i == Ndim)
+        {
+        // all dimensions have delta==0, just count as accepted and return
+        m_count_total.volume_accept_count++;
+        }
+
     Scalar dL_max(m_Length_delta[i]);

     // Choose a length change


Initializing ROSCostmap with tf buffer.

Initializing ROSCostmap with tf buffer.

--- grid_map_costmap_2d/rostest/costmap_2d_ros/costmap_2d_ros.cpp
+++ grid_map_costmap_2d/rostest/costmap_2d_ros/costmap_2d_ros.cpp
@@ -48,7 +48,7 @@
   privateNodeHandle.setParam(name + "/plugins", std::vector<std::string>());
   privateNodeHandle.setParam(name + "/resolution", 0.5);
   privateNodeHandle.setParam(name + "/robot_radius", 0.03); // clears 1 cell if inside, up to 4 cells on a vertex
-  costmap_ = std::make_shared<ROSCostmap>(name, tfListener_);
+  costmap_ = std::make_shared<ROSCostmap>(name, tfBuffer_);

   for ( unsigned int index = 0; index < costmap_->getCostmap()->getSizeInCellsY(); ++index ) {
     unsigned int dimension = costmap_->getCostmap()->getSizeInCellsX();


Added MurmurHash2A test.

Added MurmurHash2A test.

--- tests/hash_test.cpp
+++ tests/hash_test.cpp
@@ -31,17 +31,18 @@
 {
 	uint32_t crc32;
 	uint32_t adler32;
+	uint32_t murmur2a;
 	const char* input;
 };

 const HashTest s_hashTest[] =
 {
-	{ 0,          1,          ""       },
-	{ 0xe8b7be43, 0x00620062, "a"      },
-	{ 0x9e83486d, 0x012600c4, "ab"     },
-	{ 0xc340daab, 0x06060205, "abvgd"  },
-	{ 0x07642fe2, 0x020a00d6, "1389"   },
-	{ 0x26d75737, 0x04530139, "555333" },
+	{ 0,          1,          0,          ""       },
+	{ 0xe8b7be43, 0x00620062, 0x803888b,  "a"      },
+	{ 0x9e83486d, 0x012600c4, 0x618515af, "ab"     },
+	{ 0xc340daab, 0x06060205, 0x94e3dc4d, "abvgd"  },
+	{ 0x07642fe2, 0x020a00d6, 0xe602fc07, "1389"   },
+	{ 0x26d75737, 0x04530139, 0x58d37863, "555333" },
 };

 TEST_CASE("HashCrc32", "")
@@ -77,3 +78,73 @@
 		REQUIRE(test.adler32 == hash.end() );
 	}
 }
+
+/*-----------------------------------------------------------------------------
+// MurmurHash2A, by Austin Appleby
+//
+// This is a variant of MurmurHash2 modified to use the Merkle-Damgard
+// construction. Bulk speed should be identical to Murmur2, small-key speed
+// will be 10%-20% slower due to the added overhead at the end of the hash.
+//
+// This variant fixes a minor issue where null keys were more likely to
+// collide with each other than expected, and also makes the function
+// more amenable to incremental implementations.
+*/
+
+#define mmix(h,k) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
+
+uint32_t MurmurHash2A ( const void * key, int len, uint32_t seed )
+{
+	const uint32_t m = 0x5bd1e995;
+	const int r = 24;
+	uint32_t l = len;
+
+	const unsigned char * data = (const unsigned char *)key;
+
+	uint32_t h = seed;
+
+	while(len >= 4)
+	{
+		uint32_t k = *(uint32_t*)data;
+
+		mmix(h,k);
+
+		data += 4;
+		len -= 4;
+	}
+
+	uint32_t t = 0;
+
+	switch(len)
+	{
+	case 3: t ^= data[2] << 16;
+	case 2: t ^= data[1] << 8;
+	case 1: t ^= data[0];
+	};
+
+	mmix(h,t);
+	mmix(h,l);
+
+	h ^= h >> 13;
+	h *= m;
+	h ^= h >> 15;
+
+	return h;
+}
+
+TEST_CASE("HashMurmur2A", "")
+{
+	uint32_t seed = 0;
+
+	for (uint32_t ii = 0; ii < BX_COUNTOF(s_hashTest); ++ii)
+	{
+		const HashTest& test = s_hashTest[ii];
+
+		bx::HashMurmur2A hash;
+		hash.begin(seed);
+		hash.add(test.input, bx::strLen(test.input) );
+		REQUIRE(test.murmur2a == hash.end() );
+
+		REQUIRE(test.murmur2a == MurmurHash2A(test.input, bx::strLen(test.input), seed) );
+	}
+}


优化 addToOutput 方法。

优化 addToOutput 方法。

--- DeterminingDNAHealth/main.cc
+++ DeterminingDNAHealth/main.cc
@@ -35,6 +35,7 @@
 // appears when the machine enters this state.
 //vector<int> out[MAXS];
 struct output * * out;
+struct output * * last;
 struct output * mem[MAXM];

 // FAILURE FUNCTION IS IMPLEMENTED USING f[]
@@ -71,36 +72,15 @@

 //void addToOutput(struct output * * l, int value) {
 void addToOutput(int index, int value) {
-    struct output * tmp = getOneOutput();
-    tmp->value = value;
-    if (NULL == out[index]) {
-        out[index] = tmp;
-    }
-    else {
-        if (value < out[index]->value) {
-            tmp->next = out[index];
-            out[index] = tmp;
-        }
-        else {
-            struct output * p = out[index];
-            while (p) {
-                if (NULL == p->next) {
-                    p->next = tmp;
-                    break;
-                }
-                else {
-                    if (value < p->next->value) {
-                        tmp->next = p->next;
-                        p->next = tmp;
-                        break;
-                    }
-                    else {
-                        p = p->next;
-                    }
-                }
-            }
-        }
-    }
+	struct output * tmp = getOneOutput();
+	tmp->value = value;
+	if (NULL == out[index]) {
+		out[index] = tmp;
+	}
+	else {
+		last[index]->next = tmp;
+	}
+	last[index] = tmp;
 }

 void mergeOutput(struct output * * l_a, struct output * * l_b) {
@@ -304,28 +284,26 @@
     // Traverse the text through the nuilt machine to find
     // all occurrences of words in arr[]
     for (int i = 0; i < text.size(); ++i)
-    {
-        currentState = findNextState(currentState, text[i]);
-
-        // Match found, print all matching words of arr[]
-        // using output function.
-        if (out[currentState]) {
-            struct output * p = out[currentState];
-
-            while (p) {
-                if (start > p->value) {
-                }
-                else if (p->value <= end) {
-                    ret += health[p->value];
-                }
-                else {
-                    break;
-                }
-
-                p = p->next;
-            }
-        }
-    }
+	{
+		currentState = findNextState(currentState, text[i]);
+
+		// Match found, print all matching words of arr[]
+		// using output function.
+		struct output * p = out[currentState];
+
+		while (p) {
+			if (start > p->value) {
+			}
+			else if (p->value <= end) {
+				ret += health[p->value];
+			}
+			else {
+				break;
+			}
+
+			p = p->next;
+		}
+	}

     return ret;
 }
@@ -372,6 +350,9 @@
     out = (struct output * *)malloc(maxs * sizeof(struct output *));
     memset(out, 0 , maxs * sizeof(struct output *));

+    last = (struct output * *)malloc(maxs * sizeof(struct output *));
+    memset(last, 0 , maxs * sizeof(struct output *));
+
     vector<int> health(n);
     for(int health_i = 0; health_i < n; health_i++){
 #if DEBUG
@@ -431,6 +412,6 @@
     }

     printf("%lld %lld\n", min, max);
-
+
     return 0;
 }


uwp messagebox added

uwp messagebox added

--- WickedEngine/wiHelper.cpp
+++ WickedEngine/wiHelper.cpp
@@ -38,33 +38,14 @@
 #ifndef WINSTORE_SUPPORT
 		MessageBoxA(hWnd, msg.c_str(), caption.c_str(), 0);
 #else
-		//Windows::UI::Popups::MessageDialog("ASD").ShowAsync();
+		wstring wmsg(msg.begin(), msg.end());
+		wstring wcaption(caption.begin(), caption.end());
+		Windows::UI::Popups::MessageDialog(ref new Platform::String(wmsg.c_str()), ref new Platform::String(wcaption.c_str())).ShowAsync();
 #endif
 	}

 	void screenshot(const string& name)
 	{
-//#ifndef WINSTORE_SUPPORT
-//		CreateDirectoryA("screenshots", 0);
-//		stringstream ss("");
-//		if (name.length() <= 0)
-//			ss << "screenshots/sc_" << getCurrentDateTimeAsString() << ".png";
-//		else
-//			ss << name;
-//		wstringstream wss(L"");
-//		wss << ss.str().c_str();
-//		APIResource res = nullptr;
-//		wiRenderer::renderTargetView->GetResource(&res);
-//		HRESULT h = SaveWICTextureToFile(wiRenderer::immediateContext, res, GUID_ContainerFormatPng, wss.str().c_str());
-//		if (FAILED(h))
-//			wiBackLog::post("Screenshot failed");
-//		else
-//		{
-//			ss << " Saved successfully!";
-//			wiBackLog::post(ss.str().c_str());
-//		}
-//		res->Release();
-//#endif
 		CreateDirectoryA("screenshots", 0);
 		stringstream ss("");
 		if (name.length() <= 0)


Update JSONDataParser.cpp

Update JSONDataParser.cpp

fixed zorder frame bug

--- DragonBones/src/dragonBones/parser/JSONDataParser.cpp
+++ DragonBones/src/dragonBones/parser/JSONDataParser.cpp
@@ -1352,8 +1352,9 @@
                 {
                     unchanged[unchangedIndex++] = originalIndex++;
                 }
-
-                zOrders[originalIndex + zOrderOffset] = originalIndex++;
+
+                unsigned index = originalIndex + zOrderOffset;
+                zOrders[index] = originalIndex++;
             }

             while (originalIndex < slotCount)


[JIT] Remove unnecessary boolean comparison to 0.

PiperOrigin-RevId: 374790738

--- xls/jit/function_builder_visitor.cc
+++ xls/jit/function_builder_visitor.cc
@@ -749,7 +749,7 @@

   std::vector<CompareTerm> terms;

-  while (!unexpanded.empty() > 0) {
+  while (!unexpanded.empty()) {
     ToExpand next = unexpanded.back();
     unexpanded.pop_back();


Ooooops!

Ooooops!

--- tests/multi-dict.cc
+++ tests/multi-dict.cc
@@ -24,7 +24,6 @@
 static void parse_one_sent(const char *sent_str)
 {
 	Parse_Options opts = parse_options_create();
-	dictionary_set_data_dir(DICTIONARY_DIR "/data");
 	// Dictionary dict = dictionary_create_lang("ru");
 	Dictionary dict = dictionary_create_lang("en");
 	if (!dict) {


INTEGRATION: CWS vgbugs07 (1.5.274); FILE MERGED 2007/06/04 13:23:27 vg 1.5.274.1: #i76605# Remove -I .../inc/module hack introduced by hedaburemove01

--- xmloff/source/forms/officeforms.hxx
+++ xmloff/source/forms/officeforms.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: officeforms.hxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.6 $
  *
- *  last change: $Author: rt $ $Date: 2005-09-09 14:14:59 $
+ *  last change: $Author: hr $ $Date: 2007-06-27 15:17:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -40,7 +40,7 @@
 #include "formattributes.hxx"
 #endif
 #ifndef _XMLOFF_XMLICTXT_HXX
-#include "xmlictxt.hxx"
+#include <xmloff/xmlictxt.hxx>
 #endif
 #ifndef XMLOFF_FORMS_LOGGING_HXX
 #include "logging.hxx"


refactored admin and io command submission, extended decode of identify response

--- tests/nvme/nvme.cpp
+++ tests/nvme/nvme.cpp
@@ -44,6 +44,13 @@
     uint32_t cdw13;
     uint32_t cdw14;
     uint32_t cdw15;
+};
+
+struct nvme_completion {
+    int cdw0;
+    int cdw1;
+    int cdw2;
+    int cdw3;
 };

 struct sgl_data_block_descriptor {
@@ -194,6 +201,8 @@
     NvmeRequestProxy device;
     NvmeIndication  indication;
     NvmeTrace       trace;
+    int adminRequestNumber;
+    int ioRequestNumber;
 public:
     DmaBuffer dummy;
     DmaBuffer transferBuffer;
@@ -215,9 +224,11 @@
 	: device(IfcNames_NvmeRequestS2H)
 	, indication(IfcNames_NvmeIndicationH2S)
 	, trace(IfcNames_NvmeTraceH2S)
+	, adminRequestNumber(0)
+	, ioRequestNumber(0)
 	, dummy(4096)
 	, transferBuffer(10*4096)
-	, adminSubmissionQueue(64*64)
+	, adminSubmissionQueue(4096)
 	, adminCompletionQueue(4096)
 	, ioSubmissionQueue(8192)
 	, ioCompletionQueue(8192)
@@ -250,6 +261,9 @@
     int setSearchString ( const uint32_t needleSglId, const uint32_t mpNextSglId, const uint32_t needleLen );
     int startSearch ( const uint32_t searchLen );

+    int adminCommand(const nvme_admin_cmd *cmd, nvme_completion *completion);
+    int ioCommand(const nvme_io_cmd *cmd, nvme_completion *completion);
+
 };

 uint32_t Nvme::readCtl(uint32_t addr)
@@ -340,13 +354,75 @@
     nvme->write32(0x02200000 + 0x41000 + 0x20, byteEnable|(((unsigned long)burstLen)<<8));
 }

+int Nvme::adminCommand(const nvme_admin_cmd *cmd, nvme_completion *completion)
+{
+    nvme_admin_cmd *requests = (nvme_admin_cmd *)adminSubmissionQueue.buffer();
+    int requestNumber        = adminRequestNumber % (4096 / sizeof(nvme_admin_cmd));
+    nvme_admin_cmd *request  = &requests[requestNumber];
+    int *responses           = (int *)adminCompletionQueue.buffer();
+    int responseNumber       = adminRequestNumber % (4096 / 16);
+    int *response            = &responses[responseNumber * 4];
+    adminRequestNumber++;
+
+    fprintf(stderr, "%s:%d requestNumber=%d responseNumber = %d\n", __FUNCTION__, __LINE__, requestNumber, responseNumber);
+
+    *request = *cmd;
+    adminSubmissionQueue.cacheInvalidate(4096, 1);
+    adminCompletionQueue.cacheInvalidate(4096, 0);
+
+    // update submission queue tail
+    write32(0x1000, requestNumber+1);
+    sleep(1);
+
+    for (int i = 0; i < 4; i++) {
+	fprintf(stderr, "    response[%02x]=%08x\n", i*4, response[i]);
+    }
+    int status = response[3];
+    int more = (status >> 30) & 1;
+    int sc = (status >> 17) & 0xff;
+    int sct = (status >> 25) & 0x7;
+    fprintf(stderr, "status=%08x more=%d sc=%x sct=%x\n", status, more, sc, sct);
+    return sc;
+}
+
+int Nvme::ioCommand(const nvme_io_cmd *cmd, nvme_completion *completion)
+{
+    nvme_io_cmd *requests = (nvme_io_cmd *)ioSubmissionQueue.buffer();
+    int requestNumber        = ioRequestNumber % (8192 / sizeof(nvme_io_cmd));
+    nvme_io_cmd *request  = &requests[requestNumber];
+    int *responses           = (int *)ioCompletionQueue.buffer();
+    int responseNumber       = ioRequestNumber % (8192 / 16);
+    int *response            = &responses[responseNumber * 4];
+    ioRequestNumber++;
+
+    fprintf(stderr, "%s:%d requestNumber=%d responseNumber = %d\n", __FUNCTION__, __LINE__, requestNumber, responseNumber);
+
+    *request = *cmd;
+    ioSubmissionQueue.cacheInvalidate(8192, 1);
+    ioCompletionQueue.cacheInvalidate(8192, 0);
+
+    // update submission queue tail
+    write32(0x1000, requestNumber+1);
+    sleep(1);
+
+    for (int i = 0; i < 4; i++) {
+	fprintf(stderr, "    response[%02x]=%08x\n", i*4, response[i]);
+    }
+    int status = response[3];
+    int more = (status >> 30) & 1;
+    int sc = (status >> 17) & 0xff;
+    int sct = (status >> 25) & 0x7;
+    fprintf(stderr, "status=%08x more=%d sc=%x sct=%x\n", status, more, sc, sct);
+    return sc;
+}
+
 void identify(Nvme *nvme)
 {
-    memset(nvme->adminCompletionQueue.buffer(), 0xbf, 4096);
-
     fprintf(stderr, "sizeof(nvmd_id_cmd)=%d\n", sizeof(nvme_admin_cmd));
     // write an identify command
-    nvme_admin_cmd *cmd = (nvme_admin_cmd *)nvme->adminSubmissionQueue.buffer();
+    nvme_completion completion;
+    nvme_admin_cmd buffer;
+    nvme_admin_cmd *cmd = &buffer;
     memset(cmd, 0, 64);
     cmd->opcode = 6; //nvme_identify;
     cmd->cid = 22;
@@ -355,50 +431,44 @@
     cmd->prp2 = (nvme->transferBufferRef << 24) + 4096;
     cmd->cdw10 = 1;

-    nvme->adminSubmissionQueue.cacheInvalidate(4096, 1);
-    nvme->adminCompletionQueue.cacheInvalidate(4096, 0);
-
-    // update submission queue tail
-    nvme->write32(0x1000, 1);
-    //nvme->write32(0x1000, 64);
-    fprintf(stderr, "CTS %08x\n", nvme->read32( 0x1c));
-    fprintf(stderr, "CMDSTATUS: %08x\n", nvme->readCtl((1 << 20) + 0x4));
-    sleep(1);
-    fprintf(stderr, "CTS %08x\n", nvme->read32( 0x1c));
-    fprintf(stderr, "CMDSTATUS: %08x\n", nvme->readCtl((1 << 20) + 0x4));
-    {
-	int *buffer = (int *)nvme->adminCompletionQueue.buffer();
-	for (int i = 0; i < 4; i++) {
-	    fprintf(stderr, "identify-response[%02x]=%08x\n", i*4, buffer[i]);
-	}
-	int status = buffer[3];
-	int more = (status >> 30) & 1;
-	int sc = (status >> 17) & 0xff;
-	int sct = (status >> 25) & 0x7;
-	fprintf(stderr, "status=%08x more=%d sc=%x sct=%x\n", status, more, sc, sct);
-    }
+    nvme->adminCommand(cmd, &completion);
+
     {
 	char *cbuffer = (char *)(nvme->transferBuffer.buffer() + 0);
 	int *buffer = (int *)(nvme->transferBuffer.buffer() + 0);
-	for (int i = 0; i < 16; i++) {
-	    fprintf(stderr, "identity[%02x]=%08x\n", i*4, buffer[i]);
-	}
-	fprintf(stderr, "error log page entries %d\n", cbuffer[262]);
+	char str[128];
+	fprintf(stderr, "PCI vendorid %02x\n", *(unsigned short *)&cbuffer[0]);
+	fprintf(stderr, "PCI deviceid %02x\n", *(unsigned short *)&cbuffer[2]);
+	snprintf(str, 20, "%s", &cbuffer[4]);
+	fprintf(stderr, "serial number '%s'\n", str);
+	snprintf(str, 40, "%s", &cbuffer[24]);
+	fprintf(stderr, "model number  '%s'\n", str);
 	fprintf(stderr, "host buffer preferred size %x\n", *(int *)&cbuffer[272]);
 	fprintf(stderr, "host buffer min size       %x\n", *(int *)&cbuffer[276]);
 	fprintf(stderr, "nvm submission queue entry size %d\n", cbuffer[512]);
 	fprintf(stderr, "nvm completion queue entry size %d\n", cbuffer[513]);
+	fprintf(stderr, "maximum data transfer size: %d\n", cbuffer[77]);
+	fprintf(stderr, "controller id: %d\n", *(unsigned short *)&cbuffer[78]);
+	fprintf(stderr, "OACS: %x\n", *(unsigned short *)&cbuffer[256]);
+	fprintf(stderr, "log page attributes: %x\n", cbuffer[261]);
+	fprintf(stderr, "error log page entries %d\n", cbuffer[262]);
+	fprintf(stderr, "host memory buffer preferred size: %x\n", *(unsigned int *)&cbuffer[272]);
+	fprintf(stderr, "host memory buffer minimum size: %x\n", *(unsigned int *)&cbuffer[272]);
 	fprintf(stderr, "nvm capacity: %08llx %08llx\n", *(long long *)&cbuffer[288], *(long long *)&cbuffer[280]);
-
+	fprintf(stderr, "unallocated capacity: %08llx %08llx\n", *(long long *)&cbuffer[304], *(long long *)&cbuffer[296]);
+	fprintf(stderr, "number of namespaces: %x\n", *(unsigned int *)&cbuffer[516]);
+	fprintf(stderr, "ONCS: %x\n", *(unsigned short *)&cbuffer[520]);
+	fprintf(stderr, "supports SGL: %x\n", *(int *)&cbuffer[536]);
     }
 }

 void allocIOQueues(Nvme *nvme, int entry=0)
 {
-    nvme_admin_cmd *cmd = 0;
+    nvme_completion completion;
+    nvme_admin_cmd buffer;
+    nvme_admin_cmd *cmd = &buffer;

     // create I/O completion queue
-    cmd = (nvme_admin_cmd *)(nvme->adminSubmissionQueue.buffer() + (entry+0)*64);
     memset(cmd, 0, 64);
     cmd->opcode = 5; //create I/O completion queue
     cmd->cid = 17;
@@ -406,9 +476,9 @@
     cmd->prp1 = (nvme->ioCompletionQueueRef << 24) + 0;
     cmd->cdw10 = ((8192 / 16 - 1) << 16) | 1; // size, completion queue 1
     cmd->cdw11 = 1; // physically contiguous
+    nvme->adminCommand(cmd, &completion);

     // create I/O submission queue
-    cmd = (nvme_admin_cmd *)(nvme->adminSubmissionQueue.buffer() + (entry+1)*64);
     memset(cmd, 0, 64);
     cmd->opcode = 1; //create I/O submission queue
     cmd->cid = 18;
@@ -416,97 +486,54 @@
     cmd->prp1 = (nvme->ioSubmissionQueueRef << 24) + 0;
     cmd->cdw10 = ((8192 / 64 - 1) << 16) + 1; // submission queue 1
     cmd->cdw11 = (1 << 16) | 1; // completion queue 1, physically contiguous
-
-
-    nvme->adminSubmissionQueue.cacheInvalidate(4096, 1);
-    nvme->adminCompletionQueue.cacheInvalidate(4096, 0);
-
-    fprintf(stderr, "allocating IO submission queue\n");
-    // update submission queue tail
-    nvme->write32(0x1000, entry+2);
-
-    sleep(1);
+    nvme->adminCommand(cmd, &completion);
+}
+
+void doIO(Nvme *nvme)
+{
+    int startBlock = 34816;
+    int numBlocks = 32; //8177;
+    int blocksPerPage = 4096 / 512;
+    // clear transfer buffer
     {
-	int *buffer = (int *)(nvme->adminCompletionQueue.buffer() + (entry+0)*16);
-	for (int i = 0; i < 4; i++) {
-	    fprintf(stderr, "alloc-completion-queue-response[%02x]=%08x\n", i*4, buffer[i]);
+	int *buffer = (int *)nvme->ioCompletionQueue.buffer();
+	memset(buffer, 0, numBlocks*512);
+    }
+
+    // let's do a read
+    nvme_io_cmd cmd;
+    nvme_completion completion;
+    memset(&cmd, 0, 64);
+    cmd.opcode = 2; // read
+    cmd.cid = 45;
+    cmd.nsid = 1;
+    if (0) {
+	cmd.prp1 = (nvme->transferBufferRef << 24) + 0;
+    } else {
+	cmd.flags = 0x40; // SGL used for this transfer
+	cmd.prp1 = 0x30000000ul; // send data to the FIFO
+	cmd.prp2 = (nvme->transferBufferRef << 24) + 0;
+	uint64_t *prplist = (uint64_t *)nvme->transferBuffer.buffer();
+	for (int i = 0; i < numBlocks/blocksPerPage; i++) {
+	    prplist[i] = (uint64_t)(0x30000000ul + 0x1000*i + 0x1000); // send data to the FIFO
 	}
-	int status = buffer[3];
-	int more = (status >> 30) & 1;
-	int sc = (status >> 17) & 0xff;
-	int sct = (status >> 25) & 0x7;
-	fprintf(stderr, "status=%08x more=%d sc=%x sct=%x\n", status, more, sc, sct);
-    }
-    {
-	int *buffer = (int *)(nvme->adminCompletionQueue.buffer() + (entry+1)*16);
-	for (int i = 0; i < 4; i++) {
-	    fprintf(stderr, "alloc-submission-queue-response[%02x]=%08x\n", i*4, buffer[i]);
-	}
-	int status = buffer[3];
-	int more = (status >> 30) & 1;
-	int sc = (status >> 17) & 0xff;
-	int sct = (status >> 25) & 0x7;
-	fprintf(stderr, "status=%08x more=%d sc=%x sct=%x\n", status, more, sc, sct);
-    }
-
-    if (1) {
-	int startBlock = 34816;
-        int numBlocks = 32; //8177;
-	int blocksPerPage = 4096 / 512;
-	// clear transfer buffer
-	{
-	  int *buffer = (int *)(nvme->ioCompletionQueue.buffer() + (entry+0)*16);
-	  memset(buffer, 0, numBlocks*512);
-	}
-
-	// let's do a read
-	nvme_io_cmd *cmd = (nvme_io_cmd *)(nvme->ioSubmissionQueue.buffer() + (entry+0)*64);
-	memset(cmd, 0, 64);
-	cmd->opcode = 2; // read
-	cmd->cid = 45;
-	cmd->nsid = 1;
-	if (0) {
-	    cmd->prp1 = (nvme->transferBufferRef << 24) + 0;
-	} else {
-	    cmd->flags = 0x40; // SGL used for this transfer
-	    cmd->prp1 = 0x30000000ul; // send data to the FIFO
-	    cmd->prp2 = (nvme->transferBufferRef << 24) + 0;
-	    uint64_t *prplist = (uint64_t *)nvme->transferBuffer.buffer();
-	    for (int i = 0; i < numBlocks/blocksPerPage; i++) {
-		prplist[i] = (uint64_t)(0x30000000ul + 0x1000*i + 0x1000); // send data to the FIFO
-	    }
-	}
-	cmd->cdw10 = 10; // starting LBA.lower
-	cmd->cdw11 = 0; // starting LBA.upper
-	cmd->cdw12 = numBlocks-1; // read N blocks
-
-	nvme->ioSubmissionQueue.cacheInvalidate(4096, 1);
-	nvme->ioCompletionQueue.cacheInvalidate(4096, 0);
-	nvme->transferBuffer.cacheInvalidate(8*512, 1);
-
-	fprintf(stderr, "IO cmd opcode=%02x flags=%02x cid=%04x %08x\n", cmd->opcode, cmd->flags, cmd->cid, *(int *)cmd);
-	fprintf(stderr, "enqueueing IO read request offsetof(prp1)=%d offsetof(prp2)=%d offsetof(cdw10)=%d sizeof(req)=%d\n",
-		offsetof(nvme_io_cmd,prp1), offsetof(nvme_io_cmd,prp2), offsetof(nvme_io_cmd,cdw10), sizeof(nvme_io_cmd));
-	// update submission queue tail
-	nvme->write32(0x1000+(2*1*(4 << 0)), 1);
-	sleep(2);
-	{
-	    int *buffer = (int *)(nvme->ioCompletionQueue.buffer() + (entry+0)*16);
-	    for (int i = 0; i < 4; i++) {
-		fprintf(stderr, "response[%02x]=%08x\n", i*4, buffer[i]);
-	    }
-	    int status = buffer[3];
-	    int more = (status >> 30) & 1;
-	    int sc = (status >> 17) & 0xff;
-	    int sct = (status >> 25) & 0x7;
-	    fprintf(stderr, "status=%08x more=%d sc=%x sct=%x\n", status, more, sc, sct);
-	    if (sc == 0) {
-		int *buffer = (int *)(nvme->transferBuffer.buffer() + (entry+0)*16);
-		for (int i = 0; i < numBlocks*512/4; i++) {
-		    if (buffer[i])
-			fprintf(stderr, "data read [%02x]=%08x\n", i*4, buffer[i]);
-		}
-	    }
+    }
+    cmd.cdw10 = 10; // starting LBA.lower
+    cmd.cdw11 = 0; // starting LBA.upper
+    cmd.cdw12 = numBlocks-1; // read N blocks
+
+    nvme->transferBuffer.cacheInvalidate(8*512, 1);
+
+    fprintf(stderr, "IO cmd opcode=%02x flags=%02x cid=%04x %08x\n", cmd.opcode, cmd.flags, cmd.cid, *(int *)&cmd);
+    fprintf(stderr, "enqueueing IO read request offsetof(prp1)=%d offsetof(prp2)=%d offsetof(cdw10)=%d sizeof(req)=%d\n",
+	    offsetof(nvme_io_cmd,prp1), offsetof(nvme_io_cmd,prp2), offsetof(nvme_io_cmd,cdw10), sizeof(nvme_io_cmd));
+
+    int sc = nvme->ioCommand(&cmd, &completion);
+    if (sc) {
+	int *buffer = (int *)nvme->transferBuffer.buffer();
+	for (int i = 0; i < numBlocks*512/4; i++) {
+	    if (buffer[i])
+		fprintf(stderr, "data read [%02x]=%08x\n", i*4, buffer[i]);
 	}
     }
 }
@@ -607,7 +634,6 @@
     // CC.enable
     nvme.write32(0x14, 1);
     fprintf(stderr, "CTS %08x\n", nvme.read32( 0x1c));
-    //identify(&nvme);

     const char *needle = "property";
     int needle_len = strlen(needle);
@@ -624,8 +650,8 @@
     // the MPEngine will read in the needle and mpNext
     nvme.setSearchString(nvme.needleRef, nvme.mpNextRef, needle_len);

-    fprintf(stderr, "skipping the search for now\n");
-
+    identify(&nvme);
+    return 0;
     allocIOQueues(&nvme, 0);
     nvme.startSearch(8177*512);


COMP: Fix transform type for ITKv3/IterativeClosestPoint2.

Change-Id: Ibdb86dd73c334c6c57ce70ec7f366eb3f08350f6

--- Examples/RegistrationITKv3/IterativeClosestPoint2.cxx
+++ Examples/RegistrationITKv3/IterativeClosestPoint2.cxx
@@ -24,7 +24,7 @@
 // Software Guide : EndLatex

 // Software Guide : BeginCodeSnippet
-#include "itkEuler3DTransform.h"
+#include "itkTranslationTransform.h"
 #include "itkEuclideanDistancePointMetric.h"
 #include "itkLevenbergMarquardtOptimizer.h"
 #include "itkPointSetToPointSetRegistrationMethod.h"


check that feature set don't exceed program count

--- GVRf/Framework/jni/shaders/material/assimp_shader.cpp
+++ GVRf/Framework/jni/shaders/material/assimp_shader.cpp
@@ -161,7 +161,7 @@
     Texture* texture;
     int feature_set = material->get_shader_feature_set();

-    /* Get the texture only diffuese texture is set */
+    /* Get the texture only diffuse texture is set */
     if (ISSET(feature_set, AS_DIFFUSE_TEXTURE)) {
         texture = material->getTexture("main_texture");
         if (texture->getTarget() != GL_TEXTURE_2D) {
@@ -171,8 +171,8 @@
         }
     }

-    /* Based on feature set get the shader program */
-    program_ = program_list_[feature_set];
+    /* Based on feature set get the shader program, feature set cannot exceed program count */
+    program_ = program_list_[feature_set & (AS_TOTAL_GL_PROGRAM_COUNT - 1)];

     a_position_ = glGetAttribLocation(program_->id(), "a_position");
     u_mvp_ = glGetUniformLocation(program_->id(), "u_mvp");


clean a little problematic piece of code

--- GameEngine/GameEngine/Engine/Systems/CameraSystem.cpp
+++ GameEngine/GameEngine/Engine/Systems/CameraSystem.cpp
@@ -203,8 +203,6 @@
 		_render->setShaderUniform(_shader, _diffuse_color, glm::vec4(1.0f, 1.0f, 1.0f, 1.0f));
 		_render->setShaderUniform(_shader, _diffuse_ratio, 1.0f);
 		_render->draw(GL_TRIANGLES, _renderPass, NULL, 0);
-		glUseProgram(0);
-		_render->draw(GL_TRIANGLES, _renderPass, NULL, 0);
 		while (!camera.drawables.empty())
 		{
 			auto &c = camera.drawables.front();


iox-#996 Fix missing member m_hasError for windows

Signed-off-by: Christian Eltzschig <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@elchris.org>

--- iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/expected.inl
+++ iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/expected.inl
@@ -286,8 +286,7 @@
 template <typename ValueType>
 inline expected<ErrorType>::expected(const expected<ValueType, ErrorType>& rhs) noexcept
 {
-    m_hasError = rhs.has_error();
-    if (m_hasError)
+    if (rhs.has_error())
     {
         m_store.emplace_at_index<ERROR_INDEX>(rhs.get_error());
     }
@@ -297,8 +296,7 @@
 template <typename ValueType>
 inline expected<ErrorType>::expected(expected<ValueType, ErrorType>&& rhs) noexcept
 {
-    m_hasError = rhs.has_error();
-    if (m_hasError)
+    if (rhs.has_error())
     {
         m_store.emplace_at_index<ERROR_INDEX>(std::move(rhs.get_error()));
     }
@@ -308,7 +306,7 @@
 template <typename ValueType>
 inline expected<ErrorType>& expected<ErrorType>::operator=(const expected<ValueType, ErrorType>& rhs) noexcept
 {
-    if (m_hasError && rhs.has_error())
+    if (has_error() && rhs.has_error())
     {
         m_store.get_error() = rhs.get_error();
     }
@@ -316,14 +314,13 @@
     {
         m_store = variant<ErrorType>(in_place_type<ErrorType>(), rhs.get_error());
     }
-    m_hasError = rhs.has_error();
 }

 template <typename ErrorType>
 template <typename ValueType>
 inline expected<ErrorType>& expected<ErrorType>::operator=(expected<ValueType, ErrorType>&& rhs) noexcept
 {
-    if (m_hasError && rhs.has_error())
+    if (has_error() && rhs.has_error())
     {
         m_store.get_error() = std::move(rhs.get_error());
     }
@@ -331,7 +328,6 @@
     {
         m_store = variant<ErrorType>(in_place_type<ErrorType>(), std::move(rhs.get_error()));
     }
-    m_hasError = rhs.has_error();
 }
 #endif


- add geometry initialization for translating the ITS clusters from local to global coordinates - add detector origin for the data blocks pushed back in HLT

--- HLT/ITS/AliHLTITSClusterHistoComponent.cxx
+++ HLT/ITS/AliHLTITSClusterHistoComponent.cxx
@@ -17,7 +17,7 @@

 /** @file   AliHLTITSClusterHistoComponent.cxx
     @author Gaute Ovrebekk
-    @brief  Component for ploting charge in clusters
+    @brief  Component for plotting charge in clusters
 */

 #if __GNUC__>= 3
@@ -28,6 +28,7 @@
 #include "AliHLTITSClusterDataFormat.h"
 #include "AliCDBEntry.h"
 #include "AliCDBManager.h"
+#include "AliGeomManager.h"
 #include "AliITSRecPoint.h"
 #include "TMath.h"
 #include <TFile.h>
@@ -35,15 +36,12 @@
 #include "TObjString.h"
 #include "TObjArray.h"

-//#include <stdlib.h>
-//#include <cerrno>
-
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTITSClusterHistoComponent)

 AliHLTITSClusterHistoComponent::AliHLTITSClusterHistoComponent()
-:
-fXY(NULL),
+  :
+  fXY(NULL),
   fPhieta(NULL),
   fCharge(NULL),
   fPlotCharge(kFALSE),
@@ -54,26 +52,21 @@
   // refer to README to build package
   // or
   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-
-}
-
-AliHLTITSClusterHistoComponent::~AliHLTITSClusterHistoComponent()
-{
+}
+
+AliHLTITSClusterHistoComponent::~AliHLTITSClusterHistoComponent(){
   // see header file for class documentation
 }

 // Public functions to implement AliHLTComponent's interface.
 // These functions are required for the registration process

-const char* AliHLTITSClusterHistoComponent::GetComponentID()
-{
-  // see header file for class documentation
-
+const char* AliHLTITSClusterHistoComponent::GetComponentID(){
+  // see header file for class documentation
   return "ITSClusterHisto";
 }

-void AliHLTITSClusterHistoComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list)
-{
+void AliHLTITSClusterHistoComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list){
   // see header file for class documentation
   list.clear();
   list.push_back( kAliHLTDataTypeClusters|kAliHLTDataOriginITSSPD );
@@ -81,157 +74,154 @@
   list.push_back( kAliHLTDataTypeClusters|kAliHLTDataOriginITSSSD );
 }

-AliHLTComponentDataType AliHLTITSClusterHistoComponent::GetOutputDataType()
-{
+AliHLTComponentDataType AliHLTITSClusterHistoComponent::GetOutputDataType(){
   // see header file for class documentation
   return kAliHLTDataTypeHistogram;
-
-}
-
-void AliHLTITSClusterHistoComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
-{
+}
+
+void AliHLTITSClusterHistoComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ){
   // see header file for class documentation
   // XXX TODO: Find more realistic values.
-  constBase = 80000;
-  inputMultiplier = 10;
-}
-
-AliHLTComponent* AliHLTITSClusterHistoComponent::Spawn()
-{
+  constBase = 5000;
+  inputMultiplier = 2;
+}
+
+AliHLTComponent* AliHLTITSClusterHistoComponent::Spawn(){
   // see header file for class documentation
   return new AliHLTITSClusterHistoComponent;
 }

-int AliHLTITSClusterHistoComponent::DoInit( int argc, const char** argv )
-{
-  fPlotCharge=kFALSE;
-  fPlotXYPhiEta=kTRUE;
+int AliHLTITSClusterHistoComponent::DoInit( int argc, const char** argv ){
+  // see header file for class documentation

-  if(fPlotCharge){fCharge = new TH1F("fCharge","Total Charge of clusters",2000,0,2000);}
+  if(AliGeomManager::GetGeometry()==NULL){
+    AliGeomManager::LoadGeometry();
+  }
+
+  fPlotCharge   = kFALSE;
+  fPlotXYPhiEta = kTRUE;
+
+  if(fPlotCharge) fCharge = new TH1F("fCharge","Total Charge of clusters",2000,0,2000);
   if(fPlotXYPhiEta){
-	fXY = new TH2F("fXY","Global XY of ITS clusters",1600,-80,80,1600,-80,80);
-  	Char_t name[50];
-	Char_t title[50];
-	fPhieta = new TH2F*[6];
-	for (Int_t iLay=0;iLay<6;iLay++) {
-		sprintf(name,"Phi_vs_Eta_ITS_Layer%d",iLay+1);
-		sprintf(title,"Phi vs Eta - ITS Layer %d",iLay+1);
-		fPhieta[iLay]=new TH2F(name,title,60,-1.5,1.5,60,0.,2*TMath::Pi());
-		fPhieta[iLay]->GetXaxis()->SetTitle("Pseudorapidity");
-		fPhieta[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
- 	}
-
+     fXY = new TH2F("fXY","Global XY of ITS clusters",1600,-80,80,1600,-80,80);
+     Char_t name[50];
+     Char_t title[50];
+     fPhieta = new TH2F*[6];
+     for (Int_t iLay=0;iLay<6;iLay++){
+     	     sprintf(name,"Phi_vs_Eta_ITS_Layer%d",iLay+1);
+     	     sprintf(title,"Phi vs Eta - ITS Layer %d",iLay+1);
+     	     fPhieta[iLay]=new TH2F(name,title,60,-1.5,1.5,60,0.,2*TMath::Pi());
+     	     fPhieta[iLay]->GetXaxis()->SetTitle("Pseudorapidity");
+     	     fPhieta[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
+     }
   }

   int iResult=0;
   TString configuration="";
   TString argument="";
-  for (int i=0; i<argc && iResult>=0; i++) {
+
+  for(int i=0; i<argc && iResult>=0; i++){
     argument=argv[i];
     if (!configuration.IsNull()) configuration+=" ";
     configuration+=argument;
   }

-  if (!configuration.IsNull()) {
+  if(!configuration.IsNull()){
     iResult=Configure(configuration.Data());
   }

   return iResult;
 }

-int AliHLTITSClusterHistoComponent::DoDeinit()
-{
+int AliHLTITSClusterHistoComponent::DoDeinit(){
   // see header file for class documentation
   if(fCharge!=NULL) delete fCharge;
   if(fXY!=NULL) {
-	delete fXY;
-	for(Int_t i=0;i<6;i++) delete fPhieta[5-i];
+     delete fXY;
+     for(Int_t i=0;i<6;i++) delete fPhieta[5-i];
   }
   return 0;
 }

-int AliHLTITSClusterHistoComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
-{
-
+int AliHLTITSClusterHistoComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/){
+  // see header file for class documentation
+
   static Int_t event = 0;
   event++;
   int TotalSpacePoint = 0;

   const AliHLTComponentBlockData* iter = NULL;

-  if(!IsDataEvent())
-    return 0;
-
-  for ( iter = GetFirstInputBlock(kAliHLTDataTypeClusters); iter != NULL; iter = GetNextInputBlock() ) {
-
-
-    if(iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSPD) &&
-       iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSDD) &&
-       iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSSD))
-       continue;
-
-    const AliHLTITSClusterData* clusterData = (const AliHLTITSClusterData*) iter->fPtr;
-    Int_t nSpacepoint = (Int_t) clusterData->fSpacePointCnt;
-    TotalSpacePoint += nSpacepoint;
-    AliHLTITSSpacePointData *clusters = (AliHLTITSSpacePointData*) clusterData->fSpacePoints;
-
-    for(int i=0;i<nSpacepoint;i++){
-      Int_t lab[4]={0,0,0,0};
-      Float_t hit[6]={0,0,0,0,0,0};
-      Int_t info[3]={0,0,0};
-
-      lab[0]=clusters[i].fTracks[0];
-      lab[1]=clusters[i].fTracks[1];
-      lab[2]=clusters[i].fTracks[2];
-      lab[3]=clusters[i].fIndex;
-      hit[0]=clusters[i].fY;
-      hit[1]=clusters[i].fZ;
-      hit[2]=clusters[i].fSigmaY2;
-      hit[3]=clusters[i].fSigmaZ2;
-      hit[4]=clusters[i].fQ;
-      hit[5]=clusters[i].fSigmaYZ;
-      info[0]=clusters[i].fNy;
-      info[1]=clusters[i].fNz;
-      info[2]=clusters[i].fLayer;
-
-      Float_t xyz[3];
-      AliITSRecPoint recpoint(lab,hit,info);
-      recpoint.GetGlobalXYZ(xyz);
-	  Int_t layer = recpoint.GetLayer();
-      if(fPlotXYPhiEta){
-		fXY->Fill(xyz[0],xyz[1]);
-		Float_t rad=TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
-		Float_t theta=TMath::ATan2(rad,xyz[2]);
-		Float_t eta=-1*TMath::Log(TMath::Tan(theta/2.0));
-		Float_t phi=TMath::ATan2(xyz[1],xyz[0]);
-		if(phi<0.0){phi=2 * TMath::Pi() - TMath::Abs(phi);}
-		fPhieta[layer]->Fill(eta,phi);
-      }
-      if(fPlotCharge){
-		fCharge->Fill(recpoint.GetQ());
-      }
+  if(!IsDataEvent()) return 0;
+
+  for(iter = GetFirstInputBlock(kAliHLTDataTypeClusters); iter != NULL; iter = GetNextInputBlock()){
+
+      if(iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSPD) &&
+         iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSDD) &&
+         iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSSD))
+         continue;
+
+      const AliHLTITSClusterData* clusterData = (const AliHLTITSClusterData*) iter->fPtr;
+      Int_t nSpacepoint = (Int_t) clusterData->fSpacePointCnt;
+      TotalSpacePoint += nSpacepoint;
+      AliHLTITSSpacePointData *clusters = (AliHLTITSSpacePointData*) clusterData->fSpacePoints;
+
+      for(int i=0;i<nSpacepoint;i++){
+
+	  Int_t lab[4]   = {0,0,0,0};
+          Float_t hit[6] = {0,0,0,0,0,0};
+          Int_t info[3]  = {0,0,0};
+
+          lab[0]  = clusters[i].fTracks[0];
+          lab[1]  = clusters[i].fTracks[1];
+          lab[2]  = clusters[i].fTracks[2];
+          lab[3]  = clusters[i].fIndex;
+          hit[0]  = clusters[i].fY;
+          hit[1]  = clusters[i].fZ;
+          hit[2]  = clusters[i].fSigmaY2;
+          hit[3]  = clusters[i].fSigmaZ2;
+          hit[4]  = clusters[i].fQ;
+          hit[5]  = clusters[i].fSigmaYZ;
+          info[0] = clusters[i].fNy;
+          info[1] = clusters[i].fNz;
+          info[2] = clusters[i].fLayer;
+
+          Float_t xyz[3];
+          AliITSRecPoint recpoint(lab,hit,info);
+          recpoint.GetGlobalXYZ(xyz);
+    	  Int_t layer = recpoint.GetLayer();
+
+	  if(fPlotXYPhiEta){
+    	     fXY->Fill(xyz[0],xyz[1]);
+    	     Float_t rad=TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
+    	     Float_t theta=TMath::ATan2(rad,xyz[2]);
+    	     Float_t eta=-1*TMath::Log(TMath::Tan(theta/2.0));
+    	     Float_t phi=TMath::ATan2(xyz[1],xyz[0]);
+    	     if(phi<0.0){phi=2 * TMath::Pi() - TMath::Abs(phi);}
+    	     fPhieta[layer]->Fill(eta,phi);
+          }
+          if(fPlotCharge) fCharge->Fill(recpoint.GetQ());
     }
   }

   if(fPlotCharge){
-    AliHLTUInt32_t fSpecification = 0x0;
-    PushBack( (TObject*) fCharge,kAliHLTDataTypeHistogram,fSpecification);
+     AliHLTUInt32_t fSpecification = 0x0;
+     PushBack( (TObject*) fCharge,kAliHLTDataTypeHistogram|kAliHLTDataOriginITS,fSpecification);
   }
   if(fPlotXYPhiEta){
-    AliHLTUInt32_t fSpecification = 0x0;
-    PushBack( (TObject*) fXY,kAliHLTDataTypeHistogram,fSpecification);
-	for(Int_t ii=0;ii<6;ii++)
-		PushBack( (TObject*) fPhieta[ii],kAliHLTDataTypeHistogram,fSpecification);
-  }
-
-  HLTInfo("ITSClusterHisto found %d Total Spacepoints", TotalSpacePoint);
+     AliHLTUInt32_t fSpecification = 0x0;
+     PushBack( (TObject*) fXY,kAliHLTDataTypeHistogram|kAliHLTDataOriginITS,fSpecification);
+     for(Int_t ii=0;ii<6;ii++) PushBack( (TObject*) fPhieta[ii],kAliHLTDataTypeHistogram|kAliHLTDataOriginITS,fSpecification);
+  }
+
+  HLTDebug("ITSClusterHisto found %d Total Spacepoints", TotalSpacePoint);

   return 0;
 }

-int AliHLTITSClusterHistoComponent::Configure(const char* arguments)
-{
-
+int AliHLTITSClusterHistoComponent::Configure(const char* arguments){
+  // see header file for class documentation
+
   int iResult=0;

   if (!arguments) return iResult;
@@ -292,8 +282,7 @@
   return iResult;
 }

-int AliHLTITSClusterHistoComponent::Reconfigure(const char* cdbEntry, const char* chainId)
-{
+int AliHLTITSClusterHistoComponent::Reconfigure(const char* cdbEntry, const char* chainId){
   // see header file for class documentation
   int iResult=0;


tests: Add checks for memory table usage

--- tests/pmem_test.cpp
+++ tests/pmem_test.cpp
@@ -34,6 +34,21 @@

 BOOST_AUTO_TEST_SUITE (BOOST_TEST_MODULE)

+static ppointer pmem_alloc (psize nbytes)
+{
+	return (ppointer) malloc (nbytes);
+}
+
+static ppointer pmem_realloc (ppointer block, psize nbytes)
+{
+	return (ppointer) realloc (block, nbytes);
+}
+
+static void pmem_free (ppointer block)
+{
+	free (block);
+}
+
 BOOST_AUTO_TEST_CASE (pmem_general_test)
 {
 	PMemVTable	vtable;
@@ -42,9 +57,9 @@

 	p_lib_init ();

-	vtable.free = NULL;
-	vtable.malloc = NULL;
-	vtable.realloc = NULL;
+	vtable.free	= NULL;
+	vtable.malloc	= NULL;
+	vtable.realloc	= NULL;

 	BOOST_CHECK (p_malloc (0) == NULL);
 	BOOST_CHECK (p_malloc0 (0) == NULL);
@@ -52,6 +67,12 @@
 	BOOST_CHECK (p_mem_set_vtable (NULL) == FALSE);
 	BOOST_CHECK (p_mem_set_vtable (&vtable) == FALSE);
 	p_free (NULL);
+
+	vtable.free	= pmem_free;
+	vtable.malloc	= pmem_alloc;
+	vtable.realloc	= pmem_realloc;
+
+	BOOST_CHECK (p_mem_set_vtable (&vtable) == TRUE);

 	/* Test memory allocation using system functions */
 	ptr = p_malloc (1024);
@@ -98,6 +119,12 @@

 	p_free (ptr);

+	vtable.malloc	= (ppointer (*)(psize)) malloc;
+	vtable.realloc	= (ppointer (*)(ppointer, psize)) realloc;
+	vtable.free	= (void (*)(ppointer)) free;
+
+	BOOST_CHECK (p_mem_set_vtable (&vtable) == TRUE);
+
 	/* Test memory mapping */
 	ptr = p_mem_mmap (0, NULL);
 	BOOST_CHECK (ptr == NULL);


added protection against adding unsupported operations

--- equations.cpp
+++ equations.cpp
@@ -1,4 +1,5 @@
 #include "equations.hpp"
+#include <algorithm>
 #include <stdexcept>

 EquationPiece::EquationPiece(char op) : type(Type::Operation), operation(op) {}
@@ -19,6 +20,9 @@
 }

 void Equation::addOperation(char op) {
+	if (find(OPERATIONS.begin(), OPERATIONS.end(), op) == OPERATIONS.end()) {
+		throw std::runtime_error(std::string("Invalid operation ")+op+" added to equation.");
+	}
 	equationPieces.emplace_back(op);
 }

@@ -71,6 +75,9 @@
 					throw std::runtime_error("Trying to divide by 0.");
 				}
 				result = num2/num1;
+				break;
+			default:
+				//Cant get here because addOperation disallows invalid operations
 				break;
 			}


correct clusters attached to tracklets for tilting of the pads

--- EVE/EveDet/AliEveTRDData.cxx
+++ EVE/EveDet/AliEveTRDData.cxx
@@ -343,45 +343,55 @@
   SetName("tracklet");

   SetUserData(trklt);
-  Int_t det = -1, sec;
+  Float_t dx;
+  Float_t x0   = trklt->GetX0();
+  Float_t y0   = trklt->GetYref(0);
+  Float_t z0   = trklt->GetZref(0);
+  Float_t dydx = trklt->GetYref(1);
+  Float_t dzdx = trklt->GetZref(1);
+  Float_t tilt = trklt->GetTilt();
   Float_t g[3];
   AliTRDcluster *c = 0x0;
   for(Int_t ic=0; ic<AliTRDseed::knTimebins; ic++){
     if(!(c = trklt->GetClusters(ic))) continue;
     if(!fClusters) AddElement(fClusters = new AliEveTRDClusters());
-    det = c->GetDetector();
+    dx = x0 - c->GetX();
+    //Float_t yt = y0 - dx*dydx;
+    Float_t zt = z0 - dx*dzdx;
+    c->SetY(c->GetY()-tilt*(c->GetZ()-zt));
     c->GetGlobalXYZ(g);
     Int_t id = fClusters->SetNextPoint(g[0], g[1], g[2]);
     //Int_t id = fClusters->SetNextPoint(c->GetX(), c->GetY(), c->GetZ());
     fClusters->SetPointId(id, new AliTRDcluster(*c));
   }
-  if(fClusters) fClusters->SetTitle(Form("N[%d]", trklt->GetN2()));
-
-
-  SetTitle(Form("Det[%d] Plane[%d] P[%7.3f]", det, trklt->GetPlane(), trklt->GetMomentum()));
+  if(fClusters){
+    fClusters->SetTitle(Form("N[%d]", trklt->GetN2()));
+    fClusters->SetMarkerColor(kMagenta);
+  }
+
+  SetTitle(Form("Det[%d] Plane[%d] P[%7.3f]", trklt->GetDetector(), trklt->GetPlane(), trklt->GetMomentum()));
   SetLineColor(kRed);
   //SetOwnIds(kTRUE);

-  sec = det/30;
+  // init tracklet line
+  Int_t sec = AliTRDgeometry::GetSector(trklt->GetDetector());
   Double_t alpha = AliTRDgeometry::GetAlpha() * (sec<9 ? sec + .5 : sec - 17.5);
-  Double_t x0 = trklt->GetX0(),
-    y0f = trklt->GetYfit(0),
-    ysf = trklt->GetYfit(1),
-    z0r = trklt->GetZref(0),
-    zsr = trklt->GetZref(1);
-  Double_t xg =  x0 * TMath::Cos(alpha) - y0f * TMath::Sin(alpha);
-  Double_t yg = x0 * TMath::Sin(alpha) + y0f * TMath::Cos(alpha);
-  SetPoint(0, xg, yg, z0r);
-  //SetPoint(0, x0, y0f, z0r);
+
+  y0   = trklt->GetYfit(0);
+  dydx = trklt->GetYfit(1);
+  Double_t xg =  x0 * TMath::Cos(alpha) - y0 * TMath::Sin(alpha);
+  Double_t yg = x0 * TMath::Sin(alpha) + y0 * TMath::Cos(alpha);
+  SetPoint(0, xg, yg, z0); //SetPoint(0, x0, y0f, z0r);

   //SetPointId(0, new AliTRDseedV1(*trackletObj));
-  Double_t x1 = x0-3.5,
-    y1f = y0f - ysf*3.5,
-    z1r = z0r - zsr*3.5;
-  xg =  x1 * TMath::Cos(alpha) - y1f * TMath::Sin(alpha);
-  yg = x1 * TMath::Sin(alpha) + y1f * TMath::Cos(alpha);
-  SetPoint(1, xg, yg, z1r);
+  dx = .5*AliTRDgeometry::CamHght()+AliTRDgeometry::CdrHght();
+  x0 -= dx;
+  y0 -= dydx*dx,
+  z0 -= dzdx*dx;
+  xg = x0 * TMath::Cos(alpha) - y0 * TMath::Sin(alpha);
+  yg = x0 * TMath::Sin(alpha) + y0 * TMath::Cos(alpha);
+  SetPoint(1, xg, yg, z0);
   //SetPoint(1, x1, y1f, z1r);
 }


BUG: ExtractImageFilter::CollapseToSubMatrix fix

When copying directions from an image of higher dimension the index used
to access directions was the one of the lower dimension image.

Change-Id: I87e900ef7eee81e592c3c8ac68c92243afae09ea

--- Modules/Core/Common/include/itkExtractImageFilter.hxx
+++ Modules/Core/Common/include/itkExtractImageFilter.hxx
@@ -200,7 +200,7 @@
             if ( m_ExtractionRegion.GetSize()[dim] )
               {
               outputDirection[nonZeroCount][nonZeroCount2] =
-                inputDirection[nonZeroCount][dim];
+                inputDirection[i][dim];
               ++nonZeroCount2;
               }
             }


Introduce variable for return value to enable additional function calls before returning.

--- Modules/IGT/TrackingDevices/mitkPolhemusInterface.cpp
+++ Modules/IGT/TrackingDevices/mitkPolhemusInterface.cpp
@@ -91,29 +91,55 @@

 bool mitk::PolhemusInterface::Connect()
 {
-  if (!InitializeDevice()) { return false; }
-
-  if (m_pdiDev->CnxReady()) { return true; }
-  CPDIser	pdiSer;
-  m_pdiDev->SetSerialIF(&pdiSer);
-
-  ePiCommType eType = m_pdiDev->DiscoverCnx();
-  switch (eType)
-  {
-  case PI_CNX_USB:
-    MITK_INFO << "USB Connection: " << m_pdiDev->GetLastResultStr();
-    break;
-  case PI_CNX_SERIAL:
-    MITK_INFO << "Serial Connection: " << m_pdiDev->GetLastResultStr();
-    break;
-  default:
-    MITK_INFO << "DiscoverCnx result: " << m_pdiDev->GetLastResultStr();
-    break;
-  }
-
-  if (!SetupDevice()) { return false; }
-
-  return m_pdiDev->CnxReady();
+  bool returnValue;
+  //Initialize, and if it is not successful, return false.
+  if (!InitializeDevice())
+  {
+    returnValue = false;
+  }
+  //Connect
+  else if (m_pdiDev->CnxReady())
+  {
+    returnValue = true;
+  }
+  //If it is not successful, search for connections.
+  else
+  {
+    CPDIser  pdiSer;
+    m_pdiDev->SetSerialIF(&pdiSer);
+
+    ePiCommType eType = m_pdiDev->DiscoverCnx();
+    switch (eType)
+    {
+    case PI_CNX_USB:
+      MITK_INFO << "USB Connection: " << m_pdiDev->GetLastResultStr();
+      break;
+    case PI_CNX_SERIAL:
+      MITK_INFO << "Serial Connection: " << m_pdiDev->GetLastResultStr();
+      break;
+    default:
+      MITK_INFO << "DiscoverCnx result: " << m_pdiDev->GetLastResultStr();
+      break;
+    }
+
+    //Setup device
+    if (!SetupDevice())
+    {
+      returnValue = false;
+    }
+    else
+    {
+      returnValue = m_pdiDev->CnxReady();
+    }
+  }
+
+  if (returnValue)
+  {
+
+    return true;
+  }
+  else
+    return false;
 }

 bool mitk::PolhemusInterface::Disconnect()


Minor code refactoring changes

Minor code refactoring changes

--- Modules/SegmentationUI/Qmitk/QmitknnUNetToolSlots.cpp
+++ Modules/SegmentationUI/Qmitk/QmitknnUNetToolSlots.cpp
@@ -382,8 +382,8 @@

 void QmitknnUNetToolGUI::SegmentationProcessFailed()
 {
-  m_Controls.statusLabel->setText(
-    "STATUS: Error in the segmentation process. No resulting segmentation can be loaded.");
+  ShowStatusMessage(
+    "STATUS: Error in the segmentation process.
No resulting segmentation can be loaded.");
   this->setCursor(Qt::ArrowCursor);
   std::stringstream stream;
   stream << "Error in the segmentation process. No resulting segmentation can be loaded.";
@@ -395,8 +395,8 @@
 {
   tool->RenderOutputBuffer();
   this->SetLabelSetPreview(tool->GetMLPreview());
-  m_Controls.statusLabel->setText("STATUS: Segmentation task finished successfully. Please Confirm the "
-                                  "segmentation else will result in data loss");
+  ShowStatusMessage("STATUS: Segmentation task finished successfully.
Please Confirm the "
+                                  "segmentation else, could result in data loss");
   m_Controls.stopButton->setEnabled(false);
 }


Compilation fix in DpdkBridge

Compilation fix in DpdkBridge

--- Examples/DpdkBridge/main.cpp
+++ Examples/DpdkBridge/main.cpp
@@ -72,10 +72,10 @@
 			"    -v|--version                               : Displays the current version and exits\n"
 			"    -c|--core-mask CORE_MASK                   : Core mask of cores to use. For example: use 7 (binary 0111) to use cores 0,1,2.\n"
 			"                                                 Default is using all cores except management core\n"
-			"    -m|--mbuf-pool-size POOL_SIZE              : DPDK mBuf pool size to initialize DPDK with. Default value is 4095\n\n", AppName::get().c_str());
+			"    -m|--mbuf-pool-size POOL_SIZE              : DPDK mBuf pool size to initialize DPDK with. Default value is 4095\n\n"
 			"    -d|--dpdk-ports PORT_1,PORT_2              : A comma-separated list of two DPDK port numbers to be bridged.\n"
 			"                                                 To see all available DPDK ports use the -l switch\n"
-			"    -q|--queue-quantity QUEUE_QTY              : Quantity of RX queues to be opened for each DPDK device. Default value is 1\n"
+			"    -q|--queue-quantity QUEUE_QTY              : Quantity of RX queues to be opened for each DPDK device. Default value is 1\n", AppName::get().c_str());
 }


Stuff from aldaqdqm09

Stuff from aldaqdqm09

--- FMD/scripts/dqm/SpectraRaw.C
+++ FMD/scripts/dqm/SpectraRaw.C
@@ -7,13 +7,18 @@
 /** Display hits
     @ingroup FMD_script
  */
+Bool_t
+CheckFile(const char* prefix, int number, TString& f)
+{
+  f = (Form("%s%d.csv", prefix, number));
+  std::cout << "Checking if " << f << " exists ... " << std::flush;
+  f = gSystem->Which("$(HOME)/calib/", f.Data());
+  std::cout << '"' << f << '"' << std::endl;
+  return !f.IsNull();
+}
 void
 SpectraRaw(const char* file="raw.root", Int_t runno=0)
 {
-  gSystem->Load("libANALYSIS.so");
-  gSystem->Load("libANALYSISalice.so");
-  // gSystem->Load("libFMDanalysis.so");
-  gSystem->Load("$(HOME)/scripts/foo.so");
   gSystem->Load("libFMDutil.so");

   AliCDBManager* cdb = AliCDBManager::Instance();
@@ -21,14 +26,53 @@
   cdb->SetDefaultStorage(cdbUri);
   cdb->SetRun(runno);

-  AliFMDParameters::Instance()->Init(kFALSE,
-				     AliFMDParameters::kPulseGain|
-				     AliFMDParameters::kPedestal|
-				     AliFMDParameters::kDeadMap|
-				     AliFMDParameters::kZeroSuppression|
-				     AliFMDParameters::kAltroMap|
-				     AliFMDParameters::kStripRange);
-  AliFMDParameters::Instance()->SetSampleRate(2);
+  AliFMDCalibStripRange* range = new AliFMDCalibStripRange;
+  AliFMDCalibSampleRate* rate  = new AliFMDCalibSampleRate;
+  AliFMDCalibPedestal*   peds  = new AliFMDCalibPedestal;
+  AliFMDCalibGain*       gains = new AliFMDCalibGain;
+  Bool_t gotConds = kFALSE;
+  Bool_t gotPeds  = kFALSE;
+  Bool_t gotGains = kFALSE;
+  for (Int_t i = 1; i <= 3; i++) {
+    TString f;
+    if (CheckFile("conditions", i, f)) {
+      gotConds = kTRUE;
+      std::cout << "Reading conditions for FMD" <<i<< " from " <<f<< std::endl;
+      std::ifstream in(f.Data());
+      range->ReadFromFile(in);
+      rate->ReadFromFile(in);
+    }
+    if (CheckFile("peds", i, f)) {
+      gotPeds = kTRUE;
+      std::cout << "Reading pedestals for FMD" <<i<< " from " <<f<< std::endl;
+      std::ifstream in(f.Data());
+      peds->ReadFromFile(in);
+    }
+    if (CheckFile("gains", i, f)) {
+      gotGains = kTRUE;
+      std::cout << "Reading gains for FMD" <<i<< " from " <<f<< std::endl;
+      std::ifstream in(f.Data());
+      gains->ReadFromFile(in);
+    }
+  }
+
+  Int_t mask = (AliFMDParameters::kDeadMap|
+		AliFMDParameters::kZeroSuppression|
+		AliFMDParameters::kAltroMap);
+
+
+  if (!gotConds) mask |= AliFMDParameters::kStripRange;
+  if (!gotConds) mask |= AliFMDParameters::kSampleRate;
+  if (!gotPeds)  mask |= AliFMDParameters::kPedestal;
+  if (!gotGains) mask |= AliFMDParameters::kPulseGain;
+
+  AliFMDParameters* pars = AliFMDParameters::Instance();
+  pars->Init(kFALSE, mask);
+
+  if (gotConds) pars->SetStripRange(range);
+  if (gotConds) pars->SetSampleRate(rate);
+  if (gotPeds)  pars->SetPedestal(peds);
+  if (gotGains) pars->SetGain(gains);

   AliFMDSpectraDisplay* d = new AliFMDSpectraDisplay;
   d->AddLoad(AliFMDInput::kRaw);


ENH: Merge changes from main tree into VTK-5-0 branch. (cvs -q up -j1.10 -j1.11 Filtering/vtkUniformGrid.cxx)

--- Filtering/vtkUniformGrid.cxx
+++ Filtering/vtkUniformGrid.cxx
@@ -20,6 +20,7 @@
 #include "vtkGenericCell.h"
 #include "vtkImageData.h"
 #include "vtkInformation.h"
+#include "vtkInformationVector.h"
 #include "vtkLine.h"
 #include "vtkMath.h"
 #include "vtkObjectFactory.h"
@@ -30,7 +31,7 @@
 #include "vtkVertex.h"
 #include "vtkVoxel.h"

-vtkCxxRevisionMacro(vtkUniformGrid, "1.10");
+vtkCxxRevisionMacro(vtkUniformGrid, "1.10.6.1");
 vtkStandardNewMacro(vtkUniformGrid);

 vtkCxxSetObjectMacro(vtkUniformGrid,
@@ -835,3 +836,15 @@
   return this->PointVisibility->IsConstrained() ||
     this->CellVisibility->IsConstrained();
 }
+
+//----------------------------------------------------------------------------
+vtkUniformGrid* vtkUniformGrid::GetData(vtkInformation* info)
+{
+  return info? vtkUniformGrid::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
+}
+
+//----------------------------------------------------------------------------
+vtkUniformGrid* vtkUniformGrid::GetData(vtkInformationVector* v, int i)
+{
+  return vtkUniformGrid::GetData(v->GetInformationObject(i));
+}


iox-#489 Update PeriodicTask documentation

Signed-off-by: Mathias Kraus <ebc65708cf0163c1abebe72ba676749f82c5fe3e@apex.ai>

--- iceoryx_utils/include/iceoryx_utils/internal/concurrent/periodic_task.hpp
+++ iceoryx_utils/include/iceoryx_utils/internal/concurrent/periodic_task.hpp
@@ -35,6 +35,7 @@
   public:
     /// @brief Creates a periodic task. The specified callable is stored but not executed.
     /// To run the task, `void start(const units::Duration interval)` must be called.
+    /// @tparam Args are variadic template parameter for which are forwarded to the underlying callable object
     /// @param[in] taskName will be set as thread name
     /// @param[in] args are forwarded to the underlying callable object
     template <typename... Args>
@@ -42,6 +43,7 @@

     /// @brief Creates a periodic task by spawning a thread. The specified callable is executed immediately on creation
     /// and then periodically after the interval duration.
+    /// @tparam Args are variadic template parameter for which are forwarded to the underlying callable object
     /// @param[in] interval is the time the thread waits between two invocations of the callable
     /// @param[in] taskName will be set as thread name
     /// @param[in] args are forwarded to the underlying callable object
@@ -61,8 +63,8 @@
     /// @brief Spawns a thread and immediately executes the callable specified with the constructor.
     /// The execution is repeated after the specified interval is passed.
     /// @param[in] interval is the time the thread waits between two invocations of the callable
-    /// @attention If there is already a running thread, this will be stopped and started again with the new interval.
-    /// This might take some time if a slow task is executing during this call.
+    /// @attention If the PeriodicTask instance has already a running thread, this will be stopped and started again
+    /// with the new interval. This might take some time if a slow task is executing during this call.
     void start(const units::Duration interval) noexcept;

     /// @brief This stops the thread if it's running, otherwise does nothing. When this method returns, the thread is


Performance Improvement, Notifications and Clean-up

Delayed the use of the square root function to reduce the number of
times it was used.
Added a completion time.
Included error message for when a PNG file isn't loaded correctly.
Code clean-up and commenting.

--- PNG2SignedDistanceMap/src/Application/Application.cpp
+++ PNG2SignedDistanceMap/src/Application/Application.cpp
@@ -18,12 +18,14 @@
 {
 	Window = new WindowObject();
 	Window->CreateConsole();
-	Window->SetConsoleTitle("PNG2SignedDistanceMap by Haydn Trigg 2014");
+	Window->SetConsoleTitle("PNG2SignedDistanceMap");

 	// Welcome Message
 	Console::Out << (Console::Colors::ConsoleColor)(Console::Colors::CMD_LIGHTBLUEMAJOR + Console::Colors::CMD_WHITEMINOR) <<
-		"PNG2SignedDistanceMap v1.0.1 written by Haydn Trigg\n" << Console::Colors::Text <<
+		"PNG2SignedDistanceMap v1.0.2 written by Haydn Trigg\n" << Console::Colors::Text <<
 		"Please input filename: ";
+
+	// :: Source File ::
 	string filename;
 	bool file_exists = false;
 	std::cin >> filename;
@@ -39,6 +41,7 @@
 		}
 	}

+	// :: Kernel Size ::
 	Console::Out << "Input Kernel Size: ";
 	int kernel_size = 0;
 	string kernel_string;
@@ -60,25 +63,20 @@
 			}
 		}

-
-
-
 		if (kernel_size > 0)
 		{
 			Console::Out << Console::Colors::Success << "Kernel Size " << "[" << kernel_size << "]\n";
 			break;
 		}
-		else
-		{
-			Console::Out << Console::Colors::Error << "Kernel Size must be greater than zero!\n" << "Please input Kernel Size: ";
-		}
-	}
-
+		else Console::Out << Console::Colors::Error << "Kernel Size must be greater than zero!\n" << "Please input Kernel Size: ";
+	}
+
+	// :: Output File ::
 	string out_filename;
 	bool out_filename_created = false;
 	while (!out_filename_created)
 	{
-		Console::Out << "Input Output Filename: ";
+		Console::Out << "Output Filename: ";
 		std::cin >> out_filename;
 		if (filename == "q") exit(0);
 		else file_exists = FileHelper::FileExists(out_filename);
@@ -94,29 +92,32 @@
 	}
 	Console::Out << Console::Colors::Success << "File Output Name:" << "[" << out_filename << "]\n";

-
-
-
-
+	unsigned long long start_time = GetTickCount64();

 	picopng::PNG png(filename);
 	float searchDistance = (float)kernel_size;

-	if (png.Width > 0 && png.Height > 0 && png.Data.size() > 0)
+	if (png.Width > 0 && png.Height > 0 && png.Data.size() > 0) // Ensure PNG file is ok
 	{
 		size_t png_data_size = png.Data.size();

+		// Create an array to store the pixel distance data
 		std::vector<float> distance_data;
 		distance_data.resize(png_data_size / 4);

-
-		float init = (float)sqrt((double)(png.Width*png.Width + png.Height*png.Height));
+		// Log the initial progress.
+		string str_out = string("Completed: ") + std::to_string(0) + "/" + std::to_string(png.Width) + "\n";
+		Console::Out << str_out;
+
+		// Record start time
+		unsigned long long last_time = GetTickCount64();
+
+		// Loop Variables
+		float delta = 0;
+		unsigned char data = 0;
+		float init = (float)sqrt((double)(png.Width*png.Width + png.Height*png.Height)); // Maximum possible distance
 		float max = 0.0f;
 		const float min = 0.0f;
-		Console::Out << "Completed: " << 0 << "/" << png.Width << "\n";
-		unsigned long long last_time = GetTickCount64();
-		float delta = 0;
-

 		for (unsigned int i = 0; i < png.Width; i++) //0
 		{
@@ -124,21 +125,23 @@
 			{
 				float *output = &distance_data[i + j * png.Width];
 				*output = init;
-				unsigned char data = png.Data[4 * (i + j * png.Width)]; // Get the Data
-
-				if (data <= 0)
+				data = png.Data[4 * (i + j * png.Width)]; // Get the Data
+
+				if (data <= 0) // Ensure the pixel isn't going to be of distance 0
 				{
-					for (unsigned int k = 0; k < png.Width; k++)
+					for (unsigned int k = 0; k < png.Width; k++) //2
 					{
-						for (unsigned int w = 0; w < png.Height; w++) //2 & 3
+						for (unsigned int w = 0; w < png.Height; w++) //3
 						{
-							unsigned char data = png.Data[4 * (k + w * png.Width)]; // Get the Data
+							data = png.Data[4 * (k + w * png.Width)]; // Get the Data
 							if (data > 0)
 							{
 								// Calculate distance and maintain maximum precision
+								// Calculate the distance squared
+								// NOTE: Leave as distance squared and use square root later to improve performance.
 								long long x_dist = (long long)i - k;
 								long long y_dist = (long long)j - w;
-								float distance = (float)sqrt((double)(x_dist*x_dist + y_dist*y_dist));
+								float distance = (float)(x_dist*x_dist + y_dist*y_dist);

 								if (distance < *output) *output = distance;
 								if (distance > max) max = distance;
@@ -153,29 +156,31 @@
 				else *output = 0;
 			}

-			unsigned long long current_time = GetTickCount64();
-			unsigned long long delta_time = current_time - last_time;
-			last_time = current_time;
-			float f_delta_time = (float)((double)delta_time / 1000);
-			float more_ticks = (float)(png.Width - i);
-			if (i == 0) delta = f_delta_time;
-			delta = (delta * 2 + f_delta_time) / 3.0f;
-			float remaning_time = delta * more_ticks;
-
-			Console::Clear();
-			Console::Out << "Completed: " << i + 1 << "/" << png.Width << "Remaning: " << (int)remaning_time << "secs \n";
-		}
-
-		FileHelper::FreeVector(png.Data);
+			// :: Calculate the remaning time and log progress to console ::
+			{
+				unsigned long long current_time = GetTickCount64();
+				unsigned long long delta_time = current_time - last_time;
+				last_time = current_time;
+				float f_delta_time = (float)((double)delta_time / 1000);
+				float more_ticks = (float)(png.Width - i);
+				if (i == 0) delta = f_delta_time;
+				delta = (delta * 2 + f_delta_time) / 3.0f;
+				float remaning_time = delta * more_ticks;
+
+				str_out = string("Completed: ") + std::to_string(i + 1) + "/" + std::to_string(png.Width) + " Remaning: " + std::to_string(remaning_time) + "s\n";
+				Console::Out << str_out;
+			}
+		}
+
+		FileHelper::FreeVector(png.Data); // Free the PNG Source Data. It will no longer be used.

 		// : Convert data into 0-1 byte data :
-		float divisor = max - min;
 		std::vector<unsigned char> texture_data;
 		texture_data.resize(png_data_size / 4);

 		for (unsigned int i = 0; i < png.Width; i++) for (unsigned int j = 0; j < png.Height; j++)
 		{
-			float value = distance_data[i + j*png.Width];
+			float value = sqrtf(distance_data[i + j*png.Width]);

 			// Clamp distance to -/+
 			value = Math::Clamp(value, -searchDistance, +searchDistance);
@@ -186,9 +191,9 @@
 			texture_data[i + (png.Height - j - 1)*png.Width] = (unsigned char)(value*255.0f);
 		}

-		FileHelper::FreeVector(distance_data);
-
-		// : Create Bitmap Pixel Data
+		FileHelper::FreeVector(distance_data); // Free the Distance Data. It will no longer be used.
+
+		// : Create Minochrome Bitmap Pixel Data
 		std::vector<Pixel> bmp_data;
 		bmp_data.resize(texture_data.size());
 		for (unsigned int i = 0; i < png.Width; i++) for (unsigned int j = 0; j < png.Height; j++)
@@ -199,17 +204,26 @@
 			bmp_data[i + j*png.Width].b = data;
 		}

-		FileHelper::FreeVector(texture_data);
-
-
+		FileHelper::FreeVector(texture_data); // Free the Texture Data. It will no longer be used.
+
+		// Try and save the Bitmap and log the result.
 		if (SaveBMP((unsigned char*)(&bmp_data[0]), bmp_data.size() * 3, png.Width, png.Height, (char*)out_filename.c_str()))
 		{
-			Console::Out << Console::Colors::Success << "Process Complete: " << "Saved to " << "[" << out_filename << "]\n";
-		}
-		else Console::Out << Console::Colors::Error << "Process Failed: " << "Could not save output file!\n";
-
-		system("pause");
-	}
+			// Process completed sucessfully. Calculate time and display to console.
+			unsigned long long time = GetTickCount64() - start_time;
+			float ftime = (float)((double)time / 1000);
+			Console::Out << Console::Colors::Success << "Process Complete: t["<< ftime <<"]" << "Saved to " << "[" << out_filename << "]\n";
+		}
+		// Something went wrong while trying to save the Bitmap File. Display an error message.
+		else Console::Out << Console::Colors::Error << "Process Failed: " << "Could not save output bitmap file!\n";
+
+		FileHelper::FreeVector(bmp_data); // Free the bitmap data so the application can idle with minimum memory usage.
+
+	}
+	// Something went wrong while trying to load the PNG File. Display an error message.
+	else Console::Out << Console::Colors::Error << "Process Failed: " << "Bad PNG import!\n";
+
+	system("pause"); // Wait for the user to exit the application.
 }

 bool Application::SaveBMP(unsigned char* data, DWORD data_size, int width, int height, char* filepath)


remove a useless line

remove a useless line


Rename task configurables

Rename task configurables


Build fix: neither strcmpi or _strcmpi are ISO standard. strcmpi is a POSIX function which was deprecated in VS 2005 and removed in VS 2008. The correct ISO C++ version is _stricmp

--HG--
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/trunk%401110

--- RenderSystems/Direct3D9/src/OgreD3D9DeviceManager.cpp
+++ RenderSystems/Direct3D9/src/OgreD3D9DeviceManager.cpp
@@ -221,8 +221,8 @@

 				// Vista and SP1 or SP2 - multi-head device can not be reset - it causes memory corruption.
 				if (osVersionInfo.dwMajorVersion == 6 &&
-					(strcmpi(osVersionInfo.szCSDVersion, "Service Pack 1") == 0 ||
-					 strcmpi(osVersionInfo.szCSDVersion, "Service Pack 2") == 0))
+					(_stricmp(osVersionInfo.szCSDVersion, "Service Pack 1") == 0 ||
+					 _stricmp(osVersionInfo.szCSDVersion, "Service Pack 2") == 0))

 				{
 					bTryUsingMultiheadDevice = FALSE;


Build fix: neither strcmpi or _strcmpi are ISO standard. strcmpi is a POSIX function which was deprecated in VS 2005 and removed in VS 2008. The correct ISO C++ version is _stricmp


GL render system: Added the names of the shaders to the GLSL link result error message.

--HG--
extra : rebase_source : 3c21a0921485ce7687f2a0233bc86c90f4840f6a

--- RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgram.cpp
+++ RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgram.cpp
@@ -500,7 +500,7 @@
 		mTriedToLinkAndFailed = !mLinked;
 		if(mLinked)
 		{
-			logObjectInfo( String("GLSL link result : "), mGLHandle );
+			logObjectInfo(  getCombinedName() + String(" GLSL link result : "), mGLHandle );
 			buildGLUniformReferences();
 			extractAttributes();
 		}


use vtkNew to make code cleaner

use vtkNew to make code cleaner

--- Rendering/Testing/Cxx/TestWin32OpenGLRenderWindow.cxx
+++ Rendering/Testing/Cxx/TestWin32OpenGLRenderWindow.cxx
@@ -20,37 +20,31 @@
 #include "vtkActor.h"
 #include "vtkConeSource.h"
 #include "vtkWin32OpenGLRenderWindow.h"
-#include <vtkSmartPointer.h>
 #include <vtkConeSource.h>
 #include <vtkPolyData.h>
-#include <vtkSmartPointer.h>
 #include <vtkPolyDataMapper.h>
+#include <vtkNew.h>

 //This tests if the offscreen rendering works
 static bool TestWin32OpenGLRenderWindowOffScreen(vtkWin32OpenGLRenderWindow* renderWindow)
 {
   //Create a cone
-  vtkSmartPointer<vtkConeSource> coneSource =
-    vtkSmartPointer<vtkConeSource>::New();
+  vtkNew<vtkConeSource> coneSource;
   coneSource->Update();

   //Create a mapper and actor
-  vtkSmartPointer<vtkPolyDataMapper> mapper =
-    vtkSmartPointer<vtkPolyDataMapper>::New();
+  vtkNew<vtkPolyDataMapper> mapper;
   mapper->SetInputConnection(coneSource->GetOutputPort());

-  vtkSmartPointer<vtkActor> actor =
-    vtkSmartPointer<vtkActor>::New();
-  actor->SetMapper(mapper);
+  vtkNew<vtkActor> actor;
+  actor->SetMapper(mapper.GetPointer());

   //Create a renderer, render window, and interactor
-  vtkSmartPointer<vtkRenderer> renderer =
-    vtkSmartPointer<vtkRenderer>::New();
-
-  renderWindow->AddRenderer(renderer);
+  vtkNew<vtkRenderer> renderer;
+  renderWindow->AddRenderer(renderer.GetPointer());

   //Add the actors to the scene
-  renderer->AddActor(actor);
+  renderer->AddActor(actor.GetPointer());
   renderer->SetBackground(.3, .2, .1); // Background color dark red

   //Render and interact
@@ -63,8 +57,8 @@
 {
   vtkWin32OpenGLRenderWindow* renderWindow(NULL);

-  vtkSmartPointer<vtkRenderWindow> renderWindowBase = vtkSmartPointer<vtkRenderWindow>::New();
-  renderWindow = vtkWin32OpenGLRenderWindow::SafeDownCast(renderWindowBase);
+  vtkNew<vtkRenderWindow> renderWindowBase;
+  renderWindow = vtkWin32OpenGLRenderWindow::SafeDownCast(renderWindowBase.GetPointer());

   TestWin32OpenGLRenderWindowOffScreen(renderWindow);


[addon] fix

[addon] fix

--- Siv3D/addon/Multiplayer_Photon/Multiplayer_Photon.cpp
+++ Siv3D/addon/Multiplayer_Photon/Multiplayer_Photon.cpp
@@ -502,7 +502,7 @@
 			ExitGames::Photon::ConnectionProtocol::DEFAULT, false, (m_requestedRegion ? ExitGames::LoadBalancing::RegionSelectionMode::SELECT : ExitGames::LoadBalancing::RegionSelectionMode::BEST));

 		const auto userName = detail::ToJString(userName_);
-		const auto userID = ExitGames::LoadBalancing::AuthenticationValues{}.setUserID(userName + GETTIMEMS());
+		const auto userID = ExitGames::LoadBalancing::AuthenticationValues{}.setUserID(userName + static_cast<uint32>(Time::GetMillisecSinceEpoch()));

 		if (not m_client->connect({ userID, userName }))
 		{


Fix check for continuous joint

Fix check for continuous joint

--- moveit_ros/planning_interface/robot_interaction/src/robot_interaction.cpp
+++ moveit_ros/planning_interface/robot_interaction/src/robot_interaction.cpp
@@ -512,11 +512,17 @@

     //Fill in stvector with the gradient of a joint avoidance cost function
     const std::vector<const kinematic_model::JointModel*> joint_models = joint_state_group->getJointModelGroup()->getJointModels();
-    if (qrange(i) == 0 ||
-        (joint_models[i]->getType() == kinematic_model::JointModel::REVOLUTE && qmax(i) == boost::math::constants::pi<double>() && qmin(i) == -boost::math::constants::pi<double>()))
-    {
-      //If the joint range is zero or is continuous, do not compute the cost
+    if (qrange(i) == 0)
+    {
+      //If the joint range is zero do not compute the cost
       stvector(i) = 0;
+    }
+    else if (joint_models[i]->getType() == kinematic_model::JointModel::REVOLUTE)
+    {
+      //If the joint is continuous do not compute the cost
+      const kinematic_model::RevoluteJointModel *rjoint = static_cast<const kinematic_model::RevoluteJointModel*>(joint_models[i]);
+      if (rjoint->isContinuous())
+        stvector(i) = 0;
     }
     else
     {