From Philippe:
This patch fixes TBranchElement::SetAddress for the case of a vector embedded in an object embedded in an
object which is inherited from.

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

--- tree/src/TBranchElement.cxx
+++ tree/src/TBranchElement.cxx
@@ -1,4 +1,4 @@
-// @(#)root/tree:$Name:  $:$Id: TBranchElement.cxx,v 1.117 2003/07/23 12:25:42 brun Exp $
+// @(#)root/tree:$Name:  $:$Id: TBranchElement.cxx,v 1.118 2003/08/04 17:33:21 brun Exp $
 // Author: Rene Brun   14/01/2001

 /*************************************************************************
@@ -1323,8 +1323,9 @@
   }

   if (fType == 4) {           // STL vector/list of objects
-     //printf ("STL split mode not yet implemented\n");
+     Error("ReadLeaves","STL split mode not yet implemented (error 1)\n");
   } else if (fType == 41) {    // sub branch of an STL class
+     Error("ReadLeaves","STL split mode not yet implemented (error 2)\n");
     //char **ppointer = (char**)fAddress;
   } else if (fType == 3) {    //top level branch of a TClonesArray
     Int_t n;
@@ -1556,7 +1557,7 @@
                   //     [X.]Y.Z
                   // and we are looking up 'Y'
                   parentDataName.Remove(pos);
-                  offset = GetDataMemberOffset(clparent,parentDataName);
+                  offset = GetDataMemberOffset(parentBranchClass,parentDataName);
                } else {
                   // We had a branch name of the style:
                   //     [X.]Z
@@ -1564,7 +1565,7 @@
                   // Because we are missing 'Y' (or more exactly the name of the
                   // thing that contains Z, we can only get the offset of Z and
                   // then remove the offset Z inside 'Y' (i.e. lOffset)
-                  offset = GetDataMemberOffset(clparent,parentDataName) - lOffset;
+                  offset = GetDataMemberOffset(parentBranchClass,parentDataName) - lOffset;
                }

                fObject += offset;
@@ -1833,14 +1834,15 @@
             fBranches.Add(branch);
          }
       } else {
-        if (strlen(name)) sprintf(branchname,"%s.%s",name,elem->GetFullName());
-        else              sprintf(branchname,"%s",elem->GetFullName());
-        if (splitlevel > 1 &&
+         if (strlen(name)) sprintf(branchname,"%s.%s",name,elem->GetFullName());
+         else              sprintf(branchname,"%s",elem->GetFullName());
+         if (splitlevel > 1 &&
               (elem->IsA() == TStreamerObject::Class()
             || elem->IsA() == TStreamerObjectAny::Class())) {
-               clbase = gROOT->GetClass(elem->GetTypeName());
-               if (clbase->Property() & kIsAbstract) return -1;
-
+
+            clbase = gROOT->GetClass(elem->GetTypeName());
+            if (clbase->Property() & kIsAbstract) return -1;
+
             if (gDebug > 0) printf("Unrolling object class, cltop=%s, clbase=%s\n",cltop->GetName(),clbase->GetName());
             fBranchPointer += offset;
             if (elem->CannotSplit())    unroll = -1;


Better defaults in triangulate.cpp

Better defaults in triangulate.cpp

--- triangulate/triangulate.cpp
+++ triangulate/triangulate.cpp
@@ -57,10 +57,14 @@
 	print();
 }

-int main() {
+void run() {
 	triangulation.make_grid(19, 6);
 	triangulation.make_it_smaller();
 	triangulation.make_it_smaller();
 	triangulation.write(stdout);
+}
+
+int main() {
+	demo();
 	return 0;
 }


Updating connection state when connecting to a network for a first time

--- trikGui/netConfigWidget.cpp
+++ trikGui/netConfigWidget.cpp
@@ -206,5 +206,7 @@

 	mConnectionState = connecting;

+	setConnectionStatus(Status());
+
 	mWiFi->connect(mNetworksAvailableForConnection[ssid]);
 }


CAP_KEVENT -> CAP_POST_EVENT, etc.

CAP_KEVENT -> CAP_POST_EVENT, etc.

This reflects an API change between experimental Capsicum and the version that finally went into 9.0.

--- capsicum.cc
+++ capsicum.cc
@@ -53,7 +53,7 @@
 	if (rights & CAP_FSTAT)				oss << "CAP_FSTAT ";
 	if (rights & CAP_MMAP)				oss << "CAP_MMAP ";
 	if (rights & CAP_FCNTL)				oss << "CAP_FCNTL ";
-	if (rights & CAP_POLL_KEVENT)		oss << "CAP_POLL_KEVENT ";
+	if (rights & CAP_POLL_EVENT)		oss << "CAP_POLL_KEVENT ";
 	if (rights & CAP_FSYNC)				oss << "CAP_FSYNC ";
 	if (rights & CAP_FCHOWN)			oss << "CAP_FCHOWN ";
 	if (rights & CAP_FCHMOD)			oss << "CAP_FCHMOD ";
@@ -85,7 +85,7 @@
 	if (rights & CAP_SEM_POST)			oss << "CAP_SEM_POST ";
 	if (rights & CAP_SEM_WAIT)			oss << "CAP_SEM_WAIT ";
 	if (rights & CAP_SEM_GETVALUE)	oss << "CAP_SEM_GETVALUE ";
-	if (rights & CAP_POST_KEVENT)		oss << "CAP_POST_KEVENT ";
+	if (rights & CAP_POST_EVENT)		oss << "CAP_POST_KEVENT ";
 	if (rights & CAP_PDGETPID)			oss << "CAP_PDGETPID ";
 	if (rights & CAP_PDKILL)			oss << "CAP_PDKILL ";
 	if (rights & CAP_MAPEXEC)			oss << "CAP_MAPEXEC ";


Refactored duplicate Imaging code, Added Text and Time to iamge, Misc tweaks

--- capture.cpp
+++ capture.cpp
@@ -137,23 +137,18 @@

 void calculateDayOrNight(const char* latitude, const char* longitude, const char* angle)
 {
-    std::string sunwaitCommand = "sunwait poll exit set angle ";
-    sunwaitCommand.append(angle);
-    sunwaitCommand.append(" ");
-    sunwaitCommand.append(latitude);
-    sunwaitCommand.append(" ");
-    sunwaitCommand.append(longitude);
-    dayOrNight = exec(sunwaitCommand.c_str());
-    dayOrNight = exec(sunwaitCommand.c_str());
+    char sunwaitCommand[128];
+    sprintf(sunwaitCommand, "sunwait poll exit set angle %s %s %s",angle, latitude, longitude);
+    dayOrNight = exec(sunwaitCommand);
     dayOrNight.erase(std::remove(dayOrNight.begin(), dayOrNight.end(), '\n'), dayOrNight.end());
 }

 void writeToLog(int val)
 {
     std::ofstream outfile;
-      outfile.open("log.txt", std::ios_base::app);
-      outfile << val;
-      outfile << "\n";
+    outfile.open("log.txt", std::ios_base::app);
+    outfile << val;
+    outfile << "\n";
 }

 //-------------------------------------------------------------------------------------------------------
@@ -646,16 +641,48 @@
     int exp_ms=0;
     long autoGain = 0;
     long autoExp = 0;
+    int useDelay = 0;

     while(bMain)
     {
+        bool needCapture=true;
+        std::string lastDayOrNight;
+        int captureTimeout=-1;
+
         // Find out if it is currently DAY or NIGHT
         calculateDayOrNight(latitude, longitude, angle);

-        if (dayOrNight == "NIGHT")
+        lastDayOrNight=dayOrNight;
+        printf("\n");
+        if(dayOrNight == "DAY")
         {
-            printf("\n");
-            if (asiAutoExposure == 1)
+            // Setup the daytime capture parameters
+            if(endOfNight==true)
+            {
+                system("scripts/endOfNight.sh &");
+                endOfNight=false;
+            }
+            if(daytimeCapture!=1)
+            {
+                needCapture=false;
+                printf("It's daytime... we're not saving images\n");
+                usleep(daytimeDelay*1000);
+            }
+            else
+            {
+                printf("Starting daytime capture\n");
+                printf("Saving auto exposed images every %d ms\n\n",daytimeDelay);
+                exp_ms=32;
+                useDelay=daytimeDelay;
+                captureTimeout=exp_ms<=100?200:exp_ms*2;
+                ASISetControlValue(CamNum, ASI_EXPOSURE, exp_ms, ASI_TRUE);
+                ASISetControlValue(CamNum, ASI_GAIN, 0, ASI_FALSE);
+            }
+        }
+        else if(dayOrNight=="NIGHT")
+        {
+            // Setup the night time capture parameters
+            if(asiAutoExposure == 1)
             {
                 printf("Saving auto exposed images every %d ms\n\n", delay);
             }
@@ -663,22 +690,18 @@
             {
                 printf("Saving %ds exposure images every %d ms\n\n", (int)round(currentExposure/1000000), delay);
             }
-
-            printf("Press Ctrl+C to stop\n\n");
-
             // Set exposure value for night time capture
             ASISetControlValue(CamNum, ASI_EXPOSURE, currentExposure, asiAutoExposure == 1 ? ASI_TRUE : ASI_FALSE);
             ASISetControlValue(CamNum, ASI_GAIN, asiGain, asiAutoGain == 1 ? ASI_TRUE : ASI_FALSE);
-
-            printf("Starting night time capture");
-            printf("\n");
-
-            // Start video mode
+        }
+        printf("Press Ctrl+C to stop\n\n");
+
+        if(needCapture)
+        {
             ASIStartVideoCapture(CamNum);
-
-            while(bMain && dayOrNight == "NIGHT")
-            {
-                if(ASIGetVideoData(CamNum, (unsigned char*)pRgb->imageData, pRgb->imageSize, -1) == ASI_SUCCESS)
+            while(bMain && lastDayOrNight==dayOrNight)
+            {
+                if(ASIGetVideoData(CamNum, (unsigned char*)pRgb->imageData, pRgb->imageSize, captureTimeout) == ASI_SUCCESS)
                 {
                     // Read current camera parameters
                     ASIGetControlValue(CamNum, ASI_EXPOSURE, &autoExp, &bAuto);
@@ -688,27 +711,39 @@
                     // Get Current Time for overlay
                     sprintf(bufTime, "%s", getTime());

-                    if (time == 1 )
-                    {
-                        // Replace text with time
-                        ImgText = bufTime;
-                    }
-
                     if (darkframe != 1 )
                     {
-                        // If darkframe mode is off, put an overlay over the image
-                        cvText(pRgb, ImgText, iTextX, iTextY, fontsize, linewidth, linetype[linenumber], fontname[fontnumber], fontcolor, Image_type);
+                        // If darkframe mode is off, add overlay text to the image
+                        int iYOffset=0;
+                        cvText(pRgb, ImgText, iTextX, iTextY+(iYOffset/bin), fontsize, linewidth, linetype[linenumber], fontname[fontnumber], fontcolor, Image_type);
+                        iYOffset+=30;
+                        if (time == 1 )
+                        {
+                            cvText(pRgb, bufTime, iTextX, iTextY+(iYOffset/bin), fontsize, linewidth, linetype[linenumber], fontname[fontnumber], fontcolor, Image_type);
+                            iYOffset+=30;
+                        }

                         if (showDetails == 1 )
                         {
                             sprintf(bufTemp, "Sensor %.1fC", (float)ltemp/10);
-                            cvText(pRgb, bufTemp, iTextX, iTextY+(30/bin), fontsize*0.8, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type);
+                            cvText(pRgb, bufTemp, iTextX, iTextY+(iYOffset/bin), fontsize*0.8, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type);
+                            iYOffset+=30;
                             sprintf(bufTemp, "Exposure %.3f s", (float)autoExp/1000000);
-                            cvText(pRgb, bufTemp, iTextX, iTextY+(60/bin), fontsize*0.8, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type);
+                            cvText(pRgb, bufTemp, iTextX, iTextY+(iYOffset/bin), fontsize*0.8, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type);
+                            iYOffset+=30;
                             sprintf(bufTemp, "Gain %d", (int)autoGain);
-                            cvText(pRgb, bufTemp, iTextX, iTextY+(90/bin), fontsize*0.8, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type);
+                            cvText(pRgb, bufTemp, iTextX, iTextY+(iYOffset/bin), fontsize*0.8, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type);
+                            iYOffset+=30;
                         }
                     }
+                    printf("Exposure value: %.0f µs\n", (float)autoExp);
+                    if (asiAutoExposure == 1)
+                    {
+                        // Retrieve the current Exposure for smooth transition to night time
+                        // as long as auto-exposure is enabled during night time
+                        currentExposure = autoExp;
+                    }
+
                     if(pRgb)
                     {
                         // Save the image
@@ -723,7 +758,7 @@
                         }
                     }

-                    if (asiAutoGain == 1)
+                    if (asiAutoGain == 1 && dayOrNight=="NIGHT")
                     {
                         ASIGetControlValue(CamNum, ASI_GAIN, &autoGain, &bAuto);
                         printf("Auto Gain value: %d\n", (int)autoGain);
@@ -732,132 +767,45 @@

                     if (asiAutoExposure == 1)
                     {
-                        ASIGetControlValue(CamNum, ASI_EXPOSURE, &autoExp, &bAuto);
                         printf("Auto Exposure value: %d ms\n", (int)round(autoExp/1000));
                         writeToLog(autoExp);
+                        if(dayOrNight=="NIGHT")
+                        {
+                            ASIGetControlValue(CamNum, ASI_EXPOSURE, &autoExp, &bAuto);
+                        }
+                        else
+                        {
+                            currentExposure = autoExp;
+                        }

                         // Delay applied before next exposure
-                        if (autoExp < asiMaxExposure*1000)
+                        if (autoExp < asiMaxExposure*1000 && dayOrNight=="NIGHT")
                         {
                             // if using auto-exposure and the actual exposure is less than the max,
                             // we still wait until we reach maxexposure. This is important for a
                             // constant frame rate during timelapse generation
-                            printf("Sleeping: %d ms\n", asiMaxExposure - (int)(autoExp/1000) + delay);
-                            usleep((asiMaxExposure*1000 - autoExp) + delay*1000);
+                            printf("Sleeping: %d ms\n", asiMaxExposure - (int)(autoExp/1000) + useDelay);
+                            usleep((asiMaxExposure*1000 - autoExp) + useDelay*1000);
                         }
                         else
                         {
-                            usleep(delay*1000);
+                            usleep(useDelay*1000);
                         }
                     }
                     else
                     {
-                        usleep(delay*1000);
+                        usleep(useDelay*1000);
                     }
                     calculateDayOrNight(latitude, longitude, angle);
                 }
             }
-            endOfNight = true;
-            // Stop video mode
+            if (lastDayOrNight == "NIGHT")
+            {
+                endOfNight = true;
+            }
             ASIStopVideoCapture(CamNum);
-
         }
-        else if (dayOrNight == "DAY")
-        {
-            printf("\n");
-            printf("Press Ctrl+C to stop\n\n");
-            if (endOfNight == true)
-            {
-                system("scripts/endOfNight.sh &");
-                endOfNight = false;
-            }
-            if (daytimeCapture != 1)
-            {
-                // In that case, skip day time capture
-                printf(" It's daytime... we're not saving images");
-                printf("\n");
-                usleep(daytimeDelay*1000);
-            }
-            else
-            {
-                printf("Starting daytime capture");
-                printf("\n");
-                printf("Saving auto exposed images every %d ms\n\n", daytimeDelay);
-                // Set Exposure to something low for daytime capture
-                exp_ms=32;
-                // Enable Auto-Exposure
-                ASISetControlValue(CamNum, ASI_EXPOSURE, exp_ms, ASI_TRUE);
-                ASISetControlValue(CamNum, ASI_GAIN, 0, ASI_FALSE);
-                // Start video mode
-                ASIStartVideoCapture(CamNum);
-
-                while(bMain && dayOrNight == "DAY")
-                {
-                    if(ASIGetVideoData(CamNum, (unsigned char*)pRgb->imageData, pRgb->imageSize, exp_ms<=100?200:exp_ms*2) == ASI_SUCCESS)
-                    {
-
-                        // Read current camera parameters
-                        ASIGetControlValue(CamNum, ASI_EXPOSURE, &autoExp, &bAuto);
-                        ASIGetControlValue(CamNum, ASI_GAIN, &autoGain, &bAuto);
-                        ASIGetControlValue(CamNum, ASI_TEMPERATURE, &ltemp, &bAuto);
-
-                        // Get Current Time for overlay
-                        sprintf(bufTime, "%s", getTime());
-
-                        if (time == 1 )
-                        {
-                            // Replace text with time
-                            ImgText = bufTime;
-                        }
-
-                        if (darkframe != 1 )
-                        {
-                            // If darkframe mode is off, put an overlay over the image
-                            cvText(pRgb, ImgText, iTextX, iTextY, fontsize, linewidth, linetype[linenumber], fontname[fontnumber], fontcolor, Image_type);
-
-                            if (showDetails == 1 )
-                            {
-                                sprintf(bufTemp, "Sensor %.1fC", (float)ltemp/10);
-                                cvText(pRgb, bufTemp, iTextX, iTextY+(30/bin), fontsize*0.8, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type);
-                                sprintf(bufTemp, "Exposure %.3f ms", (float)autoExp/1000);
-                                cvText(pRgb, bufTemp, iTextX, iTextY+(60/bin), fontsize*0.8, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type);
-                                sprintf(bufTemp, "Gain %d", (int)autoGain);
-                                cvText(pRgb, bufTemp, iTextX, iTextY+(90/bin), fontsize*0.8, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type);
-                            }
-                        }
-
-                        printf("Auto Exposure value: %.0f µs\n", (float)autoExp);
-                        if (asiAutoExposure == 1)
-                        {
-                            // Retrieve the current Exposure for smooth transition to night time
-                            // as long as auto-exposure is enabled during night time
-                            currentExposure = autoExp;
-                        }
-
-                        if(pRgb)
-                        {
-                            // Write the image to disk
-                            printf("Capturing daytime image...");
-                            printf(bufTime);
-                            printf("\n");
-                            if(!bSavingImg)
-                            {
-                                pthread_mutex_lock(& mtx_SaveImg);
-                                pthread_cond_signal(&cond_SatrtSave);
-                                pthread_mutex_unlock(& mtx_SaveImg);
-                            }
-                        }
-                        // Wait a certain amount of time before taking the next image
-                        usleep(daytimeDelay*1000);
-                    }
-                    calculateDayOrNight(latitude, longitude, angle);
-                }
-                // Stop video mode
-                ASIStopVideoCapture(CamNum);
-            }
-        }
-    }
-
+    }
     ASICloseCamera(CamNum);

     if(bDisplay)


Clang is annoyed by reinterpret cast in constexpr

--- SafeInt.hpp
+++ SafeInt.hpp
@@ -3052,7 +3052,10 @@
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isUint64 && IntTraits<U>::isUint64 );
         unsigned __int64 t1 = t;
         unsigned __int64 u1 = u;
-        return LargeIntRegMultiply< unsigned __int64, unsigned __int64 >::RegMultiply( t1, u1, reinterpret_cast<unsigned __int64*>(&ret) );
+		unsigned __int64 tmp = 0;
+        bool f = LargeIntRegMultiply< unsigned __int64, unsigned __int64 >::RegMultiply( t1, u1, &tmp );
+		ret = tmp;
+		return f;
     }

     template < typename E >
@@ -3061,7 +3064,9 @@
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isUint64 && IntTraits<U>::isUint64 );
         unsigned __int64 t1 = t;
         unsigned __int64 u1 = u;
-        LargeIntRegMultiply< unsigned __int64, unsigned __int64 >::template RegMultiplyThrow< E >( t1, u1, reinterpret_cast<unsigned __int64*>(&ret) );
+		unsigned __int64 tmp = 0;
+        LargeIntRegMultiply< unsigned __int64, unsigned __int64 >::template RegMultiplyThrow< E >( t1, u1, &tmp );
+		ret = tmp;
     }
 };

@@ -3074,7 +3079,10 @@
     {
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isUint64 );
         unsigned __int64 t1 = t;
-        return LargeIntRegMultiply< unsigned __int64, unsigned __int32 >::RegMultiply( t1, (unsigned __int32)u, reinterpret_cast<unsigned __int64*>(&ret) );
+		unsigned __int64 tmp = 0;
+        bool f = LargeIntRegMultiply< unsigned __int64, unsigned __int32 >::RegMultiply( t1, (unsigned __int32)u, &tmp );
+		ret = tmp;
+		return f;
     }

     template < typename E >
@@ -3082,7 +3090,9 @@
     {
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isUint64 );
         unsigned __int64 t1 = t;
-        LargeIntRegMultiply< unsigned __int64, unsigned __int32 >::template RegMultiplyThrow< E >( t1, (unsigned __int32)u, reinterpret_cast<unsigned __int64*>(&ret) );
+		unsigned __int64 tmp = 0;
+        LargeIntRegMultiply< unsigned __int64, unsigned __int32 >::template RegMultiplyThrow< E >( t1, (unsigned __int32)u, &tmp );
+		ret = tmp;
     }
 };

@@ -3128,7 +3138,10 @@
     {
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isUint64 );
         unsigned __int64 t1 = t;
-        return LargeIntRegMultiply< unsigned __int64, signed __int32 >::RegMultiply(t1, (signed __int32)u, reinterpret_cast< unsigned __int64* >(&ret));
+		unsigned __int64 tmp = 0;
+        bool f = LargeIntRegMultiply< unsigned __int64, signed __int32 >::RegMultiply(t1, (signed __int32)u, &tmp);
+		ret = tmp;
+		return f;
     }

     template < typename E >
@@ -3136,7 +3149,9 @@
     {
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isUint64 );
         unsigned __int64 t1 = t;
-        LargeIntRegMultiply< unsigned __int64, signed __int32 >::template RegMultiplyThrow< E >(t1, (signed __int32)u, reinterpret_cast< unsigned __int64* >(&ret));
+		unsigned __int64 tmp = 0;
+        LargeIntRegMultiply< unsigned __int64, signed __int32 >::template RegMultiplyThrow< E >(t1, (signed __int32)u, &tmp);
+		ret = tmp;
     }
 };

@@ -3150,7 +3165,10 @@
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isUint64 && IntTraits<U>::isInt64 );
         unsigned __int64 t1 = t;
         __int64          u1 = u;
-        return LargeIntRegMultiply< unsigned __int64, __int64 >::RegMultiply(t1, u1, reinterpret_cast< unsigned __int64* >(&ret));
+		unsigned __int64 tmp = 0;
+        bool f = LargeIntRegMultiply< unsigned __int64, __int64 >::RegMultiply(t1, u1, &tmp);
+		ret = tmp;
+		return f;
     }

     template < typename E >
@@ -3159,7 +3177,9 @@
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isUint64 && IntTraits<U>::isInt64 );
         unsigned __int64 t1 = t;
         __int64          u1 = u;
-        LargeIntRegMultiply< unsigned __int64, __int64 >::template RegMultiplyThrow< E >(t1, u1, reinterpret_cast< unsigned __int64* >(&ret));
+		unsigned __int64 tmp = 0;
+		LargeIntRegMultiply< unsigned __int64, __int64 >::template RegMultiplyThrow< E >(t1, u1, &tmp);
+		ret = tmp;
     }
 };

@@ -3203,8 +3223,11 @@
 	_CONSTEXPR14 static bool Multiply( const T& t, const U& u, T& ret ) SAFEINT_NOTHROW
     {
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isInt64 );
-        __int64          t1 = t;
-        return LargeIntRegMultiply< __int64, unsigned __int32 >::RegMultiply( t1, (unsigned __int32)u, reinterpret_cast< __int64* >(&ret) );
+        __int64 t1 = t;
+		__int64 tmp = 0;
+        bool f = LargeIntRegMultiply< __int64, unsigned __int32 >::RegMultiply( t1, (unsigned __int32)u, &tmp );
+		ret = tmp;
+		return f;
     }

     template < typename E >
@@ -3212,7 +3235,9 @@
     {
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isInt64 );
         __int64          t1 = t;
-        LargeIntRegMultiply< __int64, unsigned __int32 >::template RegMultiplyThrow< E >( t1, (unsigned __int32)u, reinterpret_cast< __int64* >(&ret) );
+		__int64 tmp = 0;
+		LargeIntRegMultiply< __int64, unsigned __int32 >::template RegMultiplyThrow< E >( t1, (unsigned __int32)u, &tmp );
+		ret = tmp;
     }
 };

@@ -3223,18 +3248,23 @@
 	_CONSTEXPR14 static bool Multiply( const T& t, const U& u, T& ret ) SAFEINT_NOTHROW
     {
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isInt64 && IntTraits<U>::isInt64 );
-        __int64          t1 = t;
-        __int64          u1 = u;
-        return LargeIntRegMultiply< __int64, __int64 >::RegMultiply( t1, u1, reinterpret_cast< __int64* >(&ret) );
+        __int64  t1 = t;
+        __int64 u1 = u;
+		__int64 tmp = 0;
+        bool f = LargeIntRegMultiply< __int64, __int64 >::RegMultiply( t1, u1, &tmp );
+		ret = tmp;
+		return f;
     }

     template < typename E >
 	_CONSTEXPR14 static void MultiplyThrow( const T& t, const U& u, T& ret ) SAFEINT_CPP_THROW
     {
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isInt64 && IntTraits<U>::isInt64 );
-        __int64          t1 = t;
-        __int64          u1 = u;
-        LargeIntRegMultiply< __int64, __int64 >::template RegMultiplyThrow< E >( t1, u1, reinterpret_cast< __int64* >(&ret));
+        __int64 t1 = t;
+        __int64 u1 = u;
+		__int64 tmp = 0;
+		LargeIntRegMultiply< __int64, __int64 >::template RegMultiplyThrow< E >( t1, u1, &tmp);
+		ret = tmp;
     }
 };

@@ -3306,7 +3336,10 @@
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isInt64 && IntTraits<U>::isUint64 );
         __int64          t1 = t;
         unsigned __int64 u1 = u;
-        return LargeIntRegMultiply< __int64, unsigned __int64 >::RegMultiply( t1, u1, reinterpret_cast< __int64* >(&ret) );
+		__int64 tmp = 0;
+        bool f = LargeIntRegMultiply< __int64, unsigned __int64 >::RegMultiply( t1, u1, &tmp );
+		ret = tmp;
+		return f;
     }

     template < typename E >
@@ -3315,7 +3348,9 @@
         SAFEINT_STATIC_ASSERT( IntTraits<T>::isInt64 && IntTraits<U>::isUint64 );
         __int64          t1 = t;
         unsigned __int64 u1 = u;
-        LargeIntRegMultiply< __int64, unsigned __int64 >::template RegMultiplyThrow< E >( t1, u1, reinterpret_cast< __int64* >(&ret) );
+		__int64 tmp = 0;
+		LargeIntRegMultiply< __int64, unsigned __int64 >::template RegMultiplyThrow< E >( t1, u1, &tmp );
+		ret = tmp;
     }
 };

@@ -7033,6 +7068,7 @@
 T*& operator +=( T*& lhs, SafeInt< U, E > rhs ) SAFEINT_CPP_THROW
 {
     // Cast the pointer to a number so we can do arithmetic
+	// Note: this doesn't really make sense as a constexpr, but cannot be because of the reinterpret_cast
     SafeInt< size_t, E > ptr_val = reinterpret_cast< size_t >( lhs );
     // Check first that rhs is valid for the type of ptrdiff_t
     // and that multiplying by sizeof( T ) doesn't overflow a ptrdiff_t


Initial work to support constexpr, and build a framework to deal with different C++ standards

--- SafeInt.hpp
+++ SafeInt.hpp
@@ -71,6 +71,52 @@
 #define SAFEINT_COMPILER VISUAL_STUDIO_COMPILER
 #else
 #define SAFEINT_COMPILER UNKNOWN_COMPILER
+#endif
+
+#define CPLUSPLUS_98 0
+#define CPLUSPLUS_11 1
+#define CPLUSPLUS_14 2
+#define CPLUSPLUS_17 3 // Future use
+
+// Determine C++ support level
+#if SAFEINT_COMPILER == CLANG_COMPILER || SAFEINT_COMPILER == GCC_COMPILER
+
+#if __cplusplus < 201103L
+#define CPLUSPLUS_STD CPLUSPLUS_98
+#elif __cplusplus < 201402L
+#define CPLUSPLUS_STD CPLUSPLUS_11
+#else
+#define CPLUSPLUS_STD CPLUSPLUS_14
+#endif
+
+#elif SAFEINT_COMPILER == VISUAL_STUDIO_COMPILER
+
+// This needs additional testing to get more versions of _MSCVER
+#if _MSC_VER < 1900 // Prior to VS 2015, need more testing to determine support
+#define CPLUSPLUS_STD CPLUSPLUS_98
+#elif _MSC_VER < 1912 // VS 2015
+#define CPLUSPLUS_STD CPLUSPLUS_11
+#else // VS 2017 or later
+#define CPLUSPLUS_STD CPLUSPLUS_14
+#endif
+
+#else
+// Unknown compiler, assume C++ 98
+#define CPLUSPLUS_STD CPLUSPLUS_98
+#endif
+
+// Now that we know the standard, can decide which constexpr behavior works
+#if CPLUSPLUS_STD == CPLUSPLUS_98
+#define _CONSTEXPR11
+#define _CONSTEXPR14
+#elif CPLUSPLUS_STD == CPLUSPLUS_11
+#define _CONSTEXPR11 constexpr
+#define _CONSTEXPR14
+#elif CPLUSPLUS_STD == CPLUSPLUS_14
+#define _CONSTEXPR11 constexpr
+#define _CONSTEXPR14 constexpr
+#else
+#error "Unexpected value of CPLUSPLUS_STD"
 #endif

 // Enable compiling with /Wall under VC


INTEGRATION: CWS ooo19126 (1.5.242); FILE MERGED 2005/09/05 13:20:00 rt 1.5.242.1: #i54170# Change license header: remove SISSL

--- sd/inc/sdgrffilter.hxx
+++ sd/inc/sdgrffilter.hxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: sdgrffilter.hxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.6 $
  *
- *  last change: $Author: kz $ $Date: 2005-01-13 17:24:45 $
+ *  last change: $Author: rt $ $Date: 2005-09-09 02:59:56 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/


ParamSpec: fix argument marshalling

ParamSpec: fix argument marshalling

We need to treat GParamSpec and derived classes as gjs_param,
otherwise we fallback on gjs_fundamental and crash.

https://bugzilla.gnome.org/show_bug.cgi?id=725282

--- gi/arg.cpp
+++ gi/arg.cpp
@@ -1489,6 +1489,15 @@

                             if (transfer != GI_TRANSFER_NOTHING)
                                 g_object_ref(G_OBJECT(arg->v_pointer));
+                        } else {
+                            arg->v_pointer = NULL;
+                            wrong = TRUE;
+                        }
+                    } else if (g_type_is_a(gtype, G_TYPE_PARAM)) {
+                        if (gjs_typecheck_param(context, JSVAL_TO_OBJECT(value), gtype, JS_TRUE)) {
+                            arg->v_pointer = gjs_g_param_from_param(context, JSVAL_TO_OBJECT(value));
+                            if (transfer != GI_TRANSFER_NOTHING)
+                                g_param_spec_ref(G_PARAM_SPEC(arg->v_pointer));
                         } else {
                             arg->v_pointer = NULL;
                             wrong = TRUE;
@@ -2537,7 +2546,6 @@
             GIBaseInfo* interface_info;
             GIInfoType interface_type;
             GType gtype;
-            gboolean gtype_is_object, gtype_is_interface;

             interface_info = g_type_info_get_interface(type_info);
             g_assert(interface_info != NULL);
@@ -2876,7 +2884,6 @@
             GIBaseInfo* interface_info;
             GIInfoType interface_type;
             GType gtype;
-            gboolean gtype_is_object, gtype_is_interface;

             interface_info = g_type_info_get_interface(type_info);
             g_assert(interface_info != NULL);
@@ -2905,16 +2912,12 @@
              * don't have to worry about it.
              */

