Update capture.cpp

Update capture.cpp

--- capture.cpp
+++ capture.cpp
@@ -448,7 +448,7 @@
     // ZWO recommends timeout = (exposure*2) + 500 ms
     long timeout = ((exposureTimeMicroseconds * 2) / US_IN_MS) + 500;	// timeout is in ms

-    sprintf(debugText, "  > Exposure set to %'ld Âµs (%'.2f ms), timeout: %'ld ms\n",
+    sprintf(debugText, "  > Exposure set to %'ld µs (%'.2f ms), timeout: %'ld ms\n",
             exposureTimeMicroseconds, (float)exposureTimeMicroseconds/US_IN_MS, timeout);
     displayDebugText(debugText, 2);

@@ -463,13 +463,13 @@
         }
         else {
             ASIGetControlValue(cameraId, ASI_EXPOSURE, &actualExposureMicroseconds, &wasAutoExposure);
-            sprintf(debugText, "  > Got image @ exposure: %'ld Âµs (%'.2f ms)\n", actualExposureMicroseconds, (float)actualExposureMicroseconds/US_IN_MS);
+            sprintf(debugText, "  > Got image @ exposure: %'ld µs (%'.2f ms)\n", actualExposureMicroseconds, (float)actualExposureMicroseconds/US_IN_MS);
             displayDebugText(debugText, 2);

             // If this was a manual exposure, make sure it took the correct exposure.
             if (wasAutoExposure == ASI_FALSE && exposureTimeMicroseconds != actualExposureMicroseconds)
             {
-                sprintf(debugText, "  > WARNING: not correct exposure (requested: %'ld Âµs, actual: %'ld Âµs, diff: %'ld)\n", exposureTimeMicroseconds, actualExposureMicroseconds, actualExposureMicroseconds - exposureTimeMicroseconds);
+                sprintf(debugText, "  > WARNING: not correct exposure (requested: %'ld µs, actual: %'ld µs, diff: %'ld)\n", exposureTimeMicroseconds, actualExposureMicroseconds, actualExposureMicroseconds - exposureTimeMicroseconds);
                 displayDebugText(debugText, 0);
                 status = (ASI_ERROR_CODE) -1;
             }
@@ -673,7 +673,7 @@
     if (dayOrNight == "DAY")
     {
         totalTimeInSec = (asiDayExposure / US_IN_SEC) + (dayDelay / MS_IN_SEC);
-        sprintf(debugText,"xxx totalTimeInSec=%.1fs, asiDayExposure=%'dÂµs , daydelay=%'dms\n", totalTimeInSec, asiDayExposure, dayDelay);
+        sprintf(debugText,"xxx totalTimeInSec=%.1fs, asiDayExposure=%'dµs , daydelay=%'dms\n", totalTimeInSec, asiDayExposure, dayDelay);
         displayDebugText(debugText, 2);
     }
     else	// NIGHT
@@ -1302,8 +1302,8 @@
         printf(" -width                             - Default = %d = Camera Max Width\n", DEFAULT_WIDTH);
         printf(" -height                            - Default = %d = Camera Max Height\n", DEFAULT_HEIGHT);
         printf(" -daytime                           - Default = %d - Set to 1 to enable daytime images\n", DEFAULT_DAYTIMECAPTURE);
-        printf(" -dayexposure                       - Default = %'d - Time in Âµs (equals to %.4f sec)\n", DEFAULT_ASIDAYEXPOSURE, (float)DEFAULT_ASIDAYEXPOSURE/US_IN_SEC);
-        printf(" -nightexposure                     - Default = %'d - Time in Âµs (equals to %.4f sec)\n", DEFAULT_ASINIGHTEXPOSURE, (float)DEFAULT_ASINIGHTEXPOSURE/US_IN_SEC);
+        printf(" -dayexposure                       - Default = %'d - Time in µs (equals to %.4f sec)\n", DEFAULT_ASIDAYEXPOSURE, (float)DEFAULT_ASIDAYEXPOSURE/US_IN_SEC);
+        printf(" -nightexposure                     - Default = %'d - Time in µs (equals to %.4f sec)\n", DEFAULT_ASINIGHTEXPOSURE, (float)DEFAULT_ASINIGHTEXPOSURE/US_IN_SEC);
         printf(" -nightmaxexposure                  - Default = %'d - Time in ms (equals to %.1f sec)\n", DEFAULT_ASINIGHTMAXEXPOSURE, (float)DEFAULT_ASINIGHTMAXEXPOSURE/US_IN_MS);

         printf(" -dayautoexposure                   - Default = %d - Set to 1 to enable daytime auto Exposure\n", DEFAULT_DAYAUTOEXPOSURE);
@@ -1462,7 +1462,7 @@
     iMaxHeight = ASICameraInfo.MaxHeight;
     pixelSize  = ASICameraInfo.PixelSize;
     printf("  - Resolution:%dx%d\n", iMaxWidth, iMaxHeight);
-    printf("  - Pixel Size: %1.1fÎ¼m\n", pixelSize);
+    printf("  - Pixel Size: %1.1fμm\n", pixelSize);
     printf("  - Supported Bin: ");
     for (int i = 0; i < 16; ++i)
     {
@@ -1817,7 +1817,7 @@
                 }
 		else
                 {
-                    sprintf(textBuffer, "Using last night exposure of %'ld Âµs (%'.2lf ms)\n", currentExposure, (float)currentExposure / US_IN_MS);
+                    sprintf(textBuffer, "Using last night exposure of %'ld µs (%'.2lf ms)\n", currentExposure, (float)currentExposure / US_IN_MS);
                     displayDebugText(textBuffer, 2);
                 }
 #ifndef USE_HISTOGRAM
@@ -1922,8 +1922,8 @@

         // As of April 2021 there's a bug that causes the first 3 images to be identical,
         // so take 3 short ones but don't save them.
-        // On the ASI178MC the shortest time is 10010 Âµs; it may be higher on other cameras,
-        // so use a higher value like 30,000 Âµs to be safe.
+        // On the ASI178MC the shortest time is 10010 µs; it may be higher on other cameras,
+        // so use a higher value like 30,000 µs to be safe.
         // Only do this once.
         if (numExposures == 0) {
 #define SHORT_EXPOSURE 30000
@@ -1951,7 +1951,7 @@
             // Restore correct exposure times and auto-exposure mode.
             currentAutoExposure = savedAutoExposure;
             setControl(CamNum, ASI_EXPOSURE, currentExposure, currentAutoExposure);
-            sprintf(debugText, "...DONE.  Reset exposure to %'ld Âµs\n", currentExposure);
+            sprintf(debugText, "...DONE.  Reset exposure to %'ld µs\n", currentExposure);
             displayDebugText(debugText, 2);
             // END of bug code
         }
@@ -2058,7 +2058,7 @@

                     while ((mean < minAcceptableHistogram || mean > maxAcceptableHistogram) && ++attempts <= maxHistogramAttempts)
                     {
-                        sprintf(textBuffer, "  > Attempt %i,  current exposure %'ld Âµs,  mean %d,  temp min exposure %ld Âµs,  tempMaxExposure %'ld Âµs", attempts, currentExposure, mean, tempMinExposure, tempMaxExposure);
+                        sprintf(textBuffer, "  > Attempt %i,  current exposure %'ld µs,  mean %d,  temp min exposure %ld µs,  tempMaxExposure %'ld µs", attempts, currentExposure, mean, tempMinExposure, tempMaxExposure);
                          displayDebugText(textBuffer, 2);

 			 std::string why;	// Why did we adjust the exposure?  For debugging
@@ -2125,7 +2125,7 @@
                          newExposure = std::max(tempMinExposure, newExposure);
                          newExposure = std::min(newExposure, cameraMaxAutoExposureUS);

-                         sprintf(textBuffer, ",  new exposure %'ld Âµs\n", newExposure);
+                         sprintf(textBuffer, ",  new exposure %'ld µs\n", newExposure);
                          displayDebugText(textBuffer, 2);

                          if (newExposure == currentExposure)
@@ -2135,7 +2135,7 @@
                              // use the most recent exposure that was OK.
                              if (mean >= 254 && 0) {	// xxxxxxxxxxxxxxxxxxxx This needs work so disabled
                                  currentExposure = last_OK_exposure;
-                                 sprintf(textBuffer, "  > !!! Resetting to last OK exposure of '%ld Âµs\n", currentExposure);
+                                 sprintf(textBuffer, "  > !!! Resetting to last OK exposure of '%ld µs\n", currentExposure);
                                  displayDebugText(textBuffer, 2);
                                  takeOneExposure(CamNum, currentExposure, pRgb.data, width, height, (ASI_IMG_TYPE) Image_type);
                                  computeHistogram(pRgb.data, width, height, (ASI_IMG_TYPE) Image_type, histogram);
@@ -2146,7 +2146,7 @@

                          currentExposure = newExposure;

-                         sprintf(textBuffer, "  > !!! Retrying @ %'ld Âµs because '%s (%d)'\n", currentExposure, why.c_str(), num);
+                         sprintf(textBuffer, "  > !!! Retrying @ %'ld µs because '%s (%d)'\n", currentExposure, why.c_str(), num);
                          displayDebugText(textBuffer, 2);
                          takeOneExposure(CamNum, currentExposure, pRgb.data, width, height, (ASI_IMG_TYPE) Image_type);
                          computeHistogram(pRgb.data, width, height, (ASI_IMG_TYPE) Image_type, histogram);
@@ -2154,17 +2154,17 @@
                     }
                     if (attempts > maxHistogramAttempts)
                     {
-                         sprintf(textBuffer, "  > max attempts reached - using exposure of %'ld Âµs with mean %d\n", currentExposure, mean);
+                         sprintf(textBuffer, "  > max attempts reached - using exposure of %'ld µs with mean %d\n", currentExposure, mean);
                          displayDebugText(textBuffer, 2);
                     }
                     else if (attempts > 1)
                     {
-                         sprintf(textBuffer, "  > Using exposure of %'ld Âµs with mean %d\n", currentExposure, mean);
+                         sprintf(textBuffer, "  > Using exposure of %'ld µs with mean %d\n", currentExposure, mean);
                          displayDebugText(textBuffer, 2);
                     }
                     else if (attempts == 1)
                     {
-                         sprintf(textBuffer, "  > Current exposure of %'ld Âµs with mean %d was ok - no additional attempts needed.\n", currentExposure, mean);
+                         sprintf(textBuffer, "  > Current exposure of %'ld µs with mean %d was ok - no additional attempts needed.\n", currentExposure, mean);
                          displayDebugText(textBuffer, 2);
                     }
                     actualExposureMicroseconds = currentExposure;
@@ -2370,7 +2370,7 @@
                                     char *line = NULL;
                                     size_t len = 0;
                                     while (getline(&line, &len, fp) != -1) {
-                                        if (line[strlen(line)-1] == 10) {  // linefeed
+                                        if (line[strlen(line)-1] == 10 || line[strlen(line-1)] == 13) {  // Linefeed, Carriage Return
                                             line[strlen(line)-1] = '\0';
                                         }
                                         cvText(pRgb, line, iTextX, iTextY + (iYOffset / currentBin), fontsize * SMALLFONTSIZE_MULTIPLIER, linewidth, linetype[linenumber], fontname[fontnumber], smallFontcolor, Image_type, outlinefont);
@@ -2407,7 +2407,7 @@
                     int64 et = cvGetTickCount();
                     pthread_mutex_unlock(&mtx_SaveImg);

-                    sprintf(textBuffer, "  (%.0f Âµs)\n", timeDiff(st, et));
+                    sprintf(textBuffer, "  (%.0f µs)\n", timeDiff(st, et));
                     displayDebugText(textBuffer, 0);
                 }
                 else


planning: disable align_prediction_time to allow rosbag replay works for planning.

--- modules/planning/common/planning_gflags.cc
+++ modules/planning/common/planning_gflags.cc
@@ -128,7 +128,7 @@

 // Prediction Part
 DEFINE_double(prediction_total_time, 5.0, "Total prediction time");
-DEFINE_bool(align_prediction_time, true,
+DEFINE_bool(align_prediction_time, false,
             "enable align prediction data based planning time");

 // Trajectory


Update S7_Pointer_in_functions.cpp

Update S7_Pointer_in_functions.cpp

--- C++Tutorials/Step_7/S7_Pointer_in_functions.cpp
+++ C++Tutorials/Step_7/S7_Pointer_in_functions.cpp
@@ -1,3 +1,14 @@
+//
+//  Program Name - S7_Pointer_in_functions.cpp
+//  Series: GetOnToC++ Step: 7
+//
+//  Purpose: This program illustrates how to and the benefits of pointers in functions
+//
+//  Compile: g++ S7_Pointer_in_functions.cpp -o S7_Pointer_in_functions
+//  Execute: ./S7_Pointer_in_functions
+//
+//  Created by Narayan Mahadevan on 18/08/13.
+//
 #include <iostream>
 using namespace std;


demux: dash: missing initializer (cid #1260244)

--- modules/stream_filter/dash/mpd/Segment.cpp
+++ modules/stream_filter/dash/mpd/Segment.cpp
@@ -253,7 +253,7 @@
 IndexSegment::IndexSegmentChunk::IndexSegmentChunk(ISegment *segment, const std::string &url)
     : SegmentChunk(segment, url)
 {
-
+    rep = NULL;
 }

 void IndexSegment::IndexSegmentChunk::setIndexRepresentation(Representation *rep_)


ring: Make assertion more informative

ring: Make assertion more informative

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

--- src/ring.cc
+++ src/ring.cc
@@ -759,7 +759,7 @@
 		return TRUE;
 	}

-	g_assert(position < ring->writable);
+	g_assert_cmpuint(position, <, ring->writable);
 	if (!_vte_ring_read_row_record (ring, &records[0], position))
 		return FALSE;
 	if ((position + 1) * sizeof (records[0]) < _vte_stream_head (ring->row_stream)) {


Push unlocked_until in getinfo.

Push unlocked_until in getinfo.

--- src/rpc.cpp
+++ src/rpc.cpp
@@ -36,6 +36,9 @@
 typedef Value(*rpcfn_type)(const Array& params, bool fHelp);
 extern map<string, rpcfn_type> mapCallTable;

+static int64 nWalletUnlockTime;
+static CCriticalSection cs_nWalletUnlockTime;
+

 Object JSONRPCError(int code, const string& message)
 {
@@ -311,6 +314,8 @@
     obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
     obj.push_back(Pair("keypoolsize",   pwalletMain->GetKeyPoolSize()));
     obj.push_back(Pair("paytxfee",      ValueFromAmount(nTransactionFee)));
+    if (pwalletMain->IsCrypted())
+        obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime));
     obj.push_back(Pair("errors",        GetWarnings("statusbar")));
     return obj;
 }
@@ -1360,31 +1365,29 @@

 void ThreadCleanWalletPassphrase(void* parg)
 {
-    static int64 nWakeTime;
     int64 nMyWakeTime = GetTime() + *((int*)parg);
-    static CCriticalSection cs_nWakeTime;
-
-    if (nWakeTime == 0)
-    {
-        CRITICAL_BLOCK(cs_nWakeTime)
-        {
-            nWakeTime = nMyWakeTime;
-        }
-
-        while (GetTime() < nWakeTime)
-            Sleep(GetTime() - nWakeTime);
-
-        CRITICAL_BLOCK(cs_nWakeTime)
-        {
-            nWakeTime = 0;
+
+    if (nWalletUnlockTime == 0)
+    {
+        CRITICAL_BLOCK(cs_nWalletUnlockTime)
+        {
+            nWalletUnlockTime = nMyWakeTime;
+        }
+
+        while (GetTime() < nWalletUnlockTime)
+            Sleep(GetTime() - nWalletUnlockTime);
+
+        CRITICAL_BLOCK(cs_nWalletUnlockTime)
+        {
+            nWalletUnlockTime = 0;
         }
     }
     else
     {
-        CRITICAL_BLOCK(cs_nWakeTime)
-        {
-            if (nWakeTime < nMyWakeTime)
-                nWakeTime = nMyWakeTime;
+        CRITICAL_BLOCK(cs_nWalletUnlockTime)
+        {
+            if (nWalletUnlockTime < nMyWakeTime)
+                nWalletUnlockTime = nMyWakeTime;
         }
         free(parg);
         return;


rollback

rollback

--- src/rpi.cpp
+++ src/rpi.cpp
@@ -1155,9 +1155,12 @@
         uint8_t depth = 24;
         uint8_t bpp = 32;

-        //int res = drmModeAddFB(driDevice, mode_info.hdisplay, mode_info.vdisplay, depth, bpp, pitch, handle, &fb);
+        int res = drmModeAddFB(driDevice, mode_info.hdisplay, mode_info.vdisplay, depth, bpp, pitch, handle, &fb);

         //cbxx check drmModeAddFB2
+        /*
+        //TODO #include "libkms.h"
+        //FIXME DRM_FORMAT_XRGB8888 not found
         uint32_t format = DRM_FORMAT_XRGB8888;
         uint32_t handles[4];
         uint32_t pitches[4];
@@ -1167,6 +1170,7 @@
         kms_bo_get_prop(bo, KMS_HANDLE, &handles[0]);

         int res = drmModeAddFB2(driDevice, mode_info.hdisplay, mode_info.vdisplay, format, handles, pitches, offsets, &fb, plane_flags);
+        */

         assert(res == 0);


fixed build issue

fixed build issue

git-svn-id: 4f0141143c3c635d33f1b9f02fcb2b6c73e45c89@5640 a83610d8-ad2a-0410-a6ab-fc0612d85776

--- src/rsa.cpp
+++ src/rsa.cpp
@@ -95,11 +95,12 @@
 	if (keypair == 0) return false;

 	bool ret = false;
+	unsigned char* pub = (unsigned char*)public_key;
+	unsigned char* priv = (unsigned char*)private_key;
+
 	if (RSA_size(keypair) > *public_len) goto getout;
 	if (RSA_size(keypair) > *private_len) goto getout;

-	unsigned char* pub = (unsigned char*)public_key;
-	unsigned char* priv = (unsigned char*)private_key;
 	*public_len = i2d_RSAPublicKey(keypair, &pub);
 	*private_len = i2d_RSAPrivateKey(keypair, &priv);


Fix copy/paste typo

Fix copy/paste typo

--- src/rule.cc
+++ src/rule.cc
@@ -179,56 +179,56 @@
 }

-bool Rule::evaluateActions(Transaction *trasn) {
+bool Rule::evaluateActions(Transaction *trans) {
     return true;
 }

-void Rule::updateMatchedVars(Transaction *trasn, std::string key,
+void Rule::updateMatchedVars(Transaction *trans, std::string key,
     std::string value) {
-    trasn->debug(4, "Matched vars updated.");
-    trasn->m_variableMatchedVar.set(value, trasn->m_variableOffset);
-    trasn->m_variableMatchedVarName.set(key, trasn->m_variableOffset);
-
-    trasn->m_variableMatchedVars.set(key, value, trasn->m_variableOffset);
-    trasn->m_variableMatchedVarsNames.set(key, key, trasn->m_variableOffset);
-}
-
-
-void Rule::cleanMatchedVars(Transaction *trasn) {
-    trasn->debug(4, "Matched vars cleaned.");
-    trasn->m_variableMatchedVar.unset();
-    trasn->m_variableMatchedVars.unset();
-    trasn->m_variableMatchedVarName.unset();
-    trasn->m_variableMatchedVarsNames.unset();
-}
-
-
-void Rule::updateRulesVariable(Transaction *trasn) {
+    trans->debug(4, "Matched vars updated.");
+    trans->m_variableMatchedVar.set(value, trans->m_variableOffset);
+    trans->m_variableMatchedVarName.set(key, trans->m_variableOffset);
+
+    trans->m_variableMatchedVars.set(key, value, trans->m_variableOffset);
+    trans->m_variableMatchedVarsNames.set(key, key, trans->m_variableOffset);
+}
+
+
+void Rule::cleanMatchedVars(Transaction *trans) {
+    trans->debug(4, "Matched vars cleaned.");
+    trans->m_variableMatchedVar.unset();
+    trans->m_variableMatchedVars.unset();
+    trans->m_variableMatchedVarName.unset();
+    trans->m_variableMatchedVarsNames.unset();
+}
+
+
+void Rule::updateRulesVariable(Transaction *trans) {
     if (m_ruleId != 0) {
-        trasn->m_variableRule.set("id",
+        trans->m_variableRule.set("id",
             std::to_string(m_ruleId), 0);
     }
     if (m_rev.empty() == false) {
-        trasn->m_variableRule.set("rev",
+        trans->m_variableRule.set("rev",
             m_rev, 0);
     }
     if (getActionsByName("msg").size() > 0) {
         actions::Msg *msg = dynamic_cast<actions::Msg*>(
             getActionsByName("msg")[0]);
-        trasn->m_variableRule.set("msg",
-           msg->data(trasn), 0);
+        trans->m_variableRule.set("msg",
+           msg->data(trans), 0);
     }
     if (getActionsByName("logdata").size() > 0) {
         actions::LogData *data = dynamic_cast<actions::LogData*>(
             getActionsByName("logdata")[0]);
-        trasn->m_variableRule.set("logdata",
-            data->data(trasn), 0);
+        trans->m_variableRule.set("logdata",
+            data->data(trans), 0);
     }
     if (getActionsByName("severity").size() > 0) {
         actions::Severity *data = dynamic_cast<actions::Severity*>(
             getActionsByName("severity")[0]);
-        trasn->m_variableRule.set("severity",
+        trans->m_variableRule.set("severity",
             std::to_string(data->m_severity), 0);
     }
 }
@@ -249,12 +249,12 @@
 }

-void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trasn,
+void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trans,
     bool *containsDisruptive, RuleMessage *ruleMessage) {
     for (Action *a : this->m_actionsRuntimePos) {
         if (a->isDisruptive() == true) {
             if (a->m_name == "pass") {
-                trasn->debug(4, "Rule contains a `pass' action");
+                trans->debug(4, "Rule contains a `pass' action");
             } else {
                 *containsDisruptive = true;
             }
@@ -262,16 +262,16 @@
             if (a->m_name == "setvar"
                 || a->m_name == "msg"
                 || a->m_name == "log") {
-                trasn->debug(4, "Running [I] (_non_ disruptive) " \
+                trans->debug(4, "Running [I] (_non_ disruptive) " \
                     "action: " + a->m_name);
-                    a->evaluate(this, trasn, ruleMessage);
-            }
-        }
-    }
-}
-
-
-bool Rule::executeOperatorAt(Transaction *trasn, std::string key,
+                    a->evaluate(this, trans, ruleMessage);
+            }
+        }
+    }
+}
+
+
+bool Rule::executeOperatorAt(Transaction *trans, std::string key,
     std::string value, RuleMessage *ruleMessage) {
 #if MSC_EXEC_CLOCK_ENABLED
     clock_t begin = clock();
@@ -280,11 +280,11 @@
 #endif
     bool ret;

-    trasn->debug(9, "Target value: \"" + utils::string::limitTo(80,
+    trans->debug(9, "Target value: \"" + utils::string::limitTo(80,
             utils::string::toHexIfNeeded(value)) \
             + "\" (Variable: " + key + ")");

-    ret = this->m_op->evaluateInternal(trasn, this, value, ruleMessage);
+    ret = this->m_op->evaluateInternal(trans, this, value, ruleMessage);
     if (ret == false) {
         return false;
     }
@@ -293,7 +293,7 @@
     end = clock();
     elapsed_s = static_cast<double>(end - begin) / CLOCKS_PER_SEC;

-    trasn->debug(4, "Operator completed in " + \
+    trans->debug(4, "Operator completed in " + \
         std::to_string(elapsed_s) + " seconds");
 #endif
     return ret;
@@ -304,7 +304,7 @@
     std::shared_ptr<std::string>>>
     Rule::executeDefaultTransformations(

-    Transaction *trasn, const std::string &in, bool multiMatch) {
+    Transaction *trans, const std::string &in, bool multiMatch) {
     int none = 0;
     int transformations = 0;

@@ -316,16 +316,16 @@
         std::shared_ptr<std::string>(new std::string(in));
     std::shared_ptr<std::string> newValue;

-    std::shared_ptr<std::string> trans =
+    std::shared_ptr<std::string> transStr =
         std::shared_ptr<std::string>(new std::string());

     if (multiMatch == true) {
         ret.push_back(std::make_pair(
             std::shared_ptr<std::string>(value),
-            std::shared_ptr<std::string>(trans)));
+            std::shared_ptr<std::string>(transStr)));
         ret.push_back(std::make_pair(
             std::shared_ptr<std::string>(value),
-            std::shared_ptr<std::string>(trans)));
+            std::shared_ptr<std::string>(transStr)));
     }

     for (Action *a : this->m_actionsRuntimePre) {
@@ -338,26 +338,26 @@
     // Notice that first we make sure that won't be a t:none
     // on the target rule.
     if (none == 0) {
-        for (Action *a : trasn->m_rules->m_defaultActions[this->m_phase]) {
+        for (Action *a : trans->m_rules->m_defaultActions[this->m_phase]) {
             if (a->action_kind \
                 == actions::Action::RunTimeBeforeMatchAttemptKind) {
                 newValue = std::unique_ptr<std::string>(
-                    new std::string(a->evaluate(*value, trasn)));
+                    new std::string(a->evaluate(*value, trans)));

                 if (multiMatch == true) {
                     if (*newValue != *value) {
                         ret.push_back(std::make_pair(
                             newValue,
-                            trans));
+                                          transStr));
                     }
                 }
                 value = std::shared_ptr<std::string>(newValue);
-                if (trans->empty()) {
-                    trans->append(a->m_name);
+                if (transStr->empty()) {
+                    transStr->append(a->m_name);
                 } else {
-                    trans->append("," + a->m_name);
-                }
-                trasn->debug(9, "(SecDefaultAction) T (" + \
+                    transStr->append("," + a->m_name);
+                }
+                trans->debug(9, "(SecDefaultAction) T (" + \
                     std::to_string(transformations) + ") " + \
                     a->m_name + ": \"" + \
                     utils::string::limitTo(80, *value) +"\"");
@@ -370,26 +370,26 @@
     for (Action *a : this->m_actionsRuntimePre) {
         if (none == 0) {
             newValue = std::shared_ptr<std::string>(
-                new std::string(a->evaluate(*value, trasn)));
+                new std::string(a->evaluate(*value, trans)));

             if (multiMatch == true) {
                 if (*value != *newValue) {
                     ret.push_back(std::make_pair(
                         newValue,
-                        trans));
+                                      transStr));
                     value = newValue;
                 }
             }

             value = newValue;
-            trasn->debug(9, " T (" + \
+            trans->debug(9, " T (" + \
                 std::to_string(transformations) + ") " + \
                 a->m_name + ": \"" + \
                 utils::string::limitTo(80, *value) + "\"");
-            if (trans->empty()) {
-                trans->append(a->m_name);
+            if (transStr->empty()) {
+                transStr->append(a->m_name);
             } else {
-                trans->append("," + a->m_name);
+                transStr->append("," + a->m_name);
             }
             transformations++;
         }
@@ -401,13 +401,13 @@
         // v2 checks the last entry twice. Don't know why.
         ret.push_back(ret.back());

-        trasn->debug(9, "multiMatch is enabled. " \
+        trans->debug(9, "multiMatch is enabled. " \
             + std::to_string(ret.size()) + \
             " values to be tested.");
     } else {
         ret.push_back(std::make_pair(
             std::shared_ptr<std::string>(value),
-            std::shared_ptr<std::string>(trans)));
+            std::shared_ptr<std::string>(transStr)));
     }

     return ret;
@@ -415,7 +415,7 @@

 std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
-    Transaction *trasn) {
+    Transaction *trans) {
     std::list<const std::string*> exclusions;
     std::vector<Variable *> *variables = m_variables;
     std::vector<std::unique_ptr<collection::Variable>> finalVars;
@@ -424,7 +424,7 @@
         Variable *variable = variables->at(i);
         if (variable->m_isExclusion) {
             std::vector<const collection::Variable *> z;
-            variable->evaluateInternal(trasn, this, &z);
+            variable->evaluateInternal(trans, this, &z);
             for (auto &y : z) {
                 exclusions.push_back(y->m_key);
             }
@@ -441,14 +441,14 @@
             continue;
         }

-        variable->evaluateInternal(trasn, this, &e);
+        variable->evaluateInternal(trans, this, &e);
         for (const collection::Variable *v : e) {
             const std::string *key = v->m_key;
             if (std::find_if(exclusions.begin(), exclusions.end(),
                 [key](const std::string *m) -> bool { return *key == *m; })
                 != exclusions.end()) {
 #ifndef NO_LOGS
-                trasn->debug(9, "Variable: " + *key +
+                trans->debug(9, "Variable: " + *key +
                     " is part of the exclusion list, skipping...");
 #endif
                 if (v->m_dynamic) {
@@ -458,14 +458,14 @@
                 continue;
             }

-            for (auto &i : trasn->m_ruleRemoveTargetByTag) {
+            for (auto &i : trans->m_ruleRemoveTargetByTag) {
                 std::string tag = i.first;
                 std::string args = i.second;
-                if (containsTag(tag, trasn) == false) {
+                if (containsTag(tag, trans) == false) {
                     continue;
                 }
                 if (args == *key) {
-                    trasn->debug(9, "Variable: " + *key +
+                    trans->debug(9, "Variable: " + *key +
                         " was excluded by ruleRemoteTargetByTag...");
                     ignoreVariable = true;
                     break;
@@ -479,14 +479,14 @@
                 continue;
             }

-            for (auto &i : trasn->m_ruleRemoveTargetById) {
+            for (auto &i : trans->m_ruleRemoveTargetById) {
                 int id = i.first;
                 std::string args = i.second;
                 if (m_ruleId != id) {
                     continue;
                 }
                 if (args == *key) {
-                    trasn->debug(9, "Variable: " + *key +
+                    trans->debug(9, "Variable: " + *key +
                         " was excluded by ruleRemoteTargetById...");
                     ignoreVariable = true;
                     break;
@@ -523,38 +523,38 @@
 }

-void Rule::executeActionsAfterFullMatch(Transaction *trasn,
+void Rule::executeActionsAfterFullMatch(Transaction *trans,
     bool containsDisruptive, RuleMessage *ruleMessage) {

-    for (Action *a : trasn->m_rules->m_defaultActions[this->m_phase]) {
+    for (Action *a : trans->m_rules->m_defaultActions[this->m_phase]) {
         if (a->action_kind != actions::Action::RunTimeOnlyIfMatchKind) {
             continue;
         }

         if (a->isDisruptive() == false) {
-            trasn->debug(4, "(SecDefaultAction) Running " \
+            trans->debug(4, "(SecDefaultAction) Running " \
                 "action: " + a->m_name);
-                a->evaluate(this, trasn, ruleMessage);
+                a->evaluate(this, trans, ruleMessage);
             continue;
         }

         if (containsDisruptive) {
-            trasn->debug(4, "(SecDefaultAction) _ignoring_ " \
+            trans->debug(4, "(SecDefaultAction) _ignoring_ " \
                 "action: " + a->m_name + \
                 " (rule contains a disruptive action)");
             continue;
         }

-        if (trasn->m_rules->m_secRuleEngine == Rules::EnabledRuleEngine) {
-            trasn->debug(4, "(SecDefaultAction) " \
+        if (trans->m_rules->m_secRuleEngine == Rules::EnabledRuleEngine) {
+            trans->debug(4, "(SecDefaultAction) " \
                 "Running action: " + a->m_name + \
                 " (rule _does not_ contains a " \
                 "disruptive action)");
-            a->evaluate(this, trasn, ruleMessage);
+            a->evaluate(this, trans, ruleMessage);
             continue;
         }

-        trasn->debug(4, "(SecDefaultAction) _Not_ running action: " \
+        trans->debug(4, "(SecDefaultAction) _Not_ running action: " \
                 + a->m_name + ". Rule _does not_contains a disruptive action,"\
                 + " but SecRuleEngine is not On.");
     }
@@ -563,25 +563,25 @@
         if (a->isDisruptive() == false) {
             if (a->m_name != "setvar" && a->m_name != "log"
                 && a->m_name != "msg") {
-                trasn->debug(4, "Running [I] (_non_ disruptive) " \
+                trans->debug(4, "Running [I] (_non_ disruptive) " \
                     "action: " + a->m_name);
-                    a->evaluate(this, trasn, ruleMessage);
+                    a->evaluate(this, trans, ruleMessage);
             }
             continue;
         }
-        if (trasn->m_rules->m_secRuleEngine == Rules::EnabledRuleEngine) {
-            trasn->debug(4, "Running (disruptive) action: " + a->m_name);
-            a->evaluate(this, trasn, ruleMessage);
+        if (trans->m_rules->m_secRuleEngine == Rules::EnabledRuleEngine) {
+            trans->debug(4, "Running (disruptive) action: " + a->m_name);
+            a->evaluate(this, trans, ruleMessage);
             continue;
         }

-        trasn->debug(4, "Not running disruptive action: " + \
+        trans->debug(4, "Not running disruptive action: " + \
                 a->m_name + ". SecRuleEngine is not On");
     }
 }

-bool Rule::evaluate(Transaction *trasn) {
+bool Rule::evaluate(Transaction *trans) {
     bool globalRet = false;
     std::vector<Variable *> *variables = this->m_variables;
     bool recursiveGlobalRet;
@@ -590,29 +590,29 @@
     std::vector<std::unique_ptr<collection::Variable>> finalVars;
     std::string eparam;

-    trasn->m_matched.clear();
+    trans->m_matched.clear();

     if (m_secMarker == true) {
         return true;
     }
     if (m_unconditional == true) {
-        trasn->debug(4, "(Rule: " + std::to_string(m_ruleId) \
+        trans->debug(4, "(Rule: " + std::to_string(m_ruleId) \
             + ") Executing unconditional rule...");
-        executeActionsIndependentOfChainedRuleResult(trasn,
+        executeActionsIndependentOfChainedRuleResult(trans,
             &containsDisruptive, &ruleMessage);
         goto end_exec;
     }

-    for (auto &i : trasn->m_ruleRemoveById) {
+    for (auto &i : trans->m_ruleRemoveById) {
         if (m_ruleId != i) {
             continue;
         }
-        trasn->debug(9, "Rule id: " + std::to_string(m_ruleId) +
+        trans->debug(9, "Rule id: " + std::to_string(m_ruleId) +
             " was skipped due to an ruleRemoveById action...");
         return true;
     }

-    eparam = MacroExpansion::expand(this->m_op->m_param, trasn);
+    eparam = MacroExpansion::expand(this->m_op->m_param, trans);

     if (this->m_op->m_param != eparam) {
         eparam = "\"" + eparam + "\" Was: \"" + this->m_op->m_param + "\"";
@@ -620,16 +620,16 @@
         eparam = "\"" + eparam + "\"";
     }

-    trasn->debug(4, "(Rule: " + std::to_string(m_ruleId) \
+    trans->debug(4, "(Rule: " + std::to_string(m_ruleId) \
         + ") Executing operator \"" + this->m_op->m_op \
         + "\" with param " \
         + eparam \
         + " against " \
         + Variable::to_s(variables) + ".");

-    updateRulesVariable(trasn);
-
-    finalVars = getFinalVars(trasn);
+    updateRulesVariable(trans);
+
+    finalVars = getFinalVars(trans);

     for (auto &v : finalVars) {
         const std::string value = *(v->m_value);
@@ -640,13 +640,13 @@

         bool multiMatch = getActionsByName("multimatch").size() > 0;

-        values = executeDefaultTransformations(trasn, value,
+        values = executeDefaultTransformations(trans, value,
             multiMatch);
         for (const auto &valueTemp : values) {
             bool ret;
             std::string valueAfterTrans = std::move(*valueTemp.first);

-            ret = executeOperatorAt(trasn, key, valueAfterTrans, &ruleMessage);
+            ret = executeOperatorAt(trans, key, valueAfterTrans, &ruleMessage);

             if (ret == true) {
                 ruleMessage.m_match = resolveMatchMessage(key, value);
@@ -654,8 +654,8 @@
                     ruleMessage.m_reference.append(i->toText());
                 }
                 ruleMessage.m_reference.append(*valueTemp.second);
-                updateMatchedVars(trasn, key, value);
-                executeActionsIndependentOfChainedRuleResult(trasn,
+                updateMatchedVars(trans, key, value);
+                executeActionsIndependentOfChainedRuleResult(trans,
                     &containsDisruptive, &ruleMessage);
                 globalRet = true;
             }
@@ -663,25 +663,25 @@
     }

     if (globalRet == false) {
-        trasn->debug(4, "Rule returned 0.");
-        cleanMatchedVars(trasn);
+        trans->debug(4, "Rule returned 0.");
+        cleanMatchedVars(trans);
         goto end_clean;
     }

-    trasn->debug(4, "Rule returned 1.");
+    trans->debug(4, "Rule returned 1.");

     if (this->m_chained == false) {
         goto end_exec;
     }

     if (this->m_chainedRule == NULL) {
-        trasn->debug(4, "Rule is marked as chained but there " \
+        trans->debug(4, "Rule is marked as chained but there " \
             "isn't a subsequent rule.");
         goto end_clean;
     }

-    trasn->debug(4, "Executing chained rule.");
-    recursiveGlobalRet = this->m_chainedRule->evaluate(trasn);
+    trans->debug(4, "Executing chained rule.");
+    recursiveGlobalRet = this->m_chainedRule->evaluate(trans);

     if (recursiveGlobalRet == true) {
         goto end_exec;
@@ -691,13 +691,13 @@
     return false;

 end_exec:
-    executeActionsAfterFullMatch(trasn, containsDisruptive, &ruleMessage);
+    executeActionsAfterFullMatch(trans, containsDisruptive, &ruleMessage);
     for (const auto &u : ruleMessage.m_server_logs) {
-        trasn->serverLog(u);
+        trans->serverLog(u);
     }

     if (ruleMessage.m_server_logs.size() > 0) {
-        trasn->m_rulesMessages.push_back(ruleMessage);
+        trans->m_rulesMessages.push_back(ruleMessage);
     }

     return true;


Changed regex parsing to account for delimeters within brackets

--- src/sed.cpp
+++ src/sed.cpp
@@ -15,6 +15,7 @@

 static int parsecmd(struct sedinfo *s, char *cmd);
 static void puterr(char *out, size_t max, struct sedinfo *s);
+static char *readbrackets(char *s);

 /* sed: perform a basic sed substitution command on input */
 int sed(char *s, size_t max, const char *input, const char *sedcmd)
@@ -36,7 +37,7 @@
 		else
 			pattern = std::regex(sedbuf.regex, std::regex::icase);
 	} catch (std::regex_error) {
-		_sprintf(out, max, "sed: invalid regex");
+		_sprintf(s, max, "sed: invalid regex");
 		return 0;
 	}

@@ -52,7 +53,7 @@
 static int parsecmd(struct sedinfo *s, char *cmd)
 {
 	char *t;
-	int delim;
+	int delim, type;

 	s->global = s->ignore = 0;
 	if (cmd[0] != 's') {
@@ -65,8 +66,19 @@
 		return 0;
 	}
 	t = s->regex;
-	while ((t = strchr(t, delim)) && *(t - 1) == '\\')
-		shift_l(t - 1);
+	for (t = s->regex; *t; ++t) {
+		if (*t == '\'' || *t == '"') {
+			if (!(t = readbrackets(t))) {
+				s->error = UNTERM;
+				return 0;
+			}
+		} else if (*t == delim) {
+			if (*(t - 1) != '\\')
+				break;
+			shift_l(t - 1);
+			--t;
+		}
+	}
 	if (!t) {
 		s->error = UNTERM;
 		return 0;
@@ -119,3 +131,8 @@
 		break;
 	}
 }
+
+static char *readbrackets(char *s)
+{
+	return s;
+}


Actually return something in utf8::codepoint, thanks gcc for using rax

--- src/utf8.hh
+++ src/utf8.hh
@@ -108,6 +108,7 @@
     }
     else
         throw invalid_utf8_sequence{};
+    return cp;
 }

 struct invalid_codepoint{};


[UVA] Set/unset uvaPtr during start/stop managing calls

--- src/uva.cpp
+++ src/uva.cpp
@@ -103,6 +103,7 @@
     occa::memory_v *mem = uvaToMemory(ptr);
     if (mem != NULL) {
       mem->memInfo |= uvaFlag::isManaged;
+      mem->uvaPtr = (char*) ptr;
     }
   }

@@ -110,6 +111,7 @@
     occa::memory_v *mem = uvaToMemory(ptr);
     if (mem != NULL) {
       mem->memInfo &= ~uvaFlag::isManaged;
+      mem->uvaPtr = NULL;
     }
   }


Delete unused INLINE_STRING. (#182)

Delete unused INLINE_STRING. (#182)

Signed-off-by: Takeshi Yoneda <72d3043deb9ea484d21ffcca03f662fa81cbe321@tetrate.io>

--- src/wasm.cc
+++ src/wasm.cc
@@ -47,8 +47,6 @@
 std::unordered_map<std::string, std::weak_ptr<WasmHandleBase>> *base_wasms = nullptr;
 std::unordered_map<std::string, WasmForeignFunction> *foreign_functions = nullptr;

-const std::string INLINE_STRING = "<inline>";
-
 std::vector<uint8_t> Sha256(const std::vector<std::string_view> parts) {
   uint8_t sha256[SHA256_DIGEST_LENGTH];
   SHA256_CTX sha_ctx;


+ fixed bad errors when parsing wkb

+ fixed bad errors when parsing wkb

--- src/wkb.cpp
+++ src/wkb.cpp
@@ -273,9 +273,9 @@
             read_coords(ar);
             line->set_capacity(capacity);
             line->move_to(ar[0].x,ar[0].y);
-            for (int i=1;i<num_points;++i)
+            for (int j=1;j<num_points;++j)
             {
-                line->line_to(ar[i].x,ar[i].y);
+                line->line_to(ar[j].x,ar[j].y);
             }
         }
         feature.add_geometry(line);
@@ -321,7 +321,7 @@
         {
             pos_+=5;
             int num_rings=read_integer();
-            for (int i=0;i<num_rings;++i)
+            for (int r=0;r<num_rings;++r)
             {
                 int num_points=read_integer();
                 capacity += num_points;


Fix #128

Fix #128

--- ghost++/ghost/bnet.cpp
+++ ghost++/ghost/bnet.cpp
@@ -1536,6 +1536,9 @@

                         if( ( IsLevel( User ) >= 5 || ForceRoot ) && m_GHost->m_RanksLoaded )
                         {
+                            if( ForceRoot ) {
+                                level = 10;
+                            }

                                 string level = GetLevelName( IsLevel( User ) );
                                 CONSOLE_Print( "[BNET] "+ level +" [" + User + "] sent command [" + Command + "] with payload [" + Payload + "]" );


DOC: document completionGenerator usage

DOC: document completionGenerator usage

--- Utilities/Completion/completionGenerator.cxx
+++ Utilities/Completion/completionGenerator.cxx
@@ -21,6 +21,16 @@
 #include "otbWrapperChoiceParameter.h"
 #include "itksys/SystemTools.hxx"

+/**
+ * Small executable to :
+ *  - find available application
+ *  - get list of parameters
+ *  - and fill a bash completion script
+ *
+ * This script can be sourced to be used, or deployed into a folder such as
+ *    /etc/bash_completion.d
+ * For choice parameters, the completion will propose the available choices
+ */

 int main(int argc, char* argv[])
 {


Set ForwardChainPatternMatchCB implicand and type restrictions

--- opencog/reasoning/RuleEngine/rule-engine-src/pln/DefaultForwardChainerCB.cc
+++ opencog/reasoning/RuleEngine/rule-engine-src/pln/DefaultForwardChainerCB.cc
@@ -236,6 +236,8 @@
     fcpm_->set_fcmem(&fcmem);

     BindLinkPtr bl(BindLinkCast(cur_rule->get_handle()));
+    fcpm_->implicand = bl->get_implicand();
+    fcpm_->set_type_restrictions(bl->get_typemap());
     bl->imply(fcpm_);

     HandleSeq product = fcpm_->get_products();


Update for changes to Array::resize

Update for changes to Array::resize

--- hollow/ode/integral.cpp
+++ hollow/ode/integral.cpp
@@ -368,7 +368,8 @@

   RawArray<const T,2> expand(RawArray<const T> xr) const {
     GEODE_ASSERT(xr.size()==(n+3)*d-bcs.size());
-    x_expanded.resize(n+3,d,false,false);
+    x_expanded.clear();
+    x_expanded.resize(n+3,d,uninit);
     const auto xe = x_expanded.flat.raw();
     for (int k=0;k<=bcs.size();k++) {
       const int lo = k ? bcs[k-1].x+1 : 0,
@@ -398,7 +399,8 @@

   template<class A> static PetscErrorCode gradient(A, ::Vec x, ::Vec grad, void* ctx) {
     const auto& s = *(const Self*)ctx;
-    s.grad_expanded.resize(s.n+3,s.d,false);
+    s.grad_expanded.clear();
+    s.grad_expanded.resize(s.n+3,s.d,uninit);
     s.gradient(s.expand(RawVec<const T>(x)),s.grad_expanded);
     s.reduce(s.grad_expanded.flat,RawVec<T>(grad));
     return 0;


fixed some warning messages

fixed some warning messages

--- Code/Numerics/FEM/itkFEMSolverCrankNicolson.cxx
+++ Code/Numerics/FEM/itkFEMSolverCrankNicolson.cxx
@@ -104,9 +104,7 @@
       for(int k=0; k<Ne; k++)
       {
         /* error checking. all GFN should be =>0 and <NGFN */
-        if ( (*e)->GetDegreeOfFreedom(j) < 0 ||
-             (*e)->GetDegreeOfFreedom(j) >= NGFN ||
-             (*e)->GetDegreeOfFreedom(k) < 0 ||
+        if ( (*e)->GetDegreeOfFreedom(j) >= NGFN ||
              (*e)->GetDegreeOfFreedom(k) >= NGFN  )
         {
           throw FEMExceptionSolution(__FILE__,__LINE__,"SolverCrankNicolson::AssembleK()","Illegal GFN!");
@@ -120,12 +118,10 @@
         if ( Ke(j,k)!=Float(0.0) || Me(j,k) != Float(0.0) )
         {
           // left hand side matrix
-          Float temp1=Ke(j,k), temp2=Me(j,k);
           Float lhsval=(Me(j,k) + m_alpha*m_deltaT*Ke(j,k));
           m_ls->AddMatrixValue( (*e)->GetDegreeOfFreedom(j) ,
                     (*e)->GetDegreeOfFreedom(k),
                     lhsval, SumMatrixIndex );
-          //if (j==k) std::cout << temp1 << " " << temp2 << endl;
           // right hand side matrix
           Float rhsval=(Me(j,k) - (1.-m_alpha)*m_deltaT*Ke(j,k));
           m_ls->AddMatrixValue( (*e)->GetDegreeOfFreedom(j) ,
@@ -153,9 +149,6 @@
 void SolverCrankNicolson::AssembleFforTimeStep(int dim) {
 /* if no DOFs exist in a system, we have nothing to do */
   if (NGFN<=0) return;
-
-  unsigned int i=0;
-  Float temp=0.0;

   AssembleF(dim); // assuming assemblef uses index 0 in vector!

@@ -186,7 +179,6 @@
   // Now set the solution and force vector to fit the BCs
   for( BCTermType::iterator q=bcterm.begin(); q!=bcterm.end(); q++)
   {
-    Float t1=q->first;  Float t2=q->second;
     m_ls->SetVectorValue(q->first,q->second,ForceTIndex);
   }

@@ -232,7 +224,7 @@
    */
   Float mins=0.0, maxs=0.0;
   Float mins2=0.0, maxs2=0.0;
-  for(int i=0;i<NGFN;i++)
+  for(unsigned int i=0;i<NGFN;i++)
   {

     Float temp=m_ls->GetSolutionValue(i,SolutionTIndex);
@@ -257,7 +249,7 @@
 void SolverCrankNicolson::PrintDisplacements()
 {
   cout <<  " printing current displacements " << endl;
-  for(int i=0;i<NGFN;i++)
+  for(unsigned int i=0;i<NGFN;i++)
   {
     cout << m_ls->GetVectorValue(i,SolutionTMinus1Index) << endl;
   }
@@ -266,7 +258,7 @@
 void SolverCrankNicolson::PrintForce()
 {
   cout <<  " printing current forces " << endl;
-  for(int i=0;i<NGFN;i++)
+  for(unsigned int i=0;i<NGFN;i++)
   {
     cout << m_ls->GetVectorValue(i,ForceTIndex) << endl;
   }


Jolla: Show specify info in kit page for mer kits only

--- src/plugins/mer/merspecifykitinformation.cpp
+++ src/plugins/mer/merspecifykitinformation.cpp
@@ -24,6 +24,7 @@
 #include "merconstants.h"
 #include "merdevicefactory.h"
 #include "mersdkkitinformation.h"
+#include "mersdkmanager.h"

 #include <utils/pathchooser.h>
 #include <projectexplorer/projectexplorerconstants.h>
@@ -111,7 +112,7 @@
 {
     QList<Task> result;
     const Utils::FileName file = MerSpecifyKitInformation::specifyPath(k);
-    if (!file.toFileInfo().isFile()) {
+    if (MerSdkManager::isMerKit(k) && !file.toFileInfo().isFile()) {
         const QString message = QCoreApplication::translate("MerSdk",
                                                             "No valid specify tool found");
         return QList<Task>() << Task(Task::Error, message, Utils::FileName(), -1,
@@ -127,7 +128,10 @@

 KitInformation::ItemList MerSpecifyKitInformation::toUserOutput(Kit *k) const
 {
-    return ItemList() << qMakePair(tr("Specify"), specifyPath(k).toUserOutput());
+    if (MerDeviceFactory::canCreate(ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k)))
+        return ItemList() << qMakePair(tr("Specify"), specifyPath(k).toUserOutput());
+    else
+        return ProjectExplorer::KitInformation::ItemList();
 }

 Utils::FileName MerSpecifyKitInformation::specifyPath(const Kit *k)


BuildManager: Remove unused member

BuildManager: Remove unused member

Change-Id: Ia4692aa11028d2bed3ee15ab2e2971c3fb2c2948
Reviewed-by: Daniel Teske <d8a411aec9a206efedb4d45b75fe8d13f1e2b628@nokia.com>

--- src/plugins/projectexplorer/buildmanager.cpp
+++ src/plugins/projectexplorer/buildmanager.cpp
@@ -81,7 +81,6 @@

     QList<BuildStep *> m_buildQueue;
     QStringList m_stepNames;
-    QStringList m_configurations; // the corresponding configuration to the m_buildQueue
     ProjectExplorerPlugin *m_projectExplorerPlugin;
     bool m_running;
     QFutureWatcher<bool> m_watcher;


Fixes: -Wno-undefined would have saved me.

--- src/plugins/projectexplorer/cesdkhandler.cpp
+++ src/plugins/projectexplorer/cesdkhandler.cpp
@@ -52,7 +52,7 @@
     env.set("INCLUDE", m_include);
     env.set("LIB", m_lib);
     env.prependOrSetPath(m_bin);
-    qDebug()<<e.toStringList();
+    qDebug()<<env.toStringList();
 }

 CeSdkHandler::CeSdkHandler()


QmlProfiler: Make sure the painter state is restored at some point.

By returning early from the method painting the binding loop markers
painter states could be left on the stack, triggering error messages
later.

Change-Id: I0b9c336e44a28feec96c506d0e3d0da291054bbd
Reviewed-by: Kai Koehne <077bc265216106fb22408e62f2d97925ede69d10@digia.com>

--- src/plugins/qmlprofiler/timelinerenderer.cpp
+++ src/plugins/qmlprofiler/timelinerenderer.cpp
@@ -233,7 +233,7 @@
             int shadowoffset = 2;
             if ((yfrom + radius + shadowoffset < 0 && yto + radius + shadowoffset < 0) ||
                     (yfrom - radius >= height() && yto - radius >= height()))
-                return;
+                break;

             // shadow
             p->setPen(shadowPen);


Fix crash when loading a .qmlproject with a custom run configuration

Task-number: QTCREATORBUG-1609

--- src/plugins/qmlprojectmanager/qmlproject.cpp
+++ src/plugins/qmlprojectmanager/qmlproject.cpp
@@ -258,7 +258,7 @@

     refresh(Everything);
     // FIXME workaround to guarantee that run/debug actions are enabled if a valid file exists
-    QmlProjectRunConfiguration *runConfig = static_cast<QmlProjectRunConfiguration*>(activeTarget()->activeRunConfiguration());
+    QmlProjectRunConfiguration *runConfig = qobject_cast<QmlProjectRunConfiguration*>(activeTarget()->activeRunConfiguration());
     if (runConfig)
         runConfig->changeCurrentFile(0);


Test of adding fast open shortcut

Test of adding fast open shortcut


Clarified PUSH/POP macros.

Clarified PUSH/POP macros.

--- src/runtime/full_text/ftcontains_visitor.cpp
+++ src/runtime/full_text/ftcontains_visitor.cpp
@@ -87,29 +87,28 @@

 #ifndef NDEBUG

-inline void pop_helper( char const *what, int line ) {
+inline void pop_trace( char const *stack, int line ) {
   if ( TRACE_FULL_TEXT )
-    DOUT << indent << "(pop " << what << " @ line " << line << ")\n";
-}
-
-#define PUSH(WHAT,OBJ)                                                  \
-  do {                                                                  \
-    if ( TRACE_FULL_TEXT )                                              \
-      DOUT << indent << "(push " #WHAT " @ line " << __LINE__ << ")\n"; \
-    WHAT##_stack_.push( OBJ );                                          \
+    DOUT << indent << "(pop " << stack << " @ line " << line << ')' << endl;
+}
+
+#define PUSH(STACK,OBJ)                                                        \
+  do {                                                                         \
+    if ( TRACE_FULL_TEXT )                                                     \
+      DOUT << indent << "(push " #STACK " @ line " << __LINE__ << ')' << endl; \
+    STACK.push( OBJ );                                                         \
   } while (0)

-#define POP(WHAT) \
-  ( pop_helper( #WHAT, __LINE__ ), pop_stack( WHAT##_stack_ ) )
+#define POP(STACK)      ( pop_trace( #STACK, __LINE__ ), pop_stack( STACK ) )

 #else /* NDEBUG */

-#define PUSH(WHAT,OBJ)  WHAT##_stack_.push( OBJ )
-#define POP(WHAT)       pop_stack( WHAT##_stack_ )
+#define PUSH(STACK,OBJ) STACK.push( OBJ )
+#define POP(STACK)      pop_stack( STACK )

 #endif /* NDEBUG */

-#define TOP(WHAT)       WHAT##_stack_.top()
+#define TOP(STACK)      STACK.top()

 ////////// ftcontains_visitor non-inline member functions /////////////////////

@@ -127,7 +126,7 @@

 ftcontains_visitor::~ftcontains_visitor() {
   while ( !matches_stack_.empty() )
-    delete POP( matches );
+    delete POP( matches_stack_ );
 }

 void ftcontains_visitor::eval_ftrange( ftrange const &range,
@@ -156,7 +155,7 @@
 bool ftcontains_visitor::ftcontains() const {
   if ( matches_stack_.empty() )
     return false;
-  ft_all_matches const &am = *TOP( matches );
+  ft_all_matches const &am = *TOP( matches_stack_ );
   if ( am.empty() )
     return false;
   //
@@ -251,21 +250,21 @@

 ft_visit_result::type V::begin_visit( ftand& ) {
   BEGIN_VISIT( ftand );
-  PUSH( matches, NULL ); // sentinel
+  PUSH( matches_stack_, NULL ); // sentinel
   return ft_visit_result::proceed;
 }
 void V::end_visit( ftand& ) {
   while ( true ) {
     // the popping order is significant
-    auto_ptr<ft_all_matches> am_right( POP( matches ) );
-    auto_ptr<ft_all_matches> am_left( POP( matches ) );
+    auto_ptr<ft_all_matches> am_right( POP( matches_stack_ ) );
+    auto_ptr<ft_all_matches> am_left( POP( matches_stack_ ) );
     if ( !am_left.get() ) {
-      PUSH( matches, am_right.release() );
+      PUSH( matches_stack_, am_right.release() );
       break;
     }
     auto_ptr<ft_all_matches> result( new ft_all_matches );
     apply_ftand( *am_left, *am_right, *result );
-    PUSH( matches, result.release() );
+    PUSH( matches_stack_, result.release() );
   }
   END_VISIT( ftand );
 }
@@ -274,22 +273,22 @@

 ft_visit_result::type V::begin_visit( ftmild_not& ) {
   BEGIN_VISIT( ftmild_not );
-  PUSH( matches, NULL ); // sentinel
+  PUSH( matches_stack_, NULL ); // sentinel
   return ft_visit_result::proceed;
 }
 void V::end_visit( ftmild_not &mn ) {
   while ( true ) {
     // the popping order is significant
-    auto_ptr<ft_all_matches> am_right( POP( matches ) );
-    auto_ptr<ft_all_matches> am_left( POP( matches ) );
+    auto_ptr<ft_all_matches> am_right( POP( matches_stack_ ) );
+    auto_ptr<ft_all_matches> am_left( POP( matches_stack_ ) );
     if ( !am_left.get() ) {
-      PUSH( matches, am_right.release() );
+      PUSH( matches_stack_, am_right.release() );
       break;
     }
     try {
       auto_ptr<ft_all_matches> result( new ft_all_matches );
       apply_ftmild_not( *am_left, *am_right, *result );
-      PUSH( matches, result.release() );
+      PUSH( matches_stack_, result.release() );
     }
     catch ( error::ZorbaError &e ) {
       set_error_query_loc( e, mn.get_loc() );
@@ -301,21 +300,21 @@

 ft_visit_result::type V::begin_visit( ftor& ) {
   BEGIN_VISIT( ftor );
-  PUSH( matches, NULL ); // sentinel
+  PUSH( matches_stack_, NULL ); // sentinel
   return ft_visit_result::proceed;
 }
 void V::end_visit( ftor& ) {
   while ( true ) {
     // the popping order is significant
-    auto_ptr<ft_all_matches> am_right( POP( matches ) );
-    auto_ptr<ft_all_matches> am_left( POP( matches ) );
+    auto_ptr<ft_all_matches> am_right( POP( matches_stack_ ) );
+    auto_ptr<ft_all_matches> am_left( POP( matches_stack_ ) );
     if ( !am_left.get() ) {
-      PUSH( matches, am_right.release() );
+      PUSH( matches_stack_, am_right.release() );
       break;
     }
     auto_ptr<ft_all_matches> result( new ft_all_matches );
     apply_ftor( *am_left, *am_right, *result );
-    PUSH( matches, result.release() );
+    PUSH( matches_stack_, result.release() );
   }
   END_VISIT( ftor );
 }
@@ -324,7 +323,7 @@
   BEGIN_VISIT( ftprimary_with_options );

   ftmatch_options const *const older_options = options_stack_.empty() ?
-    static_ctx_.get_match_options() : TOP( options );
+    static_ctx_.get_match_options() : TOP( options_stack_ );
   ftmatch_options *const newer_options =
     new ftmatch_options( *pwo.get_match_options() );

@@ -332,11 +331,11 @@
     replace_match_options( older_options, newer_options );
   newer_options->set_missing_defaults();

-  PUSH( options, newer_options );
+  PUSH( options_stack_, newer_options );
   return ft_visit_result::proceed;
 }
 void V::end_visit( ftprimary_with_options &pwo ) {
-  delete POP( options );
+  delete POP( options_stack_ );
   END_VISIT( ftprimary_with_options );
 }

@@ -358,13 +357,13 @@

 DEF_FTNODE_VISITOR_BEGIN_VISIT( V, ftunary_not )
 void V::end_visit( ftunary_not& ) {
-  apply_ftunary_not( *TOP( matches ) );
+  apply_ftunary_not( *TOP( matches_stack_ ) );
   END_VISIT( ftunary_not );
 }

 DEF_FTNODE_VISITOR_BEGIN_VISIT( V, ftwords )
 void V::end_visit( ftwords &w ) {
-  ftmatch_options const &options = *TOP( options );
+  ftmatch_options const &options = *TOP( options_stack_ );
   locale::iso639_1::type const lang = get_lang_from( &options );
   bool const wildcards = get_wildcards_from( &options );

@@ -396,7 +395,7 @@
       set_error_query_loc( e, w.get_value_expr()->get_loc() );
       throw;
     }
-    PUSH( matches, result.release() );
+    PUSH( matches_stack_, result.release() );
   }
   END_VISIT( ftwords );
 }
@@ -407,10 +406,10 @@
     try {
       ft_int at_least, at_most;
       eval_ftrange( *range, &at_least, &at_most );
-      auto_ptr<ft_all_matches> const am( POP( matches ) );
+      auto_ptr<ft_all_matches> const am( POP( matches_stack_ ) );
       auto_ptr<ft_all_matches> result( new ft_all_matches );
       apply_fttimes( *am, range->get_mode(), at_least, at_most, *result );
-      PUSH( matches, result.release() );
+      PUSH( matches_stack_, result.release() );
     }
     catch ( error::ZorbaError &e ) {
       set_error_query_loc( e, wt.get_loc() );
@@ -425,7 +424,8 @@
 DEF_FTNODE_VISITOR_BEGIN_VISIT( V, ftcontent_filter )
 void V::end_visit( ftcontent_filter &f ) {
   apply_ftcontent(
-    *TOP( matches ), f.get_mode(), search_ctx_->begin(), search_ctx_->end() - 1
+    *TOP( matches_stack_ ), f.get_mode(),
+    search_ctx_->begin(), search_ctx_->end() - 1
   );
   END_VISIT( ftcontent_filter );
 }
@@ -434,37 +434,37 @@
 void V::end_visit( ftdistance_filter &f ) {
   ft_int at_least, at_most;
   eval_ftrange( *f.get_range(), &at_least, &at_most );
-  auto_ptr<ft_all_matches> const am( POP( matches ) );
+  auto_ptr<ft_all_matches> const am( POP( matches_stack_ ) );
   auto_ptr<ft_all_matches> result( new ft_all_matches );
   apply_ftdistance( *am, at_least, at_most, f.get_unit(), *result );
-  PUSH( matches, result.release() );
+  PUSH( matches_stack_, result.release() );
   END_VISIT( ftdistance_filter );
 }

 DEF_FTNODE_VISITOR_BEGIN_VISIT( V, ftorder_filter )
 void V::end_visit( ftorder_filter& ) {
-  auto_ptr<ft_all_matches> const am( POP( matches ) );
+  auto_ptr<ft_all_matches> const am( POP( matches_stack_ ) );
   auto_ptr<ft_all_matches> result( new ft_all_matches );
   apply_ftorder( *am, *result );
-  PUSH( matches, result.release() );
+  PUSH( matches_stack_, result.release() );
   END_VISIT( ftorder_filter );
 }

 DEF_FTNODE_VISITOR_BEGIN_VISIT( V, ftscope_filter )
 void V::end_visit( ftscope_filter &f ) {
-  auto_ptr<ft_all_matches> const am( POP( matches ) );
+  auto_ptr<ft_all_matches> const am( POP( matches_stack_ ) );
   auto_ptr<ft_all_matches> result( new ft_all_matches );
   apply_ftscope( *am, f.get_scope(), f.get_unit(), *result );
-  PUSH( matches, result.release() );
+  PUSH( matches_stack_, result.release() );
   END_VISIT( ftscope_filter );
 }

 DEF_FTNODE_VISITOR_BEGIN_VISIT( V, ftwindow_filter )
 void V::end_visit( ftwindow_filter &f ) {
-  auto_ptr<ft_all_matches> const am( POP( matches ) );
+  auto_ptr<ft_all_matches> const am( POP( matches_stack_ ) );
   auto_ptr<ft_all_matches> result( new ft_all_matches );
   apply_ftwindow( *am, get_int( f.get_window_iter() ), f.get_unit(), *result );
-  PUSH( matches, result.release() );
+  PUSH( matches_stack_, result.release() );
   END_VISIT( ftwindow_filter );
 }


Update rpc.cpp

Update rpc.cpp

--- src/test/fuzz/rpc.cpp
+++ src/test/fuzz/rpc.cpp
@@ -143,6 +143,8 @@
     "assetallocationbalance",
     "sendfrom",
     "getauxblock",
+    "createauxblock",
+    "submitauxblock",
     "syscoingettxroots",
     "syscoingetspvproof",
     "convertaddress",


Add class fillers for the remaining gui elements.

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@6326 662fdd30-d327-0410-a531-f549c87e1e9e

--- src/test/gui/test.cpp
+++ src/test/gui/test.cpp
@@ -234,6 +234,174 @@
     Gui::FadeTool fader;
 };

+/*! TODO LineEdit Gui Component */
+class TestLineEdit : public GuiComponent {
+public:
+    TestLineEdit():
+    GuiComponent("Gui::LineEdit"){
+    }
+    void up(){
+    }
+    void down(){
+    }
+    void right(){
+    }
+    void left(){
+    }
+    void actComponent(){
+    }
+    void drawComponent(const Graphics::Bitmap & where, const Font & font){
+        font.printf(320 - font.textLength(name.c_str())/2, 15, Graphics::makeColor(255, 255, 255), where, "%s", 0, name.c_str());
+        const std::string info = "TODO - Not Implemented yet";
+        font.printf(320 - font.textLength(info.c_str())/2, 240, Graphics::makeColor(255, 255, 255), where, "%s", 0, info.c_str());
+    }
+protected:
+};
+
+/*! TODO PopupBox Gui Component */
+class TestPopupBox : public GuiComponent {
+public:
+    TestPopupBox():
+    GuiComponent("Gui::PopupBox"){
+    }
+    void up(){
+    }
+    void down(){
+    }
+    void right(){
+    }
+    void left(){
+    }
+    void actComponent(){
+    }
+    void drawComponent(const Graphics::Bitmap & where, const Font & font){
+        font.printf(320 - font.textLength(name.c_str())/2, 15, Graphics::makeColor(255, 255, 255), where, "%s", 0, name.c_str());
+        const std::string info = "TODO - Not Implemented yet";
+        font.printf(320 - font.textLength(info.c_str())/2, 240, Graphics::makeColor(255, 255, 255), where, "%s", 0, info.c_str());
+    }
+protected:
+};
+
+/*! TODO ScrollList Gui Component */
+class TestScrollList : public GuiComponent {
+public:
+    TestScrollList():
+    GuiComponent("Gui::ScrollList"){
+    }
+    void up(){
+    }
+    void down(){
+    }
+    void right(){
+    }
+    void left(){
+    }
+    void actComponent(){
+    }
+    void drawComponent(const Graphics::Bitmap & where, const Font & font){
+        font.printf(320 - font.textLength(name.c_str())/2, 15, Graphics::makeColor(255, 255, 255), where, "%s", 0, name.c_str());
+        const std::string info = "TODO - Not Implemented yet";
+        font.printf(320 - font.textLength(info.c_str())/2, 240, Graphics::makeColor(255, 255, 255), where, "%s", 0, info.c_str());
+    }
+protected:
+};
+
+/*! TODO NormalList Gui Component */
+class TestNormalList : public GuiComponent {
+public:
+    TestNormalList():
+    GuiComponent("Gui::NormalList"){
+    }
+    void up(){
+    }
+    void down(){
+    }
+    void right(){
+    }
+    void left(){
+    }
+    void actComponent(){
+    }
+    void drawComponent(const Graphics::Bitmap & where, const Font & font){
+        font.printf(320 - font.textLength(name.c_str())/2, 15, Graphics::makeColor(255, 255, 255), where, "%s", 0, name.c_str());
+        const std::string info = "TODO - Not Implemented yet";
+        font.printf(320 - font.textLength(info.c_str())/2, 240, Graphics::makeColor(255, 255, 255), where, "%s", 0, info.c_str());
+    }
+protected:
+};
+
+/*! TODO SimpleSelect Gui Component */
+class TestSimpleSelect : public GuiComponent {
+public:
+    TestSimpleSelect():
+    GuiComponent("Gui::SimpleSelect"){
+    }
+    void up(){
+    }
+    void down(){
+    }
+    void right(){
+    }
+    void left(){
+    }
+    void actComponent(){
+    }
+    void drawComponent(const Graphics::Bitmap & where, const Font & font){
+        font.printf(320 - font.textLength(name.c_str())/2, 15, Graphics::makeColor(255, 255, 255), where, "%s", 0, name.c_str());
+        const std::string info = "TODO - Not Implemented yet";
+        font.printf(320 - font.textLength(info.c_str())/2, 240, Graphics::makeColor(255, 255, 255), where, "%s", 0, info.c_str());
+    }
+protected:
+};
+
+/*! TODO GridSelect Gui Component */
+class TestGridSelect : public GuiComponent {
+public:
+    TestGridSelect():
+    GuiComponent("Gui::GridSelect"){
+    }
+    void up(){
+    }
+    void down(){
+    }
+    void right(){
+    }
+    void left(){
+    }
+    void actComponent(){
+    }
+    void drawComponent(const Graphics::Bitmap & where, const Font & font){
+        font.printf(320 - font.textLength(name.c_str())/2, 15, Graphics::makeColor(255, 255, 255), where, "%s", 0, name.c_str());
+        const std::string info = "TODO - Not Implemented yet";
+        font.printf(320 - font.textLength(info.c_str())/2, 240, Graphics::makeColor(255, 255, 255), where, "%s", 0, info.c_str());
+    }
+protected:
+};
+
+/*! TODO TabbedBox Gui Component */
+class TestTabbedBox : public GuiComponent {
+public:
+    TestTabbedBox():
+    GuiComponent("Gui::TabbedBox"){
+    }
+    void up(){
+    }
+    void down(){
+    }
+    void right(){
+    }
+    void left(){
+    }
+    void actComponent(){
+    }
+    void drawComponent(const Graphics::Bitmap & where, const Font & font){
+        font.printf(320 - font.textLength(name.c_str())/2, 15, Graphics::makeColor(255, 255, 255), where, "%s", 0, name.c_str());
+        const std::string info = "TODO - Not Implemented yet";
+        font.printf(320 - font.textLength(info.c_str())/2, 240, Graphics::makeColor(255, 255, 255), where, "%s", 0, info.c_str());
+    }
+protected:
+};
+
 /*! Gui Handler */
 class GuiHandler {
 public:
@@ -245,6 +413,13 @@
         components.push_back(new TestContextBox());
         components.push_back(new TestCutScene());
         components.push_back(new TestFadeTool());
+        components.push_back(new TestLineEdit());
+        components.push_back(new TestPopupBox());
+        components.push_back(new TestScrollList());
+        components.push_back(new TestNormalList());
+        components.push_back(new TestSimpleSelect());
+        components.push_back(new TestGridSelect());
+        components.push_back(new TestTabbedBox());

         // Set first as active
         components[0].convert<GuiComponent>()->toggle();
@@ -294,9 +469,7 @@

     void act(){
         if (!selected){
-            components[list.getCurrentIndex()].convert<GuiComponent>()->toggle();
             list.act();
-            components[list.getCurrentIndex()].convert<GuiComponent>()->toggle();
         } else {
             components[list.getCurrentIndex()].convert<GuiComponent>()->actComponent();
         }
@@ -396,7 +569,6 @@
     std::string controls;

     void draw(const Graphics::Bitmap & buffer){
-        //buffer.putPixel(rand() % 640, rand() % 480, Graphics::makeColor(rand() % 255, rand() % 255, rand() % 255));
         buffer.clear();
         handler.draw(buffer, Font::getDefaultFont());
         Font::getDefaultFont().printf(320 - Font::getDefaultFont().textLength(controls.c_str())/2, 460, Graphics::makeColor(255, 255, 255), buffer, "%s", 0, controls.c_str());


allow keys to repeat in the gui test

allow keys to repeat in the gui test

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@6329 662fdd30-d327-0410-a531-f549c87e1e9e

--- src/test/gui/test.cpp
+++ src/test/gui/test.cpp
@@ -619,6 +619,7 @@
     InputManager manager;
     Graphics::Bitmap screen(Graphics::getScreenBuffer());
     Util::Parameter<Graphics::Bitmap*> use(Graphics::screenParameter, &screen);
+    Keyboard::pushRepeatState(true);

     InputMap<Keys> input;
     input.set(Keyboard::Key_ESC, 0, true, Esc);


Fixed compiler warnings

Fixed compiler warnings

--- src/test/src/main.cpp
+++ src/test/src/main.cpp
@@ -510,8 +510,6 @@
     {
         char buffer[BufferSize];
         int  ip[3];
-        int  in[3];
-        int  it[3];
         float x[3];
         char * pch;
         char * str;
@@ -567,8 +565,7 @@
                     if (nt > 0)
                     {
                         pch = strtok(NULL, ObjDelimiters);
-                        if (pch)  it[k] = atoi(pch) - 1;
-                        else
+                        if (!pch)
                         {
                             return false;
                         }
@@ -576,8 +573,7 @@
                     if (nn > 0)
                     {
                         pch = strtok(NULL, ObjDelimiters);
-                        if (pch)  in[k] = atoi(pch) - 1;
-                        else
+                        if (!pch)
                         {
                             return false;
                         }


Trace time spent in BrowserMainLoop::MainMessageLoopStart

BUG=222350

Review URL: https://chromiumcodereview.appspot.com/15713006

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

--- content/browser/browser_main_loop.cc
+++ content/browser/browser_main_loop.cc
@@ -371,27 +371,56 @@

   InitializeMainThread();

-  system_monitor_.reset(new base::SystemMonitor);
-  power_monitor_.reset(new base::PowerMonitor);
-  hi_res_timer_manager_.reset(new HighResolutionTimerManager);
-  network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
-
-  media::InitializeCPUSpecificMediaFeatures();
-  audio_manager_.reset(media::AudioManager::Create());
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:SystemMonitor")
+    system_monitor_.reset(new base::SystemMonitor);
+  }
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:PowerMonitor")
+    power_monitor_.reset(new base::PowerMonitor);
+  }
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:HighResTimerManager")
+    hi_res_timer_manager_.reset(new HighResolutionTimerManager);
+  }
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:NetworkChangeNotifier")
+    network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
+  }
+
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MediaFeatures")
+    media::InitializeCPUSpecificMediaFeatures();
+  }
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:AudioMan")
+    audio_manager_.reset(media::AudioManager::Create());
+  }
+

 #if !defined(OS_IOS)
-  WebUIControllerFactory::RegisterFactory(
-      ContentWebUIControllerFactory::GetInstance());
-
-  audio_mirroring_manager_.reset(new AudioMirroringManager());
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:ContentWebUIController")
+    WebUIControllerFactory::RegisterFactory(
+        ContentWebUIControllerFactory::GetInstance());
+  }
+
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:AudioMirroringManager")
+    audio_mirroring_manager_.reset(new AudioMirroringManager());
+  }

   // Start tracing to a file if needed.
   if (base::debug::TraceLog::GetInstance()->IsEnabled()) {
+    TRACE_EVENT0("startup", "BrowserMainLoop::InitStartupTracing")
     TraceControllerImpl::GetInstance()->InitStartupTracing(
         parsed_command_line_);
   }

-  online_state_observer_.reset(new BrowserOnlineStateObserver);
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:OnlineStateObserver")
+    online_state_observer_.reset(new BrowserOnlineStateObserver);
+  }
 #endif  // !defined(OS_IOS)

 #if defined(ENABLE_PLUGINS)
@@ -399,7 +428,10 @@
   // plugin service as it is predominantly used from the io thread,
   // but must be created on the main thread. The service ctor is
   // inexpensive and does not invoke the io_thread() accessor.
-  PluginService::GetInstance()->Init();
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:PluginService")
+    PluginService::GetInstance()->Init();
+  }
 #endif

 #if defined(OS_WIN)
@@ -421,11 +453,18 @@
     parts_->PostMainMessageLoopStart();

 #if defined(OS_ANDROID)
-  SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl());
-  DataFetcherImplAndroid::Init(base::android::AttachCurrentThread());
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:SurfaceTexturePeer")
+    SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl());
+  }
+  {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:DataFetcher")
+    DataFetcherImplAndroid::Init(base::android::AttachCurrentThread());
+  }
 #endif

   if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) {
+    TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver")
     memory_observer_.reset(new MemoryObserver());
     base::MessageLoop::current()->AddTaskObserver(memory_observer_.get());
   }
@@ -719,6 +758,7 @@
 }

 void BrowserMainLoop::InitializeMainThread() {
+  TRACE_EVENT0("startup", "BrowserMainLoop::InitializeMainThread")
   const char* kThreadName = "CrBrowserMain";
   base::PlatformThread::SetName(kThreadName);
   if (main_message_loop_)


Make the log buffer stupid large.

Make the log buffer stupid large.

--- src/xenia/base/logging.cc
+++ src/xenia/base/logging.cc
@@ -69,7 +69,7 @@
   }
 }

-thread_local char log_buffer[2048];
+thread_local char log_buffer[16 * 1024];

 void log_line(const char* file_path, const uint32_t line_number,
               const char level_char, const char* fmt, ...) {


fix typo of allocator, test=develop (#19578)

--- paddle/fluid/memory/detail/system_allocator.cc
+++ paddle/fluid/memory/detail/system_allocator.cc
@@ -123,7 +123,7 @@
         " MB GPU memory. Please shrink "
         "FLAGS_fraction_of_gpu_memory_to_use or "
         "FLAGS_initial_gpu_memory_in_mb or "
-        "FLAGS_reallocate_gpu_memory_in_mb"
+        "FLAGS_reallocate_gpu_memory_in_mb "
         "environment variable to a lower value. " +
         "Current FLAGS_fraction_of_gpu_memory_to_use value is " +
         std::to_string(FLAGS_fraction_of_gpu_memory_to_use) +


Modify how a zone-name "file:" prefix is discarded (#128)

- We don't want to discard "file:" more than once.
- Using recursion risks stack overflow.

--- src/time_zone_info.cc
+++ src/time_zone_info.cc
@@ -629,11 +629,11 @@
 std::unique_ptr<ZoneInfoSource> FileZoneInfoSource::Open(
     const std::string& name) {
   // Use of the "file:" prefix is intended for testing purposes only.
-  if (name.compare(0, 5, "file:") == 0) return Open(name.substr(5));
+  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;

   // Map the time-zone name to a path name.
   std::string path;
-  if (name.empty() || name[0] != '/') {
+  if (pos == name.size() || name[pos] != '/') {
     const char* tzdir = "/usr/share/zoneinfo";
     char* tzdir_env = nullptr;
 #if defined(_MSC_VER)
@@ -648,7 +648,7 @@
     free(tzdir_env);
 #endif
   }
-  path += name;
+  path.append(name, pos, std::string::npos);

   // Open the zoneinfo file.
   FILE* fp = FOpen(path.c_str(), "rb");
@@ -678,7 +678,7 @@
 std::unique_ptr<ZoneInfoSource> AndroidZoneInfoSource::Open(
     const std::string& name) {
   // Use of the "file:" prefix is intended for testing purposes only.
-  if (name.compare(0, 5, "file:") == 0) return Open(name.substr(5));
+  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;

   // See Android's libc/tzcode/bionic.cpp for additional information.
   for (const char* tzdata : {"/data/misc/zoneinfo/current/tzdata",
@@ -707,7 +707,7 @@
       const std::int_fast32_t length = Decode32(ebuf + 44);
       if (start < 0 || length < 0) break;
       ebuf[40] = '\0';  // ensure zone name is NUL terminated
-      if (strcmp(name.c_str(), ebuf) == 0) {
+      if (strcmp(name.c_str() + pos, ebuf) == 0) {
         if (fseek(fp.get(), static_cast<long>(start), SEEK_SET) != 0) break;
         return std::unique_ptr<ZoneInfoSource>(new AndroidZoneInfoSource(
             fp.release(), static_cast<std::size_t>(length), vers));


Replace sprintf with std::ostringstream.

--- src/tinysplinecxx.cxx
+++ src/tinysplinecxx.cxx
@@ -1179,13 +1179,10 @@
 	size_t expected = ts_bspline_len_control_points(&spline);
 	size_t actual = ctrlp.size();
 	if (expected != actual) {
-		char expected_str[32];
-		char actual_str[32];
-		sprintf(expected_str, "%lu", (unsigned long) expected);
-		sprintf(actual_str, "%lu", (unsigned long) actual);
-		throw std::runtime_error(
-			"Expected size: " + std::string(expected_str) +
-			", Actual size: " + std::string(actual_str));
+		std::ostringstream oss;
+		oss << "Expected size: " << expected
+		    << ", Actual size: " << actual;
+		throw std::runtime_error(oss.str());
 	}
 	tsStatus status;
 	if (ts_bspline_set_control_points(&spline, ctrlp.data(), &status))


Early-return in RenderViewImpl::DidFlushPaint() if there is no WebView.

CL 9328016 exposed a bug with seemingly-unused stats code assuming that the RenderView's WebView must be valid when DidFlushPaint() is called, which may not be true if RenderWidget::OnSwapBuffersComplete is notified while the widget is closing down.

We'll follow up by verifying the stats code is unnecessary and removing it (see bug 112942).

BUG=112921,111639,112942

Review URL: http://codereview.chromium.org/9349004

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

--- content/renderer/render_view_impl.cc
+++ content/renderer/render_view_impl.cc
@@ -4348,6 +4348,11 @@
   // won't change out from under us.
   pepper_delegate_.ViewFlushedPaint();

+  // If the RenderWidget is closing down then early-exit, otherwise we'll crash.
+  // See crbug.com/112921.
+  if (!webview())
+    return;
+
   WebFrame* main_frame = webview()->mainFrame();

   // If we have a provisional frame we are between the start and commit stages


Fix class member initialization

Fix class member initialization

--- src/tools/ctdumper.cc
+++ src/tools/ctdumper.cc
@@ -30,10 +30,10 @@
 	}

 public:
-	bool listenerError = false;
+	bool listenerError;

 public:
-	DumpListener(su_root_t* _root) : RegistrarDbListener(), root(_root) {}
+	DumpListener(su_root_t* _root) : RegistrarDbListener(), root(_root), listenerError(false) {}

 	virtual void onRecordFound(Record *record) {
 		if (record) cout << *record           << endl;


fix for apply scalar unary

fix for apply scalar unary

--- stan/math/rev/fun/log.hpp
+++ stan/math/rev/fun/log.hpp
@@ -4,6 +4,7 @@
 #include <stan/math/prim/fun/log.hpp>
 #include <stan/math/rev/meta.hpp>
 #include <stan/math/rev/core.hpp>
+#include <stan/math/rev/functor/apply_scalar_unary.hpp>
 #include <stan/math/rev/fun/abs.hpp>
 #include <stan/math/rev/fun/arg.hpp>
 #include <stan/math/rev/fun/atan2.hpp>


Disable WorkerTest.TerminateQueuedWorkers.
Started to fail after WK roll 89393:89463.
BUG=87204

Review URL: http://codereview.chromium.org/7198013

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

--- content/worker/test/worker_uitest.cc
+++ content/worker/test/worker_uitest.cc
@@ -188,6 +188,11 @@
 #if defined(OS_LINUX) || defined(OS_CHROMEOS)
 // http://crbug.com/80446
 #define TerminateQueuedWorkers FLAKY_TerminateQueuedWorkers
+#endif
+
+#if defined(OS_MACOSX)
+// http://crbug.com/87204
+#define TerminateQueuedWorkers DISABLED_TerminateQueuedWorkers
 #endif

 TEST_F(WorkerTest, TerminateQueuedWorkers) {


INTEGRATION: CWS ooo19126 (1.3.456); FILE MERGED 2005/09/05 17:37:21 rt 1.3.456.1: #i54170# Change license header: remove SISSL

--- starmath/inc/applicat.hxx
+++ starmath/inc/applicat.hxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: applicat.hxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.4 $
  *
- *  last change: $Author: fme $ $Date: 2001-08-16 09:14:25 $
+ *  last change: $Author: rt $ $Date: 2005-09-07 14:57:06 $
  *
- *  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
  *
  ************************************************************************/


CWS gnumake3: some more fixes for windows and svx; remove superfluous code in starmath that still used old _DLL_ define

--- starmath/inc/applicat.hxx
+++ starmath/inc/applicat.hxx
@@ -76,30 +76,5 @@

 #endif

-#ifndef _DLL_
-class SmDLL;
-
-class SmApplicat: public SfxApplication
-{
-protected:
-    SvxErrorHandler     *pSvxErrorHandler;
-
-    virtual void        OpenClients();
-
-    // initialization / deinitialization
-    virtual void        Init();
-    virtual void        Exit();
-
-public:
-    void Main();
-
-    SmApplicat() :
-        SfxApplication("iso")
-    {
-    }
-
-};
-
-#endif
 #endif


INTEGRATION: CWS mav09 (1.18.74); FILE MERGED 2004/08/12 17:09:38 mav 1.18.74.5: #i27773# introduce version back 2004/04/29 11:05:05 mba 1.18.74.4: #i27773#: remove so3 2004/04/14 13:24:37 mba 1.18.74.3: #i27773#: remove so3; new storage API 2004/04/14 12:45:30 mba 1.18.74.2: #i27773#: remove so3; new storage API 2004/04/14 12:29:40 mba 1.18.74.1: #i27773#: remove so3; new storage API

--- starmath/inc/document.hxx
+++ starmath/inc/document.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: document.hxx,v $
  *
- *  $Revision: 1.18 $
- *
- *  last change: $Author: rt $ $Date: 2003-09-19 08:51:11 $
+ *  $Revision: 1.19 $
+ *
+ *  last change: $Author: kz $ $Date: 2004-10-04 18:02:50 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -63,8 +63,8 @@

 #define SMDLL   1

-#ifndef _SVSTOR_HXX //autogen
-#include <so3/svstor.hxx>
+#ifndef _SOT_STORAGE_HXX
+#include <sot/storage.hxx>
 #endif
 #ifndef _SOT_SOTREF_HXX //autogen
 #include <sot/sotref.hxx>
@@ -72,9 +72,6 @@
 #ifndef _SFX_OBJSH_HXX //autogen
 #include <sfx2/objsh.hxx>
 #endif
-#ifndef _SFX_INTERNO_HXX //autogen
-#include <sfx2/interno.hxx>
-#endif
 #ifndef _SFXLSTNER_HXX //autogen
 #include <svtools/lstner.hxx>
 #endif
@@ -94,16 +91,13 @@
 #ifndef SMMOD_HXX
 #include "smmod.hxx"
 #endif
+
+#include <vcl/jobset.hxx>

 class SmNode;
 class SmSymSetManager;
 class SfxPrinter;
 class Printer;
-
-#ifndef SO2_DECL_SVSTORAGESTREAM_DEFINED
-#define SO2_DECL_SVSTORAGESTREAM_DEFINED
-SO2_DECL_REF(SvStorageStream)
-#endif

 #define HINT_DATACHANGED    1004

@@ -153,19 +147,16 @@

 ////////////////////////////////////////////////////////////

-class SmDocShell : public SfxObjectShell, public SfxInPlaceObject,
-                    public SfxListener
+class SmDocShell : public SfxObjectShell, public SfxListener
 {
     friend class SmPrinterAccess;

     String              aText;
     SmFormat            aFormat;
     SmParser            aInterpreter;
-    SvStorageStreamRef  aDocStream;
     String              aAccText;
     SmSymSetManager    *pSymSetMgr;
     SmNode             *pTree;
-    SvInPlaceMenuBar   *pMenuBar;
     SfxMenuBarManager  *pMenuMgr;
     SfxItemPool        *pEditEngineItemPool;
     EditEngine         *pEditEngine;
@@ -198,20 +189,19 @@
                                   String* pAppName,
                                   String* pFullTypeName,
                                   String* pShortTypeName,
-                                  long    nFileFormat = SOFFICE_FILEFORMAT_CURRENT) const;
+                                  sal_Int32 nFileFormat ) const;

     virtual BOOL        SetData( const String& rData );
     virtual ULONG       GetMiscStatus() const;
     virtual void        OnDocumentPrinterChanged( Printer * );
-    virtual BOOL        InitNew(SvStorage *);
-    virtual BOOL        Load(SvStorage *);
-    virtual BOOL        Insert(SvStorage *);
+    virtual sal_Bool    InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+    virtual BOOL        Load( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+    virtual BOOL        Insert( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
             void        ImplSave(  SvStorageStreamRef xStrm  );
     virtual BOOL        Save();
-    virtual BOOL        SaveAs( SvStorage *pNewStor );
+    virtual BOOL        SaveAs( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
     virtual BOOL        ConvertTo( SfxMedium &rMedium );
-    virtual BOOL        SaveCompleted( SvStorage *pNewStor );
-    virtual void        HandsOff();
+    virtual BOOL        SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );

     Printer             *GetPrt();
     OutputDevice*       GetRefDev();
@@ -233,7 +223,7 @@
 public:
     TYPEINFO();
     SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START+1);
-    SFX_DECL_OBJECTFACTORY(SmDocShell);
+    SFX_DECL_OBJECTFACTORY();

                 SmDocShell(SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED);
     virtual     ~SmDocShell();


fix debug=2 build

fix debug=2 build

Change-Id: I0163fe1668d35b3b108f9b57653fa490ae174ee0

--- starmath/source/parse.cxx
+++ starmath/source/parse.cxx
@@ -328,11 +328,12 @@
 bool SmParser::IsDelimiter( const OUString &rTxt, sal_Int32 nPos )
     // returns 'true' iff cChar is '\0' or a delimiter
 {
-    OSL_ENSURE( nPos <= rTxt.getLength(), "index out of range" );
+    assert(nPos <= rTxt.getLength()); //index out of range
+
+    if (nPos == rTxt.getLength())
+        return true;

     sal_Unicode cChar = rTxt[nPos];
-    if(!cChar)
-        return true;

     // check if 'cChar' is in the delimiter table
     const sal_Unicode *pDelim = &aDelimiterTable[0];


Added assertion in treepartition method

Added assertion in treepartition method

--- src/treepartition.cpp
+++ src/treepartition.cpp
@@ -235,6 +235,7 @@
     {
         int local_index;

+        assert(ID_map.size() == parts.size());
         std::map<int,int>::const_iterator it = ID_map.find(part_ID);

         if( it == ID_map.end() ) {


Fix parenthesis and simplify

Fix parenthesis and simplify

See http://nabble.documentfoundation.org/About-parenthesis-problem-in-testintrosp-cxx-td4030420.html
Thank you Lubos!

Change-Id: If46b3d3aa304f2c16d66813ff337a70b3a520e76

--- stoc/test/testintrosp.cxx
+++ stoc/test/testintrosp.cxx
@@ -179,7 +179,7 @@
     if( bIncludeType )
     {
         Reference< XIdlClass > xIdlClass = TypeToIdlClass( aValType, xMgr );
-        aRetStr = aRetStr + OUString( OUString(" (Typ: ") ) + xIdlClass->getName() + OUString(""));
+        aRetStr += " (Typ: " + xIdlClass->getName() + ")";
     }
     return aRetStr;
 }


- added TODO note

- added TODO note

--- storage/Devices/MdImpl.cc
+++ storage/Devices/MdImpl.cc
@@ -157,6 +157,8 @@
 	Devicegraph::Impl& devicegraph = get_devicegraph()->get_impl();
 	Devicegraph::Impl::vertex_descriptor vertex = get_vertex();

+	// TODO sorting
+
 	return devicegraph.filter_devices_of_type<BlkDevice>(devicegraph.parents(vertex));
     }

@@ -166,6 +168,8 @@
     {
 	const Devicegraph::Impl& devicegraph = get_devicegraph()->get_impl();
 	Devicegraph::Impl::vertex_descriptor vertex = get_vertex();
+
+	// TODO sorting

 	return devicegraph.filter_devices_of_type<const BlkDevice>(devicegraph.parents(vertex));
     }


Create lock with proper permissions (bsc#1059972)

--- storage/Utils/LockImpl.cc
+++ storage/Utils/LockImpl.cc
@@ -66,8 +66,8 @@
 		y2err("creating directory for lock-file failed: " << strerror(errno));
 	    }

-	    fd = open(LOCK_DIR "/lock", (read_only ? O_RDONLY : O_WRONLY) | O_CREAT | O_CLOEXEC,
-		      S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+	    fd = open(LOCK_DIR "/lock", (read_only ? O_RDONLY : O_WRONLY) | O_CREAT | O_CLOEXEC, 0600);
+
 	    if (fd < 0)
 	    {
 		// Opening lock-file failed.


Updated the about box.

Updated the about box.

--- src/ui/mainwindow.cpp
+++ src/ui/mainwindow.cpp
@@ -313,8 +313,7 @@
                            "
"+getOsName()+"
"+
                        ""+
                        "
"+
-                       ""+qApp->applicationName()+" "+tr("is a cross-platform CellML-based modelling environment which can be used to organise, edit, simulate and analyse CellML files.")+"

"+
-                       qApp->applicationName()+" "+tr("is written in C++, using the Qt framework, and is not currently released under any particular license, but this is due to change in the near future."));
+                       ""+qApp->applicationName()+" "+tr("is a cross-platform CellML-based modelling environment which can be used to organise, edit, simulate and analyse CellML files."));
 }

 void MainWindow::resetAll(const bool& pClearUserSettings)


Skip clearIntPcRegs for now in MPIPL path in simics

Simics model is breaking when we attempt to access this during MPIPL.
If we skip this function call, we much it much further in the IPL so
we will disable this for now.

Change-Id: Ib122501c9004faa275d6719f085b9d88866f0aef
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/99533
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Tested-by: Jenkins Combined Simics CI <8312af3886dfc9bb930f549023677220805b137e@us.ibm.com>
Reviewed-by: Chen Du <10793d83dd2b346092aca99468e01b6a2b9d993a@us.ibm.com>
Reviewed-by: Ilya Smirnov <2c7a6ec38cfb553b896499595cca9c656159f2a4@us.ibm.com>
Reviewed-by: William G Hoffa <7dd6aa5e78423995d9d7c7ecada5b77ee07f88cc@us.ibm.com>

--- src/usr/intr/intrrp.C
+++ src/usr/intr/intrrp.C
@@ -171,7 +171,11 @@

         // Clear out the PC registers that did not get properly cleared during
         // the SBE steps of MPIPL
-        clearIntPcRegs();
+        // TODO RTC:215215 re-enable when we get this working in simics
+        if(!Util::isSimicsRunning())
+        {
+            clearIntPcRegs();
+        }

         //Reset PSIHB Interrupt Space
         TRACFCOMP(g_trac_intr, "Reset PSIHB Interrupt Space");


Fix label

Fix label

--- src/viewer/viewer.cpp
+++ src/viewer/viewer.cpp
@@ -1954,11 +1954,11 @@
             ImGui::SameLine();
             if (algo == Pathtracing)
             {
-                ImGui::Text("SPP: %7u", std::max(1U, frame_num));
+                ImGui::Text("Frames: %7u", std::max(1U, frame_num));
             }
             else
             {
-                ImGui::Text("SPP: %dx SSAA", spp);
+                ImGui::Text("SSAA: %dx", spp);
             }

             ImGui::Text("Device: %s", rt.mode() == host_device_rt::GPU ? "GPU" : "CPU");


Fix info output in vspipe

Fix info output in vspipe

git-svn-id: ac1113e4705722bd5ee69cef058b32c421e857b8@507 f9120d27-2007-6f97-8312-0f4ebfa7710f

--- src/vspipe/vspipe.cpp
+++ src/vspipe/vspipe.cpp
@@ -339,7 +339,7 @@
 			fprintf(outFile, "SubSampling W: %d\n", vi->format->subSamplingW);
 			fprintf(outFile, "SubSampling H: %d\n", vi->format->subSamplingH);
 		} else {
-			printf("Format Name: Variable\n");
+			fprintf(outFile, "Format Name: Variable\n");
 		}
 	} else {
 		if (!isConstantFormat(vi) || vi->numFrames == 0) {


vspipe: silence warnings

vspipe: silence warnings

--- src/vspipe/vspipe.cpp
+++ src/vspipe/vspipe.cpp
@@ -134,7 +134,7 @@
                         int rowSize = vsapi->getFrameWidth(frame, p) * fi->bytesPerSample;
                         int height = vsapi->getFrameHeight(frame, p);
                         for (int y = 0; y < height; y++) {
-                            if (fwrite(readPtr, 1, rowSize, outFile) != rowSize) {
+                            if (fwrite(readPtr, 1, rowSize, outFile) != (size_t)rowSize) {
                                 if (errorMessage.empty())
                                     errorMessage = "Error: fwrite() call failed when writing frame: " + std::to_string(outputFrames) + ", plane: " + std::to_string(p) +
                                         ", line: " + std::to_string(y) + ", errno: " + std::to_string(errno);
@@ -408,7 +408,6 @@
             totalFrames++;
             arg++;
         } else if (argString == NSTRING("-index")) {
-            bool ok = false;
             if (argc <= arg + 1) {
                 fprintf(stderr, "No index number specified\n");
                 return 1;
@@ -420,7 +419,6 @@
             }
             arg++;
         } else if (argString == NSTRING("-requests")) {
-            bool ok = false;
             if (argc <= arg + 1) {
                 fprintf(stderr, "No request number specified\n");
                 return 1;


Wallet: Support loading multiple wallets if -wallet used more than once

--- src/wallet/wallet.cpp
+++ src/wallet/wallet.cpp
@@ -4981,19 +4981,21 @@
         return true;
     }

-    std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT);
-
-    if (boost::filesystem::path(walletFile).filename() != walletFile) {
-        return InitError(_("-wallet parameter must only specify a filename (not a path)"));
-    } else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) {
-        return InitError(_("Invalid characters in -wallet filename"));
-    }
-
-    CWallet * const pwallet = CreateWalletFromFile(walletFile);
-    if (!pwallet) {
-        return false;
-    }
-    vpwallets.push_back(pwallet);
+    SoftSetArg("-wallet", DEFAULT_WALLET_DAT);
+
+    for (const std::string& walletFile : gArgs.GetArgs("-wallet")) {
+        if (boost::filesystem::path(walletFile).filename() != walletFile) {
+            return InitError(_("-wallet parameter must only specify a filename (not a path)"));
+        } else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) {
+            return InitError(_("Invalid characters in -wallet filename"));
+        }
+
+        CWallet * const pwallet = CreateWalletFromFile(walletFile);
+        if (!pwallet) {
+            return false;
+        }
+        vpwallets.push_back(pwallet);
+    }

     return true;
 }


checks for null data transaction before debug.log

CWalletTx::GetAmounts could not find output address for null data transactions, thus issuing an error in debug.log. This change checks to see if the transaction is OP_RETURN before issuing error.

resolves #6142

--- src/wallet/wallet.cpp
+++ src/wallet/wallet.cpp
@@ -1034,7 +1034,8 @@

         // In either case, we need to get the destination address
         CTxDestination address;
-        if (!ExtractDestination(txout.scriptPubKey, address))
+
+        if (!ExtractDestination(txout.scriptPubKey, address) && txout.scriptPubKey[0] != OP_RETURN)
         {
             LogPrintf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n",
                      this->GetHash().ToString());


Add declarations for consensusParams

Add declarations for consensusParams

--- src/wallet/wallet.cpp
+++ src/wallet/wallet.cpp
@@ -2663,6 +2663,8 @@
         if (nCredit >= GetStakeSplitThreshold())
             txNew.vout.push_back(CTxOut(0, txNew.vout[1].scriptPubKey)); //split stake

+        const Consensus::Params& consensusParams = Params().GetConsensus();
+
         if (PROTOCOL_VERSION >= 70200 && block.nVersion >= 3 && IsSuperMajority(3, pindex->pprev, consensusParams.nEnforceBlockUpgradeMajority, consensusParams)) // New wallets do not remove the fee
         {
             // Set output amount


count cold staking balance when creating coinstake

--- src/wallet/wallet.cpp
+++ src/wallet/wallet.cpp
@@ -330,6 +330,7 @@

     // Choose coins to use
     int64_t nBalance = GetBalance();
+    int64_t nColdStakingBalance = GetColdStakingBalance();

     if (nBalance <= nReserveBalance)
         return false;
@@ -340,7 +341,7 @@
     int64_t nValueIn = 0;

     // Select coins with suitable depth
-    if (!SelectCoinsForStaking(nBalance - nReserveBalance, txNew.nTime, setCoins, nValueIn))
+    if (!SelectCoinsForStaking(nColdStakingBalance + nBalance - nReserveBalance, txNew.nTime, setCoins, nValueIn))
         return false;

     if (setCoins.empty())


wallet: Don't throw in CreateWalletFile (#4079)

To make sure `RemoveWallet` gets called in `error` lambda.

--- src/wallet/wallet.cpp
+++ src/wallet/wallet.cpp
@@ -5058,10 +5058,10 @@
                 CHDChain newHdChain;
                 std::vector<unsigned char> vchSeed = ParseHex(strSeed);
                 if (!newHdChain.SetSeed(SecureVector(vchSeed.begin(), vchSeed.end()), true)) {
-                    throw std::runtime_error(std::string(__func__) + ": SetSeed failed");
+                    return error(_("SetSeed failed"));
                 }
                 if (!walletInstance->SetHDChainSingle(newHdChain, false)) {
-                    throw std::runtime_error(std::string(__func__) + ": SetHDChainSingle failed");
+                    return error(_("SetHDChainSingle failed"));
                 }
                 newHdChain.Debug(__func__);
             } else {


wallet bugfix: use ismimetype to filter between spendable and delegated credit balance in GetAvailableBalance.

--- src/wallet/wallet.cpp
+++ src/wallet/wallet.cpp
@@ -1759,10 +1759,10 @@

 CAmount CWallet::GetAvailableBalance(bool fIncludeDelegated) const
 {
-    return loopTxsBalance([fIncludeDelegated](const uint256& id, const CWalletTx& pcoin, CAmount& nTotal){
+    isminetype filter = fIncludeDelegated ? ISMINE_SPENDABLE_ALL : ISMINE_SPENDABLE;
+    return loopTxsBalance([filter](const uint256& id, const CWalletTx& pcoin, CAmount& nTotal){
         if (pcoin.IsTrusted()) {
-            nTotal += pcoin.GetAvailableCredit();
-            if (!fIncludeDelegated) nTotal -= pcoin.GetStakeDelegationCredit();
+            nTotal += pcoin.GetAvailableCredit(true, filter);
         }
     });
 }


wallet: Avoid showing GUI popups on RPC errors (take 2)

--- src/wallet/wallet.cpp
+++ src/wallet/wallet.cpp
@@ -3687,9 +3687,7 @@
         }

         if (auto spk_man = walletInstance->m_spk_man.get()) {
-            std::string error;
             if (!spk_man->Upgrade(prev_version, error)) {
-                chain.initError(error);
                 return nullptr;
             }
         }