-            gtype_is_object = g_type_is_a(gtype, G_TYPE_OBJECT);
-            gtype_is_interface = g_type_is_a(gtype, G_TYPE_INTERFACE);
-            if (gtype_is_object || gtype_is_interface) {
-                if (gtype_is_object) {
-                    if (transfer != TRANSFER_IN_NOTHING)
-                        g_object_unref(G_OBJECT(arg->v_pointer));
-                } else {
-                    if (transfer != TRANSFER_IN_NOTHING)
-                        gjs_fundamental_unref(context, arg->v_pointer);
-                }
+            if (g_type_is_a(gtype, G_TYPE_OBJECT)) {
+                if (transfer != TRANSFER_IN_NOTHING)
+                    g_object_unref(G_OBJECT(arg->v_pointer));
+            } else if (g_type_is_a(gtype, G_TYPE_PARAM)) {
+                if (transfer != TRANSFER_IN_NOTHING)
+                    g_param_spec_unref(G_PARAM_SPEC(arg->v_pointer));
             } else if (g_type_is_a(gtype, G_TYPE_CLOSURE)) {
                 g_closure_unref((GClosure *) arg->v_pointer);
             } else if (g_type_is_a(gtype, G_TYPE_VALUE)) {


change event positions

change event positions

Change-Id: I5898cd442a1624d35cff8b13190bfbd33b0f0409

--- pcm-tsx.cpp
+++ pcm-tsx.cpp
@@ -114,9 +114,9 @@
 }

-#define TX_CYCLES_POS           (3)
+#define TX_CYCLES_POS           (1)
 #define TX_CYCLES_COMMITED_POS  (2)
-#define N_HLE_POS               (1)
+#define N_HLE_POS               (3)
 #define N_RTM_POS               (0)

 template <class StateType>


Adds sampling tests

Adds sampling tests

tld - distribution tests
rho_hd - hemispherical (ir?)radiance integral

--- pdfcomp.cpp
+++ pdfcomp.cpp
@@ -1,6 +1,8 @@
 #include <iostream>
 #include <iomanip>
 #include <cassert>
+#include "materials/multilayered.h"
+#include "geometries.h"
 #include "sampler.h"
 #include "vec2.h"
 #include "bsdf.h"
@@ -105,16 +107,139 @@
     cout << endl;
   }
   cout << total_integral / num_cells << endl << endl;
-
+}
+
+void compare_tld(const GTR& tld, uint num_samples)
+{
+  UniformSampler sampler;
+
+  const int theta_grid = 1;
+  const int phi_grid = 100;
+
+  sas r[theta_grid][phi_grid];
+
+  for (auto i = 0u; i < num_samples; ++i)
+  {
+    // compute the pdf
+    scalar p;
+    Vec3 dir = tld.sample_micronormal(sampler, p);
+
+    scalar theta, phi;
+    dir.to_euler(theta, phi);
+
+    int theta_i = theta / (2 * PI) * theta_grid ;
+    int phi_i = phi / (PI / 2) * phi_grid ;
+    assert(0 <= theta_i  && theta_i < theta_grid);
+    assert(0 <= phi_i  && phi_i < phi_grid);
+    r[theta_i][phi_i].n += 1;
+    r[theta_i][phi_i].tp += p;
+  }
+
+  const int num_cells = theta_grid * phi_grid;
+
+  scalar total_integral = 0;
+  for (int y = 0; y < theta_grid; ++y)
+  {
+    for (int x = 0; x < phi_grid; ++x)
+    {
+      scalar disp = num_cells * scalar(r[y][x].n) / num_samples;
+      cout << setw(12) << disp;
+      total_integral += disp;
+    }
+    cout << endl;
+  }
+  cout << total_integral / num_cells << endl << endl;
+
+  total_integral = 0;
+  for (int y = 0; y < theta_grid; ++y)
+  {
+    scalar t0 = y * 2 * PI / theta_grid;
+    scalar t1 = (y + 1)* 2 * PI / theta_grid;
+    for (int x = 0; x < phi_grid; ++x)
+    {
+      scalar p0 = x * 0.5 * PI / phi_grid;
+      scalar p1 = (x + 1) * 0.5 * PI / phi_grid;
+      scalar disp = r[y][x].n == 0 ? 0 : num_cells * (r[y][x].tp / r[y][x].n) * solid_angle_area(t0, t1, p0, p1);
+      cout << setw(12) << disp;
+      total_integral += disp;
+    }
+    cout << endl;
+  }
+  cout << total_integral / num_cells << endl << endl;
+
+
+  total_integral = 0;
+  for (int y = 0; y < theta_grid; ++y)
+  {
+    scalar t0 = y * 2 * PI / theta_grid;
+    scalar t1 = (y + 1)* 2 * PI / theta_grid;
+    for (int x = 0; x < phi_grid; ++x)
+    {
+      scalar p0 = x * 0.5 * PI / phi_grid;
+      scalar p1 = (x + 1) * 0.5 * PI / phi_grid;
+      scalar a = r[y][x].n == 0 ? 0 : num_cells * (r[y][x].tp / r[y][x].n) * solid_angle_area(t0, t1, p0, p1);
+      scalar b = num_cells * scalar(r[y][x].n) / num_samples;
+      scalar disp = a - b;
+      cout << setw(12) << disp * 100;
+      total_integral += disp;
+    }
+    cout << endl;
+  }
+  cout << total_integral / num_cells << endl << endl;
+}
+
+
+scalar compute_rho_hd(shared_ptr<Material> mat, const Vec3& incoming, uint num_samples)
+{
+  spectrum r;
+
+  auto p = make_shared<Plane>(Vec3(0, 0, 1), 0.0);
+  Shape s(p, mat);
+  Ray ray(incoming, -incoming);
+  UniformSampler sampler;
+
+  auto t = p->intersect(ray);
+  assert(t.is());
+  Intersection isect(&s, 0, ray, t.get());
+
+  uint valid_samples = 0;
+
+  for (auto i = 0u; i < num_samples; ++i)
+  {
+    scalar p;
+    spectrum reflectance;
+    Vec3 d = mat->sample_bsdf(isect, -ray.direction.normal(), sampler, p, reflectance);
+    if (p == 0)
+      continue;
+    r += reflectance / p * d.z;
+    ++valid_samples;
+  }
+
+  return (r / scalar(num_samples)).luminance();
 }

 int main(int argc, char** args)
 {
+  using namespace refraction_index;
+
   //compare_bsdf(OrenNayar(1.0, 0.3), 100000000);
-  UniformSampler sampler;
-  for (int i = 0; i < 1000; ++i)
-  {
-    auto v = uniform_sample_disc(sampler.sample_2d());
-    cout << v[0] << " " << v[1] << endl;
-  }
-}
+  //auto mat = make_shared<MirrorMaterial>();
+  auto base_mat = make_shared<RoughColorMaterial>(0.0, spectrum(0.0));
+  auto mat = make_shared<MaterialTLDAdapter>(AIR, CROWN_GLASS,
+                                             make_shared<GTR>(0.001));
+  vector<scalar> angles({0.0, 5.0, 10.0, 20.0, 30.0, 45.0, 60.0, 80.0, 85.0, 89.0});
+
+  for (auto deg: angles)
+  {
+    scalar angle = deg * PI / 180.0;
+    auto incoming = Vec3(sin(angle), 0.0, cos(angle)).normal();
+
+    cerr << setw(4) << deg << ": " << compute_rho_hd(mat, incoming, 1000000)
+         << " "
+         << fresnel_reflectance_schlick(incoming, Vec3::z_axis, AIR, CROWN_GLASS)
+         << endl;
+  }
+
+//  compare_tld(GTR(0.1), 10000000);
+  return 0;
+}


Remove some useless code

Remove some useless code

--- peciman.cpp
+++ peciman.cpp
@@ -74,7 +74,7 @@
     peciman->pos.x = i;
     peciman->pos.y = j;
     peciman->direction = RIGHT;
-    peciman->nextDirection = RIGHT;
+    peciman->nextDirection = peciman->direction;
     peciman->state = 1;
 }

@@ -106,7 +106,6 @@
             BlackSquare(peciman->pos.x, peciman->pos.y);
             peciman->pos.x = 0;
             levelMap[peciman->pos.x][peciman->pos.y].Object = RPACMAN;
-            levelMap[peciman->pos.x][peciman->pos.y].Object = REMPTY;
             }

             else if(levelMap[peciman->pos.x+1][peciman->pos.y].Wall == 0){ // Cek apakah ada tembok atau tidak dan print ke array index selanjutnya
@@ -122,7 +121,6 @@
             BlackSquare(peciman->pos.x, peciman->pos.y);
             peciman->pos.x = 19 ;
             levelMap[peciman->pos.x][peciman->pos.y].Object = RPACMAN;
-            levelMap[peciman->pos.x][peciman->pos.y].Object = REMPTY;
             }

             else if(levelMap[peciman->pos.x-1][peciman->pos.y].Wall == 0 ){
@@ -132,7 +130,6 @@
             levelMap[peciman->pos.x][peciman->pos.y].Object = RPACMAN;
             }

-
             break;

         case UP :
@@ -140,7 +137,6 @@
             BlackSquare(peciman->pos.x, peciman->pos.y);
             peciman->pos.x = 19;
             levelMap[peciman->pos.x][peciman->pos.y].Object = RPACMAN;
-            levelMap[peciman->pos.x][peciman->pos.y].Object = REMPTY;
             }

             else if(levelMap[peciman->pos.x][peciman->pos.y-1].Wall == 0){
@@ -156,7 +152,6 @@
             BlackSquare(peciman->pos.x, peciman->pos.y);
             peciman->pos.y = 0;
             levelMap[peciman->pos.x][peciman->pos.y].Object = RPACMAN;
-            levelMap[peciman->pos.x][peciman->pos.y].Object = REMPTY;
             }

             else if(levelMap[peciman->pos.x][peciman->pos.y+1].Wall == 0){


really unbind vao

really unbind vao

--- gl/vao.cpp
+++ gl/vao.cpp
@@ -16,6 +16,7 @@
 	if (!use_vao)
 		return;

+	unbind();
 	glDeleteVertexArrays(1, *this);
 }

@@ -74,4 +75,11 @@
 void gl::vao::unbind()
 {
 	active = nullptr;
+	if (use_vao) {
+		glBindVertexArray(0);
+	}
+	else {
+		for (size_t i = 0; i < 4; i++)
+			glDisableVertexAttribArray(i);
+	}
 }


Added comments

Added comments

--- phoneme.cpp
+++ phoneme.cpp
@@ -1,8 +1,11 @@
 #include "uspeech.h"
-
+/**
+* The recognizer function
+*/
 char signal::getPhoneme(){
 	sample();
 	if(power()>SILENCE){
+		//Low pass filter for noise removal
 		int k = complexity(power());
 		overview[6] = overview[5];
 		overview[5] = overview[4];
@@ -18,12 +21,17 @@
 			f++;
 		}
 		coeff /= 7;
+		//Serial.println(coeff); //Use this for debugging
 #if F_DETECTION > 0
         micPower = 0.05 * maxPower() + (1 - 0.05) * micPower;
-        if (micPower>37) {
+        //Serial.println(micPower)//If you are having trouble with fs
+
+        if (micPower > 37/*Replace this value (37) with your own*/) {
             return 'f';
         }
 #endif
+	//Twiddle with the numbers here if your getting false triggers
+	//This is the main recognizer part
 		if(coeff<30 && coeff>20){
 			return 'u';
 		}
@@ -71,4 +79,4 @@
 		}
 		i++;
 	}
-}+}


Start up active

Start up active

--- grabber.cc
+++ grabber.cc
@@ -206,7 +206,6 @@
 	grabbed_button.state = 0;
 	cursor_select = XCreateFontCursor(dpy, XC_crosshair);
 	xinput = init_xi();
-
 	update_button(prefs.button.get());
 }

@@ -499,11 +498,9 @@
 void Grabber::update_button(ButtonInfo bi) {
 	if (grabbed_button.button == bi.button && grabbed_button.state == bi.state)
 		return;
-	if (grabbed_button.button) {
-		suspended = true;
-		xi_suspended = true;
-		set();
-	}
+	suspended = true;
+	xi_suspended = true;
+	set();
 	buttons.clear();
 	buttons[bi.button] = bi.state;
 	grabbed_button = bi;


make_text_snapshot returns a length value.

We now use that instead of calling strlen.

--- gui/gui.cc
+++ gui/gui.cc
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////
-// $Id: gui.cc,v 1.57 2002/11/24 14:57:43 cbothamy Exp $
+// $Id: gui.cc,v 1.58 2002/12/12 03:41:51 yakovlev Exp $
 /////////////////////////////////////////////////////////////////////////
 //
 //  Copyright (C) 2002  MandrakeSoft S.A.
@@ -345,7 +345,7 @@
   if (!BX_GUI_THIS set_clipboard_text(text_snapshot, len)) {
     // platform specific code failed, use portable code instead
     FILE *fp = fopen("copy.txt", "w");
-    fwrite(text_snapshot, 1, strlen(text_snapshot), fp);
+    fwrite(text_snapshot, 1, len, fp);
     fclose(fp);
   }
   free(text_snapshot);
@@ -376,7 +376,7 @@
     strcpy (filename, "snapshot.txt");
   }
   FILE *fp = fopen(filename, "wb");
-  fwrite(text_snapshot, 1, strlen(text_snapshot), fp);
+  fwrite(text_snapshot, 1, len, fp);
   fclose(fp);
   free(text_snapshot);
 }


- typecast arg3 of pthread_create to the right kind of function pointer

--- gui/rfb.cc
+++ gui/rfb.cc
@@ -892,7 +892,7 @@
 	_beginthread(ServerThreadInit, 0, NULL);
 #else
 	pthread_t      thread;
-	pthread_create(&thread, NULL, (void *)&ServerThreadInit, NULL);
+	pthread_create(&thread, NULL, (void *(*)(void *))&ServerThreadInit, NULL);
 #endif
 }


commandline argument handling

commandline argument handling

--- volution.cpp
+++ volution.cpp
@@ -64,7 +64,7 @@
         if (std::string(argv[i]) == "-a")
             {
                 //initialise desired accuracy variable according to commandline argument -a
-                accuracy = ;
+                accuracy = argv[i + 1];
                 // copy from host to device
                 compute::copy(accuracy,
                     accuracy,
@@ -74,7 +74,7 @@
         if (std::string(argv[i]) == "-p")
             {
                 //initialise maximum polygons variable according to commandline argument -p
-                polygons = ;
+                polygons = argv[i + 1];
                 // copy from host to device
                 compute::copy(accuracy,
                     accuracy,
@@ -84,7 +84,7 @@
         if (std::string(argv[i]) == "-v")
             {
                 //initialise maximum verices per polygon variable according to commandline argument -v
-                vertices = ;
+                vertices = argv[i + 1];
                 // copy from host to device
                 compute::copy(accuracy,
                     accuracy,
@@ -94,11 +94,11 @@

     //create leaderDNA variable
         // generate random dna vector on the host
-        std::vector<float> leaderDNA(1000000);
+        std::vector<int> leaderDNA(1000000);
         std::generate(leaderDNA.begin(), leaderDNA.end(), rand);

         // create vector on the device
-        compute::vector<float> device_leaderDNA(1000000, ctx);
+        compute::vector<int> device_leaderDNA(1000000, ctx);

         // copy data to the device
         compute::copy(
@@ -152,7 +152,7 @@
                 //get x(max), y(max). (image dimensions)

                 //make image vector on device
-                compute::vector<float> originalimage(ctx, n);
+                compute::vector<int> originalimage(ctx, n);
                 // copy data to the device
                 compute::copy(
                     host_vector.begin(),


- use SDL_WarpPointer to keep the mouse from going outside the window.   This must be done carefully though, because the call to SDL_WarpPointer   generates a mouse motion event of its own.  To work around this, I have   added code that should ignore motion events generated by SDL_WarpPointer.   This should fix bug [ 619283 ] SDL: os mouse pointer leaves the window.   On Linux, SDL 1.2.3 it works fine.

--- gui/sdl.cc
+++ gui/sdl.cc
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////
-// $Id: sdl.cc,v 1.23 2002/10/04 10:52:43 vruppert Exp $
+// $Id: sdl.cc,v 1.24 2002/10/06 17:17:14 bdenney Exp $
 /////////////////////////////////////////////////////////////////////////
 //
 //  Copyright (C) 2002  MandrakeSoft S.A.
@@ -70,6 +70,7 @@
 int sdl_fullscreen_toggle;
 int sdl_grab;
 unsigned res_x, res_y;
+unsigned half_res_x, half_res_y;
 int headerbar_height;
 static unsigned bx_bitmap_left_xorigin = 0;  // pixels from left
 static unsigned bx_bitmap_right_xorigin = 0; // pixels from right
@@ -82,6 +83,7 @@
 Bit8u old_mousebuttons=0, new_mousebuttons=0;
 int old_mousex=0, new_mousex=0;
 int old_mousey=0, new_mousey=0;
+Boolean just_warped = false;
 bitmaps *sdl_bitmaps[MAX_SDL_BITMAPS];
 int n_sdl_bitmaps = 0;

@@ -232,7 +234,7 @@
       "Bochs Pentium emulator, http://bochs.sourceforge.net/",
 #endif
       "Bochs" );
-  SDL_WarpMouse(res_x/2, res_y/2);
+  SDL_WarpMouse(half_res_x, half_res_y);
 }

 void bx_gui_c::text_update(
@@ -576,6 +578,21 @@
 	break;

       case SDL_MOUSEMOTION:
+	//fprintf (stderr, "mouse event to (%d,%d), relative (%d,%d)\n", (int)(sdl_event.motion.x), (int)(sdl_event.motion.y), (int)sdl_event.motion.xrel, (int)sdl_event.motion.yrel);
+	if (!sdl_grab) {
+	  //fprintf (stderr, "ignore mouse event because sdl_grab is off\n");
+	  break;
+	}
+	if (just_warped
+	    && sdl_event.motion.x == half_res_x
+	    && sdl_event.motion.y == half_res_y) {
+	  // This event was generated as a side effect of the WarpMouse,
+	  // and it must be ignored.
+	  //fprintf (stderr, "ignore mouse event because it is a side effect of SDL_WarpMouse\n");
+	  just_warped = false;
+	  break;
+	}
+	//fprintf (stderr, "processing relative mouse event\n");
 	new_mousebuttons = ((sdl_event.motion.state & 0x01)|((sdl_event.motion.state>>1)&0x02));
 	bx_devices.keyboard->mouse_motion(
 	    sdl_event.motion.xrel,
@@ -584,6 +601,9 @@
 	old_mousebuttons = new_mousebuttons;
 	old_mousex = (int)(sdl_event.motion.x);
 	old_mousey = (int)(sdl_event.motion.y);
+	//fprintf (stderr, "warping mouse to center\n");
+	SDL_WarpMouse(half_res_x, half_res_y);
+	just_warped = 1;
 	break;

       case SDL_MOUSEBUTTONDOWN:
@@ -801,6 +821,8 @@
   }
   res_x = x;
   res_y = y;
+  half_res_x = x/2;
+  half_res_y = y/2;
   if( fheight > 0 )
   {
     textres_x = x / fontwidth;


Fix &A<> to support an undefined word index.

This patch adds support to &A<> for an undefined word index.
It mostly matches what was done for &PV<>.

--- vvp/array.cc
+++ vvp/array.cc
@@ -30,6 +30,7 @@
 #endif
 # include  <stdlib.h>
 # include  <string.h>
+# include  <limits.h>
 # include  <iostream>
 # include  "compile.h"
 # include  <assert.h>
@@ -132,6 +133,15 @@
       {
 	    if (address_handle) {
 		  s_vpi_value vp;
+		    /* Check to see if the value is defined. */
+		  vp.format = vpiVectorVal;
+		  vpi_get_value(address_handle, &vp);
+		  int words = (vpi_get(vpiSize, address_handle)-1)/32 + 1;
+		  for(int idx = 0; idx < words; idx += 1) {
+			  /* Return UINT_MAX to indicate an X base. */
+			if (vp.value.vector[idx].bval != 0) return UINT_MAX;
+		  }
+		    /* The value is defined so get and return it. */
 		  vp.format = vpiIntVal;
 		  vpi_get_value(address_handle, &vp);
 		  return vp.value.integer;
@@ -145,7 +155,7 @@
 		  vvp_bit4_t bit = vthread_get_bit(vpip_current_vthread, address+idx);
 		  tmp.set_bit(idx, bit);
 	    }
-	    unsigned long val;
+	    unsigned long val = ULONG_MAX;
 	    vector4_to_value(tmp, val);
 	    return val;
       }


bug fix in locdb usage

bug fix in locdb usage

--- cc/chart.cc
+++ cc/chart.cc
@@ -248,6 +248,8 @@
         }
         catch (virus_name::Unrecognized&) {
         }
+        catch (LocationNotFound&) {
+        }
     }

 } // Antigens::continents
@@ -263,6 +265,8 @@
             aCountries[country].push_back(static_cast<size_t>(ag - begin()));
         }
         catch (virus_name::Unrecognized&) {
+        }
+        catch (LocationNotFound&) {
         }
     }

@@ -280,6 +284,8 @@
                 aAntigenIndices.push_back(static_cast<size_t>(ag - begin()));
         }
         catch (virus_name::Unrecognized&) {
+        }
+        catch (LocationNotFound&) {
         }
     }


Убран повтор строчки

Убран повтор строчки

--- servo_robot_module.cpp
+++ servo_robot_module.cpp
@@ -299,11 +299,10 @@

       if (increment) {
         axis_settings.push_back(AxisMinMax(low, top, servo_name));
-        servo_limits.push_back(ServoLimits(i, min, max, start_pos, safe_pos, increment));
       } else{
         axis_settings.push_back(AxisMinMax(min, max, servo_name));
-        servo_limits.push_back(ServoLimits(i, min, max, start_pos, safe_pos, increment));
       }
+      servo_limits.push_back(ServoLimits(i, min, max, start_pos, safe_pos, increment));
     }

     init_error->checkSelf();


Trasf verso accumulo sempre con ACS>70

Trasf verso accumulo sempre con ACS>70

--- control.cpp
+++ control.cpp
@@ -285,7 +285,7 @@
 			xAutoTrasfVersoAccumulo = false;
 		} else if (xCaricoAccumuloAttivo && !xDisabilitaAccumulo) {
 			/* trasf HPSU->Accumulo (salvataggio energia)*/
-			if ((wTemperaturaACS > 500) && (wTemperaturaAccumulo < wTemperaturaACS-60) && !xCaldaiaInUso) {
+			if ((wTemperaturaACS > 500) && ((wTemperaturaAccumulo < wTemperaturaACS-60) || (wTemperaturaACS > 700)) && !xCaldaiaInUso) {
 				xAutoTrasfVersoAccumulo = true;
 			} else if (xCaldaiaInUso || (wTemperaturaACS < 400) || (wTemperaturaAccumulo > wTemperaturaACS-30)) {
 				xAutoTrasfVersoAccumulo = false;


BSE: use BSE_BACKTRACE instead of a Rapicorn macro

Signed-off-by: Tim Janik <6ec6ff229c4e1c5bbd5933ee92e6c5832ff023bb@gnu.org>

--- sfi/tests/misctests.cc
+++ sfi/tests/misctests.cc
@@ -764,7 +764,7 @@
 static int
 my_compare_func (const void*, const void*)
 {
-  RAPICORN_BACKTRACE();
+  BSE_BACKTRACE();
   exit (0);
 }


Removed non-const overload of cu::cow_ptr<T>::operator->().

This helps to avoid making unnecessary copies by accident.

--- cow_ptr.hpp
+++ cow_ptr.hpp
@@ -315,9 +315,6 @@
     // other operators //
     /////////////////////

-    /// Returns the contained pointer. A deep copy may be performed. May Throw!
-    T * operator->();
-
     /// Returns the contained pointer propagating constness.
     const T * operator->() const noexcept;

@@ -467,13 +464,13 @@
     includes repeating the typename of the wrapped pointer.
   @note Do not forget the semicolon at the end of the line. The template
     argument must be an identifier. */
-#define COW_MODIFY(ptr) ptr &= [&](decltype(ptr.operator->()) ptr)
-//                         ^^ this operator is customized for this purpose
+#define COW_MODIFY(ptr) ptr &= [&]( auto * ptr )
+//                          ^^ this operator is customized for this purpose

 /// The const version of @c COW_MODIFY.
 /** It is guaranteed that no internal copy is made, since the @c read()
     member function is called. */
-#define COW_READ(ptr) make_const_ref(ptr) &= [&](decltype(ptr.get()) ptr)
+#define COW_READ(ptr) make_const_ref(ptr) &= [&]( const auto * ptr )
 //                    ^^ this template function is defined later.

 // Helper operator for the implementation of COW_MODIFY
@@ -651,15 +648,6 @@
 void cow_ptr<T>::read( Func f ) const // noexcept( noexcept( f(get()) ) )
 {
     f( get() );
-}
-
-
-template <typename T>
-T * cow_ptr<T>::operator->()
-{
-    assert( *this );
-    moo();
-    return px;
 }


remove redundant using declaration

remove redundant using declaration

--- silicium/to_unique.hpp
+++ silicium/to_unique.hpp
@@ -13,9 +13,4 @@
 	}
 }

-namespace Si
-{
-	using Si::to_unique;
-}
-
 #endif


database: remove outdated comment

database: remove outdated comment

Signed-off-by: Glauber Costa <7ba9037b0dd006f9408bd45b94707becd5cd4e87@scylladb.com>

--- database.cc
+++ database.cc
@@ -2537,11 +2537,7 @@
     // But during pressure condition, we'll just pick the CF that holds the largest
     // memtable. The advantage of doing this is that this is objectively the one that will
     // release the biggest amount of memory and is less likely to be generating tiny
-    // SSTables. The disadvantage is that right now, because we only release memory when the
-    // SSTable is fully written, that may take a bit of time to happen.
-    //
-    // However, since we'll very soon have a mechanism in place to account for the memory
-    // that was already written in one form or another, that disadvantage is mitigated.
+    // SSTables.
     memtable& biggest_memtable = memtable::from_region(*_region_group.get_largest_region());
     auto& biggest_cf = _db->find_column_family(biggest_memtable.schema());
     memtable_list& mtlist = get_memtable_list(biggest_cf);


db: add simple memtable sealing policy

db: add simple memtable sealing policy

Need to be replaced with something better, but we lack the infrastructure so
far (region memory allocator).

--- database.hh
+++ database.hh
@@ -89,6 +89,7 @@
     // generation -> sstable. Ordered by key so we can easily get the most recent.
     std::map<unsigned long, std::unique_ptr<sstables::sstable>> _sstables;
     unsigned _sstable_generation = 1;
+    unsigned _mutation_count = 0;
 private:
     memtable& active_memtable() { return _memtables.back(); }
     struct merge_comparator;
@@ -122,6 +123,7 @@
     template <typename Func>
     bool for_all_partitions(Func&& func) const;
     future<> probe_file(sstring sstdir, sstring fname);
+    void seal_on_overflow();
 public:
     // Iterate over all partitions.  Protocol is the same as std::all_of(),
     // so that iteration can be stopped by returning false.
@@ -246,13 +248,25 @@
 inline
 void
 column_family::apply(const mutation& m) {
-    return active_memtable().apply(m);
+    active_memtable().apply(m);
+    seal_on_overflow();
+}
+
+inline
+void
+column_family::seal_on_overflow() {
+    // FIXME: something better
+    if (++_mutation_count == 10000) {
+        _mutation_count = 0;
+        seal_active_memtable();
+    }
 }

 inline
 void
 column_family::apply(const frozen_mutation& m) {
-    return active_memtable().apply(m);
+    active_memtable().apply(m);
+    seal_on_overflow();
 }

 #endif /* DATABASE_HH_ */


database: add view_stats getter

database: add view_stats getter

It will be used for testing purposes

--- database.hh
+++ database.hh
@@ -830,6 +830,10 @@
         return _stats;
     }

+    const db::view::stats& get_view_stats() const {
+        return _view_stats;
+    }
+
     ::cf_stats* cf_stats() {
         return _config.cf_stats;
     }


+ workaround for strange behaviour of Qt 4.8 regarding period/colon

--- src/Gui/PythonConsole.cpp
+++ src/Gui/PythonConsole.cpp
@@ -539,10 +539,18 @@

           case Qt::Key_Period:
           {
-              // analyse context and show available call tips
-              int contextLength = cursor.position() - inputLineBegin.position();
-              TextEdit::keyPressEvent(e);
-              d->callTipsList->showTips( inputStrg.left( contextLength ) );
+              // In Qt 4.8 there is a strange behaviour because when pressing ":"
+              // then key is also set to 'Period' instead of 'Colon'. So we have
+              // to make sure we only handle the period.
+              if (e->text() == QLatin1String(".")) {
+                  // analyse context and show available call tips
+                  int contextLength = cursor.position() - inputLineBegin.position();
+                  TextEdit::keyPressEvent(e);
+                  d->callTipsList->showTips( inputStrg.left( contextLength ) );
+              }
+              else {
+                  TextEdit::keyPressEvent(e);
+              }
           }   break;

           case Qt::Key_Home:


change inner boost to alias

change inner boost to alias

--- verbalexpressions.hpp
+++ verbalexpressions.hpp
@@ -269,9 +269,9 @@
         else                      toTest = reduceLines(value);

         if(modifiers & GLOBAL)
-            return veregex::regex_search(toTest, boost::regex(pattern, checkFlags()));
+            return veregex::regex_search(toTest, veregex::regex(pattern, checkFlags()));
         else
-            return veregex::regex_match(toTest, boost::regex(pattern, checkFlags()));
+            return veregex::regex_match(toTest, veregex::regex(pattern, checkFlags()));
     }
 };


hail mary

hail mary

--- core/src/main/cpp/worker.cpp
+++ core/src/main/cpp/worker.cpp
@@ -67,6 +67,7 @@

 void NewMatrixCommand::run(Worker *self) const {
   DistMatrix *matrix = new El::DistMatrix<double, El::MC, El::STAR>(numRows, numCols, self->grid);
+  Zero(*matrix);
   ENSURE(self->matrices.insert(std::make_pair(handle, std::unique_ptr<DistMatrix>(matrix))).second);
   self->receiveMatrixBlocks(handle, layout);
   self->peers.barrier();


Fixed compile error with gcc-4.6.3

Fixed compile error with gcc-4.6.3

--- vexcl/fft/kernels.hpp
+++ vexcl/fft/kernels.hpp
@@ -38,7 +38,7 @@

 // Store v=b^e as components.
 struct pow {
-    const size_t base, exponent, value;
+    size_t base, exponent, value;
     pow(size_t b, size_t e) : base(b), exponent(e),
 	value(static_cast<size_t>(std::pow(static_cast<double>(b), static_cast<double>(e)))) {}
 };


46880 is too aggressive and find more io constructor than CINT (i.e. not backward compatible)

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@46881 27541ba8-7e3a-0410-8455-c3a389f83636

--- core/utils/src/rootcling.cxx
+++ core/utils/src/rootcling.cxx
@@ -1929,7 +1929,7 @@
                   argType = argType.getDesugaredType(cl->getASTContext());
                }
                if (argType->isTemplateTypeParmType()) {
-                  return true;
+                  // return true;
                }
             }
          }


Updated transposing method (mmGeometry)

Updated transposing method (mmGeometry)

--- libs/MoMa/features/Geometry/mmGeometry.cpp
+++ libs/MoMa/features/Geometry/mmGeometry.cpp
@@ -348,8 +348,12 @@

 void MoMa::Geometry::placeOnOrigin(MoMa::Track & tr, std::string Pelvis, std::string LHip, std::string RHip)
 {
-	bool isglobal = tr.hasGlobalCoordinate;
-	tr.localToGlobal();
+	bool isLocal = false;
+	if (!tr.hasGlobalCoordinate) {
+
+		isLocal = true;
+		tr.localToGlobal();
+	}

 	//Move coordinate system to initial (i.e. first frame) frontal plane, origin on LHip
 	Trace a;
@@ -376,15 +380,18 @@
 	//Translate (translate track to place pelvis at first frame to 0,0,0)
 	Geometry::translate(tr, -tr(Pelvis)[0u].position(0), -tr(Pelvis)[0u].position(1), -tr(Pelvis)[0u].position(2));

-	if (!isglobal) {
+	if (isLocal)
 		tr.globalToLocal();
-	}
 }

 void  MoMa::Geometry::stickToOrigin(MoMa::Track & tr, std::string LHip, std::string RHip)
 {
-	bool isglobal = tr.hasGlobalCoordinate;
-	tr.localToGlobal();
+	bool isLocal = false;
+	if (!tr.hasGlobalCoordinate) {
+
+		isLocal = true;
+		tr.localToGlobal();
+	}

 	//Move coordinate system to frontal plane, origin between LHip and RHip
 	Trace a = tr(RHip);
@@ -404,16 +411,20 @@
 	c.setPosition(repmat(tmp, 1, tr.nOfFrames()), tr.frameRate(), tr.position.initialTime());
 	tr = Geometry::projection(a, b, c, tr);

-	if (!isglobal) {
+	if (isLocal)
 		tr.globalToLocal();
-	}
 }

 void  MoMa::Geometry::stickToOriginLoose(MoMa::Track & tr, std::string Pelvis, std::string LHip, std::string RHip)
 {
 	placeOnOrigin(tr, Pelvis, LHip, RHip);
-	bool isglobal = tr.hasGlobalCoordinate;
-	tr.localToGlobal();
+
+	bool isLocal = false;
+	if (!tr.hasGlobalCoordinate) {
+
+		isLocal = true;
+		tr.localToGlobal();
+	}

 	//Move origin to Pelvis (at each frame), but do not change orientation of coordinate system
 	Trace a = tr(Pelvis);
@@ -433,9 +444,8 @@
 	c.setPosition(repmat(tmp, 1, tr.nOfFrames()), tr.frameRate(), tr.position.initialTime());
 	tr = Geometry::projection(a, b, c, tr);

-	if (!isglobal) {
+	if (isLocal)
 		tr.globalToLocal();
-	}
 }

 void  MoMa::Geometry::scaleSkeleton(MoMa::Track & tr, float newsize)


Fixed VBO being freed after OpenGL exit

Fixed VBO being freed after OpenGL exit

Former-commit-id: ddd5fb16baa4371ceb917415bc138590cdc16e26

--- src/Nazara/Graphics/ForwardRenderTechnique.cpp
+++ src/Nazara/Graphics/ForwardRenderTechnique.cpp
@@ -223,6 +223,7 @@
 void NzForwardRenderTechnique::Uninitialize()
 {
 	s_quadIndexBuffer.Reset();
+	s_quadVertexBuffer.Reset();
 }

 void NzForwardRenderTechnique::DrawBillboards(const NzScene* scene) const


made ZoomView only react to mouse events if control is pressed

--- ZoomView.cpp
+++ ZoomView.cpp
@@ -130,7 +130,7 @@

 	_mouseDown(zoomedSignal);

-	if (zoomedSignal.processed)
+	if (zoomedSignal.processed || !(signal.modifiers & keys::ControlDown))
 		return;

 	util::point<double> position = signal.position;
@@ -151,9 +151,9 @@
 	position.x /= _scale;
 	position.y /= _scale;

-	// if control is pressed, increase zoom speed
+	// if shift is pressed, increase zoom speed
 	double zoomStep = _zoomStep;
-	if (signal.modifiers & keys::ControlDown)
+	if (signal.modifiers & keys::ShiftDown)
 		zoomStep *= 2;

 	// mouse wheel up
@@ -196,7 +196,7 @@

 	_mouseMove(zoomedSignal);

-	if (zoomedSignal.processed)
+	if (zoomedSignal.processed || !(signal.modifiers & keys::ControlDown))
 		return;

 	if (!_dragging) {
@@ -207,7 +207,7 @@
 	LOG_ALL(zoomviewlog) << "I am in dragging mode" << std::endl;

 	double amp = 1.0;
-	if (signal.modifiers & keys::ControlDown)
+	if (signal.modifiers & keys::ShiftDown)
 		amp = 10.0;

 	// mouse is dragged


Remove obsolte code

Remove obsolte code

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

--- core/utils/src/rootcling.cxx
+++ core/utils/src/rootcling.cxx
@@ -703,83 +703,6 @@

 cling::Interpreter *gInterp = 0;

-#if NOTNEEDED
-const clang::NamedDecl *R__SlowSearchImpl(const char *name, const clang::DeclContext *ctxt = 0)
-{
-   // First find the left most part, search it and proceed with the search inside it.
-
-   int paran = 0;
-   int nest = 0;
-   unsigned int len = strlen(name);
-   for(unsigned int i = 0; i < len; ++i) {
-      switch (name[i]) {
-         case '(' : ++paran; break;
-         case ')' : --paran; break;
-         case '<' : if (paran==0) ++nest; break;
-         case '>' : if (paran==0) --nest; break;
-         case ':' : if (paran==0 && nest==0) {
-            // We got the end of the leftpart.
-            std::string leftpart(name);
-            leftpart[i] = '\0';
-            const clang::NamedDecl *scope = gInterp->LookupDecl(leftpart.c_str(), ctxt).getSingleDecl();
-            if (!scope) {
-               return 0;
-            } else {
-               const clang::DeclContext *scope_ctxt = llvm::dyn_cast<clang::DeclContext>(scope);
-               if (scope_ctxt) {
-                  return R__SlowSearchImpl(name+i+2,scope_ctxt);
-               } else {
-                  return 0;
-               }
-            }
-         }
-      }
-      if (paran < 0 || nest < 0) {
-         // malformed, we can't find it.
-         return 0;
-      }
-   }
-   // If we get here, we have a decomposed named (unqualified),
-   // if the lookup fails, we may have a request for a template instance
-   // and which case, let's use the 'function template' based lookup
-   const clang::NamedDecl *result = gInterp->LookupDecl(name, ctxt).getSingleDecl();
-   if (!result && strchr(name,'<') != 0)
-   {
-      string fullname = name;
-      fullname[ strchr(fullname.c_str(),'<')-fullname.c_str() ] = '\0';
-      const clang::NamedDecl *templateResult = gInterp->LookupDecl(fullname.c_str(), ctxt);
-      if (templateResult) {
-         // The template exist, let's look for an instance.
-         fullname = "";
-         if (ctxt) {
-            R__GetQualifiedName(fullname,*llvm::dyn_cast<clang::NamedDecl>(ctxt));
-            fullname += "::";
-         }
-         fullname += name;
-         clang::QualType type = TMetaUtils::LookupTypeDecl(*gInterp,fullname.c_str());
-         if (!type.isNull()) {
-            const clang::Type *typeptr = type.getTypePtr();
-            if (typeptr) result = type->getAsCXXRecordDecl();
-         }
-      }
-   }
-   return result;
-}
-
-const clang::NamedDecl *R__SlowSearch(const char *name, const clang::DeclContext *ctxt = 0)
-{
-   const clang::NamedDecl *result = R__SlowSearchImpl(name,0);
-
-   if (!result) {
-      // For compatiblity with CINT, we also search the 'std' namespace.
-      static const clang::NamespaceDecl *std_decl = llvm::dyn_cast_or_null<clang::NamespaceDecl>(R__SlowSearchImpl("std"));
-      if (std_decl) {
-         result = R__SlowSearchImpl(name,std_decl);
-      }
-   }
-   return result;
-}
-#endif

 const clang::CXXRecordDecl *R__ScopeSearch(const char *name)
 {
@@ -793,28 +716,6 @@
    }
    return result;
 }
-
-#if NOTNEEDED
-const clang::CXXRecordDecl *R__SlowClassSearch(const char *name)
-{
-   const clang::NamedDecl *result = R__SlowSearch(name,0);
-
-   // Now, let's check with cling's lookupScope
-   const clang::CXXRecordDecl *result_cxx = llvm::dyn_cast_or_null<clang::CXXRecordDecl>(result);
-   const clang::CXXRecordDecl *result_new = R__ScopeSearch(name);
-   if (result_cxx != result_new) {
-      // Humm ok, we are not the same
-      fprintf(stderr,"Error: lookupScope disagree with R__SlowSearchImpl on %s: lookupScope: %s slowClassSearch: %s\n",
-              name, result_new ? R__GetQualifiedName(*result_new).c_str() : " nothing ", result ? R__GetQualifiedName(*result_cxx).c_str() : " nothing ");
-   }
-
-   if (result) {
-      return llvm::dyn_cast<clang::CXXRecordDecl>(result);
-   } else {
-      return 0;
-   }
-}
-#endif

 const clang::Type *R__GetUnderlyingType(clang::QualType type)
 {
@@ -1650,80 +1551,6 @@

 }

-#if NOTNEEDED
-//______________________________________________________________________________
-bool CheckInputOperator(G__ClassInfo &cl, int dicttype)
-{
-   // Check if the operator>> has been properly declared if the user has
-   // resquested a custom version.
-
-   bool has_input_error = false;
-
-   // Need to find out if the operator>> is actually defined for
-   // this class.
-   G__ClassInfo gcl;
-   long offset;
-
-   int ncha = strlen(cl.Fullname())+13;
-   char *proto = new char[ncha];
-   snprintf(proto,ncha,"TBuffer&,%s*&",cl.Fullname());
-
-   G__MethodInfo methodinfo = gcl.GetMethod("operator>>",proto,&offset);
-
-   Info(0, "Class %s: Do not generate operator>>()\n",
-        cl.Fullname());
-   G__MethodArgInfo args( methodinfo );
-   args.Next(); args.Next();
-   if (!methodinfo.IsValid() ||
-       !args.IsValid() ||
-       args.Type()==0 ||
-       args.Type()->Tagnum() != cl.Tagnum() ||
-       strstr(methodinfo.FileName(),"TBuffer.h")!=0 ||
-       strstr(methodinfo.FileName(),"Rtypes.h" )!=0) {
-
-      if (dicttype==0||dicttype==1){
-         // We don't want to generate duplicated error messages in several dictionaries (when generating temporaries)
-         Error(0,
-               "in this version of ROOT, the option '!' used in a linkdef file\n"
-               "       implies the actual existence of customized operators.\n"
-               "       The following declaration is now required:\n"
-               "   TBuffer &operator>>(TBuffer &,%s *&);\n",cl.Fullname());
-
-      }
-
-      has_input_error = true;
-   } else {
-      // Warning(0, "TBuffer &operator>>(TBuffer &,%s *&); defined at line %s %d \n",cl.Fullname(),methodinfo.FileName(),methodinfo.LineNumber());
-   }
-   // fprintf(stderr, "DEBUG: %s %d\n",methodinfo.FileName(),methodinfo.LineNumber());
-
-   methodinfo = gcl.GetMethod("operator<<",proto,&offset);
-   args.Init(methodinfo);
-   args.Next(); args.Next();
-   if (!methodinfo.IsValid() ||
-       !args.IsValid() ||
-       args.Type()==0 ||
-       args.Type()->Tagnum() != cl.Tagnum() ||
-       strstr(methodinfo.FileName(),"TBuffer.h")!=0 ||
-       strstr(methodinfo.FileName(),"Rtypes.h" )!=0) {
-
-      if (dicttype==0||dicttype==1){
-         Error(0,
-               "in this version of ROOT, the option '!' used in a linkdef file\n"
-               "       implies the actual existence of customized operator.\n"
-               "       The following declaration is now required:\n"
-               "   TBuffer &operator<<(TBuffer &,const %s *);\n",cl.Fullname());
-      }
-
-      has_input_error = true;
-   } else {
-      //fprintf(stderr, "DEBUG: %s %d\n",methodinfo.FileName(),methodinfo.LineNumber());
-   }
-
-   delete [] proto;
-   return has_input_error;
-}
-#endif

 //______________________________________________________________________________
 bool CheckInputOperator(const char *what, const char *proto, const string &fullname, const clang::RecordDecl *cl, int dicttype)
@@ -2171,42 +1998,6 @@
    return (cl.HasMethod("Class_Name") && !cl.IsTmplt());
 }

-#if NOTNEEDED
-//______________________________________________________________________________
-bool NeedTemplateKeyword(G__ClassInfo &cl)
-{
-   if (cl.IsTmplt()) {
-      char *templatename = StrDup(cl.Fullname());
-      char *loc = strstr(templatename, "<");
-      if (loc) *loc = 0;
-      struct G__Definedtemplateclass *templ = G__defined_templateclass(templatename);
-      if (templ) {
-
-         int current = cl.Tagnum();
-         G__IntList * ilist = templ->instantiatedtagnum;
-         while(ilist) {
-            if (ilist->i == current) {
-               delete [] templatename;
-               // This is an automatically instantiated templated class.
-               return true;
-            }
-            ilist = ilist->next;
-         }
-
-         delete [] templatename;
-         // This is a specialized templated class
-         return false;
-
-      } else {
-
-         delete [] templatename;
-         // It might be a specialization without us seeing the template definition
-         return false;
-      }
-   }
-   return false;
-}
-#endif

 //______________________________________________________________________________
 bool NeedTemplateKeyword(const clang::CXXRecordDecl *cl)
@@ -2590,7 +2381,7 @@
    // been resolved here.
    return StringBasedIsTemplateFloat16Double32("Float16_t",cl.GetRequestedName());

-#if NOTNEEDED
+#if KEEP_UNTIL_WE_RESOLVE_THE_TYPEDEF_AND_TEMPLATE_ISSUE
    // Return true if any of the argument is or contains a Float16.
    if (!clinfo.IsTmplt()) return false;

@@ -2662,7 +2453,7 @@
    // been resolved here.
    return StringBasedIsTemplateFloat16Double32("Double32_t",cl.GetRequestedName());

-#if NOTNEEDED
+#if KEEP_UNTIL_WE_RESOLVE_THE_TYPEDEF_AND_TEMPLATE_ISSUE
    if (!cl.IsTmplt()) return false;

    static G__TypeInfo ti;
@@ -2719,31 +2510,6 @@
 #endif
 }

-#if NOTNEEDED
-//______________________________________________________________________________
-bool IsSTLBitset(G__DataMemberInfo &m)
-{
-   // Is this a std::bitset
-
-   const char *s = m.Type()->TrueName();
-   if (!s) return false;
-
-   string type(s);
-   return TClassEdit::IsSTLBitset(type.c_str());
-}
-
-//______________________________________________________________________________
-bool IsSTLBitset(G__BaseClassInfo &m)
-{
-   // Is this a std::bitset
-
-   const char *s = m.Name();
-   if (!s) return false;
-
-   string type(s);
-   return TClassEdit::IsSTLBitset(type.c_str());
-}
-#endif

 //______________________________________________________________________________
 int IsSTLContainer(G__DataMemberInfo &m)


RenderLayerScrollableArea shouldn't call updateLayerCompositingState

Conceptually, there's no reason for RenderLayerScrollableArea to call
updateLayerCompositingState and no tests fail when the call is removed.

BUG=343756,336251

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

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@175937 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/core/rendering/RenderLayerScrollableArea.cpp
+++ Source/core/rendering/RenderLayerScrollableArea.cpp
@@ -679,16 +679,6 @@
     }

     updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollableVerticalOverflow());
-
-    {
-        // FIXME: We should not be allowing repaint during layout. crbug.com/336251
-        AllowPaintInvalidationScope scoper(box().view()->frameView());
-
-        // FIXME: Remove incremental compositing updates after fixing the chicken/egg issues
-        // https://code.google.com/p/chromium/issues/detail?id=343756
-        DisableCompositingQueryAsserts disabler;
-        box().view()->compositor()->updateLayerCompositingState(box().layer());
-    }
 }

 bool RenderLayerScrollableArea::hasHorizontalOverflow() const


Output the reference length when done

Output the reference length when done

--- libvcf2multialign/read_single_fasta_seq.cc
+++ libvcf2multialign/read_single_fasta_seq.cc
@@ -70,6 +70,6 @@

 		std::cerr << "Reading reference FASTA into memory…";
 		reader.parse(ref_fasta_handle, cb);
-		std::cerr << " Done." << std::endl;
+		std::cerr << " Done. Reference length was " << reference.size() << '.' << std::endl;
 	}
 }


Re-add line too eagerly removed by r48883

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@46887 27541ba8-7e3a-0410-8455-c3a389f83636

--- core/utils/src/rootcling.cxx
+++ core/utils/src/rootcling.cxx
@@ -5651,7 +5651,11 @@

          // make name of dict include file "aapDict.cxx" -> "aapDict.h"
          int  nl = 0;
-
+         char *s = strrchr(dictname, '.');
+         if (s) *s = 0;
+         string inclf(dictname); inclf += ".h";
+         if (s) *s = '.';
+
          // during copy put dict include on top and remove later reference
          while (fgets(line, BUFSIZ, fp)) {
             if (!strncmp(line, "#include", 8) && strstr(line, "\" //newlink 3678 "))
@@ -5661,7 +5665,8 @@

             // 'linesToSkip' is because we want to put it after #defined private/protected
             if (++nl == linesToSkip && icc) {
-
+               fprintf(fpd, "#include \"%s\"\n", inclf.c_str());
+
                if (gNeedCollectionProxy) {
                   fprintf(fpd, "\n#include \"TCollectionProxyInfo.h\"");
                }