Small fix

Small fix

--- src/cmd/sources/cmd_classbook_add_record_handler.cpp
+++ src/cmd/sources/cmd_classbook_add_record_handler.cpp
@@ -33,7 +33,7 @@

 const QVector<CmdInputDef> &CmdClassbookAddRecordHandler::inputs(){
     return m_vInputs;
-};
+}

 QString CmdClassbookAddRecordHandler::description(){
     return "Adds a new article with the specified name, content, and id.";


Fix minor issues

Fix minor issues

--- src/core/MidiInterface.cpp
+++ src/core/MidiInterface.cpp
@@ -40,8 +40,7 @@
 void MidiIO::baseFromJson(json_t *rootJ) {
 	json_t *portNameJ = json_object_get(rootJ, "interfaceName");
 	if (portNameJ) {
-		deviceName = json_string_value(portNameJ);
-		openDevice(deviceName);
+		openDevice(json_string_value(portNameJ));
 	}

 	json_t *channelJ = json_object_get(rootJ, "channel");
@@ -64,9 +63,10 @@
 }

 void MidiIO::openDevice(std::string deviceName) {
+
 	MidiInWrapper *mw = midiInMap[deviceName];

-	if (id > 0 || deviceName != "") {
+	if (this->id > 0 || this->deviceName != "") {
 		close();
 	}

@@ -135,8 +135,11 @@
 }

 void MidiIO::close() {
+
 	MidiInWrapper * mw = midiInMap[deviceName];
-	if (!mw){
+
+	if (!mw || id < 0) {
+		fprintf(stderr, "Trying to close already closed device!\n");
 		return;
 	}

@@ -148,6 +151,7 @@
 	}

 	id = -1;
+	deviceName = "";
 }


MidiInterface cleanup

MidiInterface cleanup

--- src/core/MidiInterface.cpp
+++ src/core/MidiInterface.cpp
@@ -99,7 +99,6 @@
 }

 void MidiIO::setPortId(int portId) {
-
 	resetMidi(); // reset Midi values

 	// Close port if it was previously opened
@@ -283,10 +282,9 @@
 void MIDIToCVInterface::updateLights() {
 	lights[GATE_OUTPUT] = outputs[GATE_OUTPUT].value / 10;
 	lights[MOD_OUTPUT] = mod / 127.0;
-	lights[PITCHWHEEL_OUTPUT] = pitchWheel / 127.0;
+	lights[PITCHWHEEL_OUTPUT] = (pitchWheel - 64) / 127.0;
 	lights[CHANNEL_AFTERTOUCH_OUTPUT] = afterTouch / 127.0;
 	lights[VELOCITY_OUTPUT] = vel / 127.0;
-
 }

 void MIDIToCVInterface::step() {
@@ -420,10 +418,10 @@
 	float yPos = margin;
 	float yGap = 35;

-	addChild(createScrew<ScrewSilver>(Vec(margin, 0)));
-	addChild(createScrew<ScrewSilver>(Vec(box.size.x - 15 - margin, 0)));
-	addChild(createScrew<ScrewSilver>(Vec(margin, 365)));
-	addChild(createScrew<ScrewSilver>(Vec(box.size.x - 15 - margin, 365)));
+	addChild(createScrew<ScrewSilver>(Vec(15, 0)));
+	addChild(createScrew<ScrewSilver>(Vec(box.size.x - 30, 0)));
+	addChild(createScrew<ScrewSilver>(Vec(15, 365)));
+	addChild(createScrew<ScrewSilver>(Vec(box.size.x - 30, 365)));

 	{
 		Label *label = new Label();
@@ -431,7 +429,6 @@
 		label->text = "MIDI to CV";
 		addChild(label);
 		yPos = labelHeight * 2;
-
 	}

 	addParam(createParam<LEDButton>(Vec(7 * 15, labelHeight), module, MIDIToCVInterface::RESET_PARAM, 0.0, 1.0, 0.0));
@@ -466,8 +463,7 @@
 		yPos += channelChoice->box.size.y + margin + 15;
 	}

-	std::string labels[MIDIToCVInterface::NUM_OUTPUTS] = {"1V/oct", "Gate", "Velocity", "Mod Wheel",
-														  "Pitch Wheel", "Aftertouch"};
+	std::string labels[MIDIToCVInterface::NUM_OUTPUTS] = {"1V/oct", "Gate", "Velocity", "Mod Wheel", "Pitch Wheel", "Aftertouch"};

 	for (int i = 0; i < MIDIToCVInterface::NUM_OUTPUTS; i++) {
 		Label *label = new Label();
@@ -482,8 +478,6 @@
 		}
 		yPos += yGap + margin;
 	}
-
-
 }

 void MidiToCVWidget::step() {
@@ -663,17 +657,16 @@
 	float labelHeight = 15;
 	float yPos = margin;

-	addChild(createScrew<ScrewSilver>(Vec(margin, 0)));
-	addChild(createScrew<ScrewSilver>(Vec(box.size.x - 15 - margin, 0)));
-	addChild(createScrew<ScrewSilver>(Vec(margin, 365)));
-	addChild(createScrew<ScrewSilver>(Vec(box.size.x - 15 - margin, 365)));
+	addChild(createScrew<ScrewSilver>(Vec(15, 0)));
+	addChild(createScrew<ScrewSilver>(Vec(box.size.x - 30, 0)));
+	addChild(createScrew<ScrewSilver>(Vec(15, 365)));
+	addChild(createScrew<ScrewSilver>(Vec(box.size.x - 30, 365)));
 	{
 		Label *label = new Label();
 		label->box.pos = Vec(box.size.x - margin - 11 * 15, margin);
 		label->text = "MIDI CC to CV";
 		addChild(label);
 		yPos = labelHeight * 2;
-
 	}

 	{
@@ -724,8 +717,6 @@
 			yPos -= labelHeight + margin;
 		}
 	}
-
-
 }

 void MIDICCToCVWidget::step() {


Fix external SkImageFilter caching with clips.

When the external cache is active, do not intersect the saveLayer
bounds with the clip bounds.  This is so that the cache is always the
full size of the primitive's bounds, regardless of the clip active on
first draw. (Drawing of the filtered or cached result is always drawn
against the active clip, though, since it is restored before
internalDrawDevice() is called.)

This is a slightly hacky solution, but this code can all go away
(including the external cache) once all platforms have switched to
impl-side painting.

See Chromium bug http://crbug.com/379147.

BUG=skia:
R=reed@google.com

Author: senorblanco@chromium.org

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

--- src/core/SkImageFilter.cpp
+++ src/core/SkImageFilter.cpp
@@ -122,6 +122,16 @@
                                  SkIRect* dst) const {
     SkASSERT(&src);
     SkASSERT(dst);
+    if (SkImageFilter::GetExternalCache()) {
+        /*
+         *  When the external cache is active, do not intersect the saveLayer
+         *  bounds with the clip bounds. This is so that the cached result
+         *  is always the full size of the primitive's bounds,
+         *  regardless of the clip active on first draw.
+         */
+        *dst = SkIRect::MakeLargest();
+        return true;
+    }
     return this->onFilterBounds(src, ctm, dst);
 }


Fix compare of scalar against (int) kMaxTValue.
Also fix order of related compares, placing literal first.

http://code.google.com/p/skia/issues/detail?id=1127
Review URL: https://codereview.appspot.com/7385043

--- src/core/SkPathMeasure.cpp
+++ src/core/SkPathMeasure.cpp
@@ -283,7 +283,7 @@

     switch (segType) {
         case kLine_SegType:
-            if (stopT == kMaxTValue) {
+            if (SK_Scalar1 == stopT) {
                 dst->lineTo(pts[1]);
             } else {
                 dst->lineTo(SkScalarInterp(pts[0].fX, pts[1].fX, stopT),
@@ -291,8 +291,8 @@
             }
             break;
         case kQuad_SegType:
-            if (startT == 0) {
-                if (stopT == SK_Scalar1) {
+            if (0 == startT) {
+                if (SK_Scalar1 == stopT) {
                     dst->quadTo(pts[1], pts[2]);
                 } else {
                     SkChopQuadAt(pts, tmp0, stopT);
@@ -300,7 +300,7 @@
                 }
             } else {
                 SkChopQuadAt(pts, tmp0, startT);
-                if (stopT == SK_Scalar1) {
+                if (SK_Scalar1 == stopT) {
                     dst->quadTo(tmp0[3], tmp0[4]);
                 } else {
                     SkChopQuadAt(&tmp0[2], tmp1, SkScalarDiv(stopT - startT,
@@ -310,8 +310,8 @@
             }
             break;
         case kCubic_SegType:
-            if (startT == 0) {
-                if (stopT == SK_Scalar1) {
+            if (0 == startT) {
+                if (SK_Scalar1 == stopT) {
                     dst->cubicTo(pts[1], pts[2], pts[3]);
                 } else {
                     SkChopCubicAt(pts, tmp0, stopT);
@@ -319,7 +319,7 @@
                 }
             } else {
                 SkChopCubicAt(pts, tmp0, startT);
-                if (stopT == SK_Scalar1) {
+                if (SK_Scalar1 == stopT) {
                     dst->cubicTo(tmp0[4], tmp0[5], tmp0[6]);
                 } else {
                     SkChopCubicAt(&tmp0[3], tmp1, SkScalarDiv(stopT - startT,


Roll Skia from cf8c53436c77 to b43313646796 (1 revision)

https://skia.googlesource.com/skia.git/+log/cf8c53436c77..b43313646796

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://skia-autoroll.corp.goog/r/android-next-autoroll
Please CC stani@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Bug: 159177162
Test: Presubmit checks and Skia's test infrastructure.
Exempt-From-Owner-Approval: The autoroll bot does not require owner approval.
Merged-In: I217b84628a0d652336bb170804f094d4f9cf6c85
Change-Id: I0cba53ebbf069ac135bba4e206843a8e761daf2e

--- src/core/SkStrikeCache.cpp
+++ src/core/SkStrikeCache.cpp
@@ -101,6 +101,7 @@
         auto scaler = typeface.createScalerContext(effects, &desc);
         strike = this->internalCreateStrike(desc, std::move(scaler));
     }
+    this->internalPurge();
     return strike;
 }

@@ -181,7 +182,9 @@

 SkExclusiveStrikePtr SkStrikeCache::findStrikeExclusive(const SkDescriptor& desc) {
     SkAutoSpinlock ac(fLock);
-    return SkExclusiveStrikePtr(this->internalFindStrikeOrNull(desc));
+    sk_sp<SkStrike> result = this->internalFindStrikeOrNull(desc);
+    this->internalPurge();
+    return SkExclusiveStrikePtr(result);
 }

 auto SkStrikeCache::internalFindStrikeOrNull(const SkDescriptor& desc) -> sk_sp<Strike> {
@@ -251,11 +254,6 @@
 }

 size_t SkStrikeCache::setCacheSizeLimit(size_t newLimit) {
-    static const size_t minLimit = 256 * 1024;
-    if (newLimit < minLimit) {
-        newLimit = minLimit;
-    }
-
     SkAutoSpinlock ac(fLock);

     size_t prevLimit = fCacheSizeLimit;


Implement iterateStop for AnimatedTuple (#58)

--- src/core/animatedtuple.hpp
+++ src/core/animatedtuple.hpp
@@ -20,4 +20,17 @@
     iterateTick<I + 1, Tp...>(properties, deltaTime);
 }

+template<std::size_t I = 0, typename... Tp>
+inline typename std::enable_if<I == sizeof...(Tp), void>::type
+iterateStop(AnimatedTuple<Tp...>&)
+{}
+
+template<std::size_t I = 0, typename... Tp>
+inline typename std::enable_if<I < sizeof...(Tp), void>::type
+iterateStop(AnimatedTuple<Tp...>& properties)
+{
+    std::get<I>(properties).stop();
+    iterateStop<I + 1, Tp...>(properties);
+}
+
 #endif  // ANIMATEDTUPLE_HPP_


Correct 4th background position registers.

--- src/core/gba/registers.hpp
+++ src/core/gba/registers.hpp
@@ -23,12 +23,12 @@
 #define REG_BG0HOFS *((volatile unsigned int*) 0x04000010)
 #define REG_BG1HOFS *((volatile unsigned int*) 0x04000014)
 #define REG_BG2HOFS *((volatile unsigned int*) 0x04000018)
-#define REG_BG3HOFS *((volatile unsigned int*) 0x0400001a)
+#define REG_BG3HOFS *((volatile unsigned int*) 0x0400001c)

 // vertical scrolling registers
 #define REG_BG0VOFS *((volatile unsigned int*) 0x04000012)
 #define REG_BG1VOFS *((volatile unsigned int*) 0x04000016)
 #define REG_BG2VOFS *((volatile unsigned int*) 0x0400001a)
-#define REG_BG3VOFS *((volatile unsigned int*) 0x0400001c)
+#define REG_BG3VOFS *((volatile unsigned int*) 0x0400001e)

 #endif


Better thresholds.

Better thresholds.

--- src/osuar_ground_station/osuar_vision/src/squares.cpp
+++ src/osuar_ground_station/osuar_vision/src/squares.cpp
@@ -19,24 +19,24 @@
 int thresh = 50, N = 11;

 // Threshold for maximum cosine between angles (x100).
-int maxCosineThresh = 25;
+int maxCosineThresh = 20;

 // Threshold for ratio of shortest side / longest side (x100).
-int sideRatioThresh = 85;
+int sideRatioThresh = 75;

 // Maximum square area.
 int maxSquareArea = 41000;

 // Find colors of any hue...
-int wallHueLow  = 0;
-int wallHueHigh = 179;
+int wallHueLow  = 50;
+int wallHueHigh = 132;

 // ...of low saturation...
 int wallSatLow  = 0;
-int wallSatHigh = 40;
+int wallSatHigh = 100;

 // ...ranging down to gray, but not completely dark. That is to say, white.
-int wallValLow  = 50;
+int wallValLow  = 90;
 int wallValHigh = 255;

 ros::Publisher visPub;


FIX: StringifyInt() mixup

FIX: StringifyInt() mixup

--- cvmfs/swissknife_history.cc
+++ cvmfs/swissknife_history.cc
@@ -482,9 +482,9 @@
    LogCvmfs(kLogCvmfs, kLogStdout, "%s %s %d %d %d %s %s",
              tag.name.c_str(),
              tag.root_hash.ToString().c_str(),
-             StringifyInt(tag.size).c_str(),
-             StringifyInt(tag.revision).c_str(),
-             StringifyInt(tag.timestamp).c_str(),
+             tag.size,
+             tag.revision,
+             tag.timestamp,
              tag.GetChannelName(),
              tag.description.c_str());
 }
@@ -944,14 +944,14 @@
 void CommandInfoTag::PrintHumanReadableInfo(
                                        const history::History::Tag &tag) const {
   LogCvmfs(kLogCvmfs, kLogStdout, "Name:         %s\n"
-                                  "Revision:     %s\n"
+                                  "Revision:     %d\n"
                                   "Channel:      %s\n"
                                   "Timestamp:    %s\n"
                                   "Root Hash:    %s\n"
                                   "Catalog Size: %s\n"
                                   "%s",
            tag.name.c_str(),
-           StringifyInt(tag.revision).c_str(),
+           tag.revision,
            tag.GetChannelName(),
            StringifyTime(tag.timestamp, true /* utc */).c_str(),
            tag.root_hash.ToString().c_str(),


BPRED: Fixed the treshold-bug in the tournament predictor.

Suppose the saturating counters of a branch predictor contain n bits.  When the
counter is between 0 and (2^(n-1) - 1), boundaries included, the branch is
predicted as not taken.  When the counter is between 2^(n-1) and (2^n - 1),
boundaries included, the branch is predicted as taken.

--- src/cpu/pred/tournament.cc
+++ src/cpu/pred/tournament.cc
@@ -104,7 +104,6 @@

     // @todo: Allow for different thresholds between the predictors.
     threshold = (1 << (localCtrBits - 1)) - 1;
-    threshold = threshold / 2;
 }

 inline


Fix message tag.

Fix message tag.

--- src/ee/facebook_ads/private/FacebookRewardedAd.cpp
+++ src/ee/facebook_ads/private/FacebookRewardedAd.cpp
@@ -30,7 +30,7 @@
     , displayer_(displayer)
     , plugin_(plugin)
     , adId_(adId)
-    , messageHelper_("FacebookAdsRewardedAd", adId) {
+    , messageHelper_("FacebookRewardedAd", adId) {
     logger_.debug("%s", __PRETTY_FUNCTION__);
     loader_ = std::make_unique<ads::AsyncHelper<bool>>();


Removed some unused code.

Removed some unused code.

git-svn-id: 3886bd62ed28164cbbc55da84e6fd7f94c7f10b5@188 b2dc461f-b7ed-4520-8422-8e9c2511a46d


8026848: -XX:+G1SummarizeRSetStats can result in wrong exit code and crash Summary: Changed the use of %d to SIZE_FORMAT macro in format string when printing size_t values. Reviewed-by: stefank, ehelin

--- src/share/vm/gc_implementation/g1/g1RemSetSummary.cpp
+++ src/share/vm/gc_implementation/g1/g1RemSetSummary.cpp
@@ -187,19 +187,23 @@
   size_t code_root_elems() const { return _code_root_elems; }

   void print_rs_mem_info_on(outputStream * out, size_t total) {
-    out->print_cr("    %8dK (%5.1f%%) by %zd %s regions", round_to_K(rs_mem_size()), rs_mem_size_percent_of(total), amount(), _name);
+    out->print_cr("    "SIZE_FORMAT_W(8)"K (%5.1f%%) by "SIZE_FORMAT" %s regions",
+        round_to_K(rs_mem_size()), rs_mem_size_percent_of(total), amount(), _name);
   }

   void print_cards_occupied_info_on(outputStream * out, size_t total) {
-    out->print_cr("     %8d (%5.1f%%) entries by %zd %s regions", cards_occupied(), cards_occupied_percent_of(total), amount(), _name);
+    out->print_cr("     "SIZE_FORMAT_W(8)" (%5.1f%%) entries by "SIZE_FORMAT" %s regions",
+        cards_occupied(), cards_occupied_percent_of(total), amount(), _name);
   }

   void print_code_root_mem_info_on(outputStream * out, size_t total) {
-    out->print_cr("    %8dK (%5.1f%%) by %zd %s regions", round_to_K(code_root_mem_size()), code_root_mem_size_percent_of(total), amount(), _name);
+    out->print_cr("    "SIZE_FORMAT_W(8)"K (%5.1f%%) by "SIZE_FORMAT" %s regions",
+        round_to_K(code_root_mem_size()), code_root_mem_size_percent_of(total), amount(), _name);
   }

   void print_code_root_elems_info_on(outputStream * out, size_t total) {
-    out->print_cr("     %8d (%5.1f%%) elements by %zd %s regions", code_root_elems(), code_root_elems_percent_of(total), amount(), _name);
+    out->print_cr("     "SIZE_FORMAT_W(8)" (%5.1f%%) elements by "SIZE_FORMAT" %s regions",
+        code_root_elems(), code_root_elems_percent_of(total), amount(), _name);
   }
 };

@@ -327,14 +331,14 @@
   out->print_cr("\n Recent concurrent refinement statistics");
   out->print_cr("  Processed "SIZE_FORMAT" cards",
                 num_concurrent_refined_cards());
-  out->print_cr("  Of %d completed buffers:", num_processed_buf_total());
-  out->print_cr("     %8d (%5.1f%%) by concurrent RS threads.",
+  out->print_cr("  Of "SIZE_FORMAT" completed buffers:", num_processed_buf_total());
+  out->print_cr("     "SIZE_FORMAT_W(8)" (%5.1f%%) by concurrent RS threads.",
                 num_processed_buf_total(),
                 percent_of(num_processed_buf_rs_threads(), num_processed_buf_total()));
-  out->print_cr("     %8d (%5.1f%%) by mutator threads.",
+  out->print_cr("     "SIZE_FORMAT_W(8)" (%5.1f%%) by mutator threads.",
                 num_processed_buf_mutator(),
                 percent_of(num_processed_buf_mutator(), num_processed_buf_total()));
-  out->print_cr("  Did %d coarsenings.", num_coarsenings());
+  out->print_cr("  Did "SIZE_FORMAT" coarsenings.", num_coarsenings());
   out->print_cr("  Concurrent RS threads times (s)");
   out->print("     ");
   for (uint i = 0; i < _num_vtimes; i++) {


Put annotations also into PCH.

Put annotations also into PCH.

--- core/utils/src/rootcling.cxx
+++ core/utils/src/rootcling.cxx
@@ -3667,6 +3667,21 @@
                                           *dictSrcOut,
                                           isGenreflex);
       }
+   } else {
+      // We need annotations even in the PCH
+      iter = scan.fSelectedClasses.begin();
+      end = scan.fSelectedClasses.end();
+      for( ; iter != end; ++iter)
+      {
+         if (iter->RequestOnlyTClass()) {
+            continue;
+         }
+         // Very important: here we decide if we want to attach attributes to the decl.
+         if (clang::CXXRecordDecl* CXXRD =
+              llvm::dyn_cast<clang::CXXRecordDecl>(const_cast<clang::RecordDecl*>(iter->GetRecordDecl()))){
+            AnnotateDecl(*CXXRD,selectionRules,interp);
+         }
+      }
    }

    // coverity[fun_call_w_exception] - that's just fine.


Even if we do not support them, for backward compatibility we should parse the flag that request cint, reflex and gccxml

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

--- core/utils/src/rootcling.cxx
+++ core/utils/src/rootcling.cxx
@@ -495,12 +495,6 @@

 bool gNeedCollectionProxy = false;

-enum EDictType {
-   kDictTypeCint,
-   kDictTypeReflex,
-   kDictTypeGCCXML
-} dict_type = kDictTypeCint;
-
 char *StrDup(const char *str);

 class RConstructorType {
@@ -4686,6 +4680,18 @@
       gErrorIgnoreLevel = kInfo; // Display all information (same as -v)
       ic++;
    }
+   if (ic < argc) {
+      if (!strcmp(argv[ic], "-cint")) {
+         // Flag is ignored, should warn of deprecation.
+         ic++;
+      } else if (!strcmp(argv[ic], "-reflex")) {
+         // Flag is ignored, should warn of deprecation.
+         ic++;
+      } else if (!strcmp(argv[ic], "-gccxml")) {
+         // Flag is ignored, should warn of deprecation.
+         ic++;
+      }
+   }

    const char* libprefix = "--lib-list-prefix=";

@@ -5655,16 +5661,7 @@

             // 'linesToSkip' is because we want to put it after #defined private/protected
             if (++nl == linesToSkip && icc) {
-               switch (dict_type) {
-               case kDictTypeGCCXML:
-                  fprintf(fpd, "#define G__DICTIONARY gccxml\n");
-                  break;
-               case kDictTypeReflex:
-                  fprintf(fpd, "#define G__DICTIONARY reflex\n");
-                  break;
-               default:;
-               }
-
+
                if (gNeedCollectionProxy) {
                   fprintf(fpd, "\n#include \"TCollectionProxyInfo.h\"");
                }


change return type of potential::name

change return type of potential::name

--- mjolnir/potential/external/ImplicitMembranePotential.hpp
+++ mjolnir/potential/external/ImplicitMembranePotential.hpp
@@ -5,11 +5,14 @@

 namespace mjolnir
 {
-
-
 /* Implicit membrane potential                                                *
- *  V(z) = ma * tanh(be * (|z| - th/2))                                       *
- * dV/dr = (z/|z|) * ma * (cosh^2(be * (|z| - th/2)))                         *
+ *  V(z) = k * tanh(bend * (|z| - thick/2))                                   *
+ * dV/dr = (z/|z|) * k * (cosh^2(bend * (|z| - thick/2)))                     *
+ *                 y                                                          *
+ *  _________      ^      _______                                             *
+ *  _________\_____|_____/______x                                             *
+ *  -thick/2  \____|____/ thick/2                                             *
+ *               -k|                                                          *
  * Cutoff ratio ensure 1/1000 accuracy.                                       */
 template<typename traitsT>
 class ImplicitMembranePotential
@@ -70,7 +73,7 @@
         return retval;
     }

-    std::string name() const {return "ImplicitMembrane";}
+    const char* name() const noexcept {return "ImplicitMembrane";}

     real_type  half_thick() const noexcept {return half_thick_;}
     real_type& half_thick()       noexcept {return half_thick_;}


add clone() method to Structure, Model, Chain, Residue, Atom

for #31

--- python/mol.cpp
+++ python/mol.cpp
@@ -309,6 +309,7 @@
          (void (*)(Structure&)) &remove_ligands_and_waters)
     .def("remove_empty_chains", (void (*)(Structure&)) &remove_empty_chains)
     .def("shorten_chain_names", &shorten_chain_names)
+    .def("clone", [](const Structure& self) { return new Structure(self); })
     .def("__repr__", [](const Structure& self) {
         return tostr("<gemmi.Structure ", self.name, " with ",
                      self.models.size(), " model(s)>");
@@ -388,6 +389,7 @@
     .def("calculate_center_of_mass", [](const Model& self) {
         return calculate_center_of_mass(self).get();
     })
+    .def("clone", [](const Model& self) { return new Model(self); })
     .def("__repr__", [](const Model& self) {
         return tostr("<gemmi.Model ", self.name, " with ",
                      self.chains.size(), " chain(s)>");
@@ -464,6 +466,7 @@
     .def("first_conformer",
          (UniqProxy<Residue> (Chain::*)()) &Chain::first_conformer,
          py::keep_alive<0, 1>())
+    .def("clone", [](const Chain& self) { return new Chain(self); })
     .def("__repr__", [](const Chain& self) {
         return tostr("<gemmi.Chain ", self.name,
                      " with ", self.residues.size(), " res>");
@@ -601,6 +604,7 @@
     .def("sole_atom", &Residue::sole_atom)
     .def("is_water", &Residue::is_water)
     .def("trim_to_alanine", (bool (*)(Residue&)) &trim_to_alanine)
+    .def("clone", [](const Residue& self) { return new Residue(self); })
     .def("__repr__", [](const Residue& self) {
         return tostr("<gemmi.Residue ", self.str(), " with ",
                      self.atoms.size(), " atoms>");
@@ -621,6 +625,7 @@
     .def("is_hydrogen", &Atom::is_hydrogen)
     .def("has_altloc", &Atom::has_altloc)
     .def("b_eq", &Atom::b_eq)
+    .def("clone", [](const Atom& self) { return new Atom(self); })
     .def("__repr__", [](const Atom& self) {
         std::string r = "<gemmi.Atom " + self.name;
         if (self.altloc) {


Correctly handle the directory part of the library in the multiDict support

--- core/utils/src/rootcling.cxx
+++ core/utils/src/rootcling.cxx
@@ -3983,12 +3983,12 @@
    if (multiDict){

       std::string newName=llvm::sys::path::parent_path(sharedLibraryPathName).str();
-      //newName+=gPathSeparator;
+      newName+=gPathSeparator;
       newName+=llvm::sys::path::stem(sharedLibraryPathName);
       newName+="_";
       newName+=llvm::sys::path::stem(dictpathname);
       newName+=llvm::sys::path::extension(sharedLibraryPathName);
-      std::cout << "New name is " << newName << std::endl;
+      //std::cout << "New name is " << newName << std::endl;
       sharedLibraryPathName=newName;
    }


Refactoring

Refactoring

--- src/deleglise-rivat/pi_deleglise_rivat_parallel1.cpp
+++ src/deleglise-rivat/pi_deleglise_rivat_parallel1.cpp
@@ -283,17 +283,16 @@
            vector<int32_t>& mu,
            int threads)
 {
-  int64_t S2_total = 0;
   int64_t limit = z + 1;
   threads = validate_threads(threads, limit);
-
   vector<int32_t> pi = generate_pi(y);

-  S2_total += S2_trivial(x, y, z, c, pi, primes, threads);
-  S2_total += S2_easy(x, y, z, c, pi, primes, threads);
-  S2_total += S2_sieve(x, y, z, c, pi, primes, lpf, mu, threads);
-
-  return S2_total;
+  int64_t s2_trivial = S2_trivial(x, y, z, c, pi, primes, threads);
+  int64_t s2_easy = S2_easy(x, y, z, c, pi, primes, threads);
+  int64_t s2_sieve = S2_sieve(x, y, z, c, pi, primes, lpf, mu, threads);
+  int64_t s2 = s2_trivial + s2_easy + s2_sieve;
+
+  return s2;
 }

 /// alpha is a tuning factor which should grow like (log(x))^3


testing membase

testing membase

--- aladdin.cpp
+++ aladdin.cpp
@@ -27,6 +27,7 @@
   profile_init_stats(bench, trace_file);
   profile_base_address(bench, base_addr_file);

+  return 0;
   Datapath *acc;
   Scratchpad *spad;


with break

with break

--- qrgui/main.cpp
+++ qrgui/main.cpp
@@ -43,6 +43,7 @@
 			for (int i = 0; i < argc; i++) {
 				if (app.arguments().at(i).endsWith(".qrs")) {
 					fileToOpen = app.arguments().at(i);
+					break;
 				}
 			}
 		}


Add #pragma extraction through a Preprocessor lexer and an unnamed PragmaHandler which for now just demonstrates that it is being invoked. Throw in the platform #defines as CINT defines them (G__Whatever). Adapt to hack in cling that for now we cannot pass -fsyntax-only (because it is a no-op); pass -emit-html instead which cling understands as -fsyntax-only, really. Use a vector<string> even though cling expects a char** - it is much safer when collecting strings over hundrets of lines of code.

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

--- core/utils/src/rootcling.cxx
+++ core/utils/src/rootcling.cxx
@@ -170,8 +170,12 @@
 #include "cintdictversion.h"
 #include "FastAllocString.h"
 #include "cling/Interpreter/Interpreter.h"
+#include "cling/Interpreter/CIFactory.h"
 #include <Scanner.h>
 #include "clang/Frontend/CompilerInstance.h"
+#include "clang/Lex/Preprocessor.h"
+#include "clang/Lex/Pragma.h"
+#include "clang/Basic/Diagnostic.h"

 #ifdef __APPLE__
@@ -524,6 +528,15 @@
 }

+class PragmaLinkCollector: public clang::PragmaHandler {
+public:
+   // Unnamed pragma handler: we want all of them.
+   void HandlePragma (clang::Preprocessor &PP,
+                      clang::PragmaIntroducerKind Introducer,
+                      clang::Token &FirstToken) {
+      printf("Yeah, we have a #pragma!\n");
+   };
+};

 bool IsStdClass(const clang::CXXRecordDecl *cl)
 {
@@ -5517,7 +5530,9 @@
    std::vector<std::string> path;
    char *argvv[500];

-   std::vector<const char*> clingArgs;
+   std::vector<std::string> clingArgs;
+   clingArgs.push_back("-x");
+   clingArgs.push_back("c++");
    clingArgs.push_back("-I.");
    clingArgs.push_back("-DROOT_Math_VectorUtil_Cint"); // ignore that little problem maker

@@ -5705,12 +5720,16 @@

    std::vector<std::string> pcmArgs;
    for (size_t parg = 0, n = clingArgs.size(); parg < n; ++parg) {
-      if (strcmp(clingArgs[i], "-c"))
+      if (clingArgs[i] == "-c")
          pcmArgs.push_back(clingArgs[parg]);
    }

    // cling-only arguments
-   clingArgs.push_back("-fsyntax-only");
+   // -fsyntax-only is what we want to pass - but it's the default and cling
+   // cannot detect the difference between -fsyntax-only being passed or not.
+   // Will get fixed, hopefully, once we use the clang::Driver interface.
+   //clingArgs.push_back("-fsyntax-only");
+   clingArgs.push_back("-emit-html");
    std::string interpInclude("-I");
 #ifndef ROOTBUILD
 # ifndef ROOTINCDIR
@@ -5724,10 +5743,88 @@
 #endif
    clingArgs.push_back(interpInclude.c_str());

-   cling::Interpreter interp(clingArgs.size(), &clingArgs[0],
+   std::vector<const char*> clingArgsC;
+   for (size_t i = 0, n = clingArgs.size(); i < n; ++i) {
+      clingArgsC.push_back(clingArgs[i].c_str());
+   }
+   cling::Interpreter interp(clingArgsC.size(), &clingArgsC[0],
                              getenv("LLVMDIR"));
    gInterp = &interp;
-
+
+   // flags used only for the pragma parser:
+   clingArgs.push_back("-D__CINT__");
+   char platformDefines[64] = {0};
+#ifdef __KCC
+   snprintf(platformDefines, 64, "-DG__KCC=%ld", (long)__KCC);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __INTEL_COMPILER
+   snprintf(platformDefines, 64, "-DG__INTEL_COMPILER=%ld", (long)__INTEL_COMPILER);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __xlC__
+   snprintf(platformDefines, 64, "-DG__xlC=%ld", (long)__xlC__);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __GNUC__
+   snprintf(platformDefines, 64, "-DG__GNUC=%ld", (long)__GNUC__);
+   snprintf(platformDefines, 64, "-DG__GNUC_VER=%ld", (long)__GNUC__*1000 + __GNUC_MINOR__);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __GNUC_MINOR__
+   snprintf(platformDefines, 64, "-DG__GNUC_MINOR=%ld", (long)__GNUC_MINOR__);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __HP_aCC
+   snprintf(platformDefines, 64, "-DG__HP_aCC=%ld", (long)__HP_aCC);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __sun
+   snprintf(platformDefines, 64, "-DG__sun=%ld", (long)__sun);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __SUNPRO_CC
+   snprintf(platformDefines, 64, "-DG__SUNPRO_CC=%ld", (long)__SUNPRO_CC);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef _STLPORT_VERSION
+   // stlport version, used on e.g. SUN
+   snprintf(platformDefines, 64, "-DG__STLPORT_VERSION=%ld", (long)_STLPORT_VERSION);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __ia64__
+   snprintf(platformDefines, 64, "-DG__ia64=%ld", (long)__ia64__);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __x86_64__
+   snprintf(platformDefines, 64, "-DG__x86_64=%ld", (long)__x86_64__);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __i386__
+   snprintf(platformDefines, 64, "-DG__i386=%ld", (long)__i386__);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef __arm__
+   snprintf(platformDefines, 64, "-DG__arm=%ld", (long)__arm__);
+   clingArgs.push_back(platformDefines);
+#endif
+#ifdef _WIN32
+   snprintf(platformDefines, 64, "-DG__WIN32=%ld",(long)_WIN32);
+   clingArgs.push_back(platformDefines);
+#else
+# ifdef WIN32
+   snprintf(platformDefines, 64, "-DG__WIN32=%ld",(long)WIN32);
+   clingArgs.push_back(platformDefines);
+# endif
+#endif
+#ifdef _MSC_VER
+   snprintf(platformDefines, 64, "-DG__MSC_VER=%ld",(long)_MSC_VER);
+   clingArgs.push_back(platformDefines);
+   snprintf(platformDefines, 64, "-DG__VISUAL=%ld",(long)_MSC_VER);
+   clingArgs.push_back(platformDefines);
+#endif
+
+   std::string interpPragmaSource;
    std::list<std::string> includedFilesForBundle;
    string esc_arg;
    bool insertedBundle = false;
@@ -5789,6 +5886,7 @@
             }
          }
          interp.processLine(std::string("#include \"") + argv[i] + "\"", true /*raw*/);
+         interpPragmaSource += std::string("#include \"") + argv[i] + "\"\n";
          pcmArgs.push_back(argv[i]);
       } else {
          if (strcmp("-pipe", argv[ic])!=0) {
@@ -5805,6 +5903,7 @@
             if (*argv[i] != '-' && *argv[i] != '+') {
                // Looks like a file
                interp.processLine(std::string("#include \"") + argv[i] + "\"", true /*raw*/);
+               interpPragmaSource += std::string("#include \"") + argv[i] + "\"\n";
                pcmArgs.push_back(argv[i]);
             }
          }
@@ -6038,7 +6137,33 @@
          return 1;
       }
    }
-
+
+   {
+      // Extract all #pragmas
+      llvm::MemoryBuffer* pragmaSourceBuf
+         = llvm::MemoryBuffer::getMemBuffer(interpPragmaSource, "CINT #pragma extraction");
+
+      std::vector<const char*> pragmaArgsC;
+      for (size_t i = 0, n = clingArgs.size(); i < n; ++i) {
+         pragmaArgsC.push_back(clingArgs[i].c_str());
+      }
+      clang::CompilerInstance* pragmaCI
+         = cling::CIFactory::createCI(pragmaSourceBuf, clingArgsC.size(), &clingArgsC[0],
+                                      getenv("LLVMDIR"));
+      clang::Preprocessor& PP = pragmaCI->getPreprocessor();
+      clang::DiagnosticConsumer& DClient = pragmaCI->getDiagnosticClient();
+      DClient.BeginSourceFile(pragmaCI->getLangOpts(), &PP);
+      PragmaLinkCollector pragmaLinkCollector;
+      PP.AddPragmaHandler(&pragmaLinkCollector);
+      clang::Token Tok;
+      // Start parsing the specified input file.
+      PP.EnterMainSourceFile();
+      do {
+         PP.Lex(Tok);
+      } while (Tok.isNot(clang::tok::eof));
+   }
+
+
    RScanner scan;
    clang::CompilerInstance* CI = interp.getCI();
    scan.Scan(&CI->getASTContext(),CI->getASTContext().getTranslationUnitDecl(),linkdefFilename);


timing improvement, part of the fix for #105, Use isAlembicMeshTopo instead of manual check

--- alembic.cpp
+++ alembic.cpp
@@ -56,6 +56,7 @@
 #include "AlembicPoints.h"
 #include "AlembicCurves.h"
 #include "CommonProfiler.h"
+#include "CommonMeshUtilities.h"

 #ifdef __DEBUG__

@@ -876,7 +877,9 @@
       default:
          break;
    }
-
+   }
+
+    { ESS_PROFILE_SCOPE("alembic_create_item_Invoke create_the_operator");
    // now create an operator...?
    switch(itemType)
    {
@@ -2039,12 +2042,8 @@
          else
          {
             // only add the point position operator if we don't have dynamic topology
-            bool receivesExpression = false;
-            Alembic::Abc::ICompoundProperty abcCompound = getCompoundFromObject(objects[i]);
-            Alembic::Abc::IInt32ArrayProperty faceCountProp = Alembic::Abc::IInt32ArrayProperty(abcCompound,".faceCounts");
-            if(faceCountProp.valid())
-               receivesExpression = !faceCountProp.isConstant();
-
+            bool receivesExpression = isAlembicMeshTopoDynamic( & ( objects[i] ) );
+
             if(!receivesExpression)
             {
                Alembic::AbcGeom::IPolyMesh abcMesh = Alembic::AbcGeom::IPolyMesh(objects[i],Alembic::Abc::kWrapExisting);


routing: set missing parking ID in routing response when parking point is given.


quaternion: SetLookAt()の引数が不正な場合はIdentity()を返すのではなく例外を送出するなど

--- quaternion.hpp
+++ quaternion.hpp
@@ -4,6 +4,13 @@
 #include "compare.hpp"

 namespace frea {
+	struct InvalidAxis : std::invalid_argument {
+		using std::invalid_argument::invalid_argument;
+	};
+	struct NoValidAxis : std::runtime_error {
+		using std::runtime_error::runtime_error;
+	};
+
 	template <class T, bool A>
 	struct ExpQuatT;
 	template <class T, bool A>
@@ -141,7 +148,7 @@
 				t_up = dir.verticalVector();
 				rv = t_up % dir;
 			} else {
-				rv *= RSqrt(len_s);
+				rv /= std::sqrt(len_s);
 				t_up = dir % rv;
 			}
 			return FromAxis(rv, t_up, dir);
@@ -155,11 +162,13 @@
 			return Rotation(rAxis, rad_t(d));
 		}
 		static QuatT SetLookAt(const Axis::e targetAxis, const Axis::e baseAxis, const vec_t& baseVec, const vec_t& at, const vec_t& pos) {
+			if(targetAxis == baseAxis)
+				throw InvalidAxis("");
 			// [0] = target
 			// [1] = right
 			// [2] = base
 			int axF[3] = {targetAxis, 0, baseAxis};
-			// target, base以外の軸を設定
+			// axF[1]へtarget, base以外の軸フラグを設定
 			switch((1<<targetAxis) | (1<<baseAxis)) {
 				// 110
 				case 0x06:
@@ -176,18 +185,19 @@
 				default:
 					D_Expect(false, "invalid axis flag")
 			}
-
 			vec_t axis[3];
 			auto &vTarget = axis[axF[0]],
 				&vOther = axis[axF[1]],
 				&vBase = axis[axF[2]];
 			vTarget = at - pos;
 			if(vTarget.normalize() < 1e-6)
-				return Identity();
+				throw NoValidAxis("");
 			vOther = baseVec.cross(vTarget);
 			if(vOther.normalize() < 1e-6)
-				return Identity();
+				throw NoValidAxis("");
 			vBase = vTarget.cross(vOther);
+			const value_t b = (int(targetAxis) == (int(baseAxis)+1)%3) ? 1 : -1;
+			vOther *= b;
 			return FromAxis(axis[0], axis[1], axis[2]);
 		}
 		void rotateX(const rad_t ang) {
@@ -214,10 +224,8 @@
 		void invert() {
 			*this = inversion();
 		}
-		void scale(const value_t& s) {
-			QuatT q = Identity();
-			q.slerp(*this, s);
-			*this = q;
+		QuatT scale(const value_t& s) const {
+			return Identity().slerp(*this, s);
 		}

 		#define DEF_SCALAR(op) \


Added DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM and DXGI_FORMAT_B4G4R4A4_UNORM to mapping table.

--- src/libGLESv2/renderer/d3d/d3d11/formatutils11.cpp
+++ src/libGLESv2/renderer/d3d/d3d11/formatutils11.cpp
@@ -97,6 +97,10 @@
     AddDXGIToESEntry(&map, DXGI_FORMAT_BC1_UNORM,                GL_COMPRESSED_RGBA_S3TC_DXT1_EXT);
     AddDXGIToESEntry(&map, DXGI_FORMAT_BC2_UNORM,                GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE);
     AddDXGIToESEntry(&map, DXGI_FORMAT_BC3_UNORM,                GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE);
+
+    AddDXGIToESEntry(&map, DXGI_FORMAT_B5G6R5_UNORM,             GL_RGB565);
+    AddDXGIToESEntry(&map, DXGI_FORMAT_B5G5R5A1_UNORM,           GL_RGB5_A1);
+    AddDXGIToESEntry(&map, DXGI_FORMAT_B4G4R4A4_UNORM,           GL_RGBA4);

     return map;
 }


unittests: add queueservice to run unittests in parallel

--- bootstrap/src/nanyc-unittest.cpp
+++ bootstrap/src/nanyc-unittest.cpp
@@ -8,6 +8,8 @@
 #include <yuni/core/system/console/console.h>
 #include <yuni/core/process/program.h>
 #include <yuni/core/system/cpu.h>
+#include <yuni/job/queue/service.h>
+#include <yuni/thread/utility.h>
 #include <iostream>
 #include <vector>
 #include <algorithm>
@@ -63,6 +65,7 @@
 	std::vector<yuni::String> filenames;
 	std::vector<Result> results;
 	uint32_t jobs = 0;
+	yuni::Mutex mutex;

 	Entry execinfo;
 	AnyString argv0;
@@ -157,6 +160,7 @@

 void App::startEntry(const Entry& entry) {
 	if (interactive) {
+		yuni::MutexLocker locker(mutex);
 		uint32_t progress = static_cast<uint32_t>((100. / stats.total) * static_cast<uint32_t>(results.size()));
 		if (progress > 99)
 			progress = 99;
@@ -182,6 +186,7 @@
 	result.entry = entry;
 	result.success = success;
 	result.duration_ms = duration;
+	yuni::MutexLocker locker(mutex);
 	results.emplace_back(std::move(result));
 }

@@ -282,13 +287,18 @@
 		stats.total = static_cast<uint32_t>(loops * unittests.size());
 		results.reserve(stats.total);
 		std::cout << '\n';
-		auto start = now();
+		yuni::Job::QueueService queueservice;
+		queueservice.maximumThreadCount(jobs);
+		queueservice.minimumThreadCount(jobs);
 		for (uint32_t l = 0; l != loops; ++l) {
 			if (unlikely(shuffle))
 				shuffleDeck(unittests);
 			for (auto& entry: unittests)
-				run(entry);
+				yuni::async(queueservice, [=] { run(entry); });
 		}
+		auto start = now();
+		queueservice.start();
+		queueservice.wait(yuni::qseIdle);
 		auto duration = now() - start;
 		success = statstics(duration);
 	}


demux: adaptative: set split time to child, not parent

--- modules/demux/adaptative/playlist/SegmentInformation.cpp
+++ modules/demux/adaptative/playlist/SegmentInformation.cpp
@@ -281,8 +281,8 @@
             SubSegment *subsegment = new SubSegment(segment,
                                                     start + segment->getOffset(),
                                                     (end != 0) ? end + segment->getOffset() : 0);
+            subsegment->startTime.Set(time);
             segment->addSubSegment(subsegment);
-            segment->startTime.Set(time);
             break;
         }
     }


INTEGRATION: CWS uno2 (1.7.2); FILE MERGED 2003/04/08 09:48:09 dbo 1.7.2.1: #107991# UNO shared library component renaming

--- bridges/test/testsameprocess.cxx
+++ bridges/test/testsameprocess.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: testsameprocess.cxx,v $
  *
- *  $Revision: 1.8 $
- *
- *  last change: $Author: vg $ $Date: 2003-04-15 16:29:58 $
+ *  $Revision: 1.9 $
+ *
+ *  last change: $Author: rt $ $Date: 2003-04-23 16:45:38 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -171,24 +171,24 @@

         Reference < XConnector > rConnector(
             createComponent( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Connector")),
-                             OUString( RTL_CONSTASCII_USTRINGPARAM("connectr")),
+                             OUString( RTL_CONSTASCII_USTRINGPARAM("connector.uno" SAL_DLLEXTENSION)),
                              rSMgr ),
             UNO_QUERY );

         Reference < XAcceptor > rAcceptor(
             createComponent( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Acceptor")),
-                             OUString( RTL_CONSTASCII_USTRINGPARAM("acceptor")),
+                             OUString( RTL_CONSTASCII_USTRINGPARAM("acceptor.uno" SAL_DLLEXTENSION)),
                              rSMgr ),
             UNO_QUERY );

         // just ensure that it is registered
-        createComponent( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.Bridge.iiop")),
-                         OUString( RTL_CONSTASCII_USTRINGPARAM("iiopbrdg")),
-                         rSMgr );
+//      createComponent( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.Bridge.iiop")),
+//                       OUString( RTL_CONSTASCII_USTRINGPARAM("iiopbrdg" SAL_DLLEXTENSION)),
+//                       rSMgr );

         Reference < XBridgeFactory > rFactory(
             createComponent( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.BridgeFactory")),
-                             OUString( RTL_CONSTASCII_USTRINGPARAM("brdgfctr")),
+                             OUString( RTL_CONSTASCII_USTRINGPARAM("bridgefac.uno" SAL_DLLEXTENSION)),
                              rSMgr ),
             UNO_QUERY );


Make EntryType a scoped enumeration.

Make EntryType a scoped enumeration.

See #133.

--- include/ArchiveModel.hh
+++ include/ArchiveModel.hh
@@ -11,7 +11,7 @@
 #include <QVariant>
 #include <QVector>

-enum EntryType {
+enum class EntryType {
     Local,
     Downloaded,
     Downloadable


Fixed compilation errors within Entity.hpp Forgot to remove when merging

--- include/anax/Entity.hpp
+++ include/anax/Entity.hpp
@@ -249,21 +249,12 @@

 #ifdef ANAX_USE_VARIADIC_TEMPLATES

-<<<<<<< HEAD
-    template <typename T, typename... Args>
-    T& Entity::addComponent(Args&&... args)
-    {
-        return addComponent<T>(new T{args...});
-    }
-
-=======
 	template <typename T, typename... Args>
 	T& Entity::addComponent(Args&&... args)
 	{
 		return addComponent<T>(new T{std::forward<Args>(args)...});
 	}

->>>>>>> 6f961930803599b5942ee5f4bf9b6c8a5f61ea34
 #endif // ANAX_USE_VARIADIC_TEMPLATES

     template <typename T>


corrected the added derivatives

corrected the added derivatives

--- solvers/CompressibleFlowSolver/EquationSystems/CompressibleFlowSystem.cpp
+++ solvers/CompressibleFlowSolver/EquationSystems/CompressibleFlowSystem.cpp
@@ -1687,10 +1687,10 @@
                         &tmpar2[0], 1,
                         &tmpar2[0], 1);

-            // tmp = h_x*eps_bar*d(rhov)/dx
+            // tmp = h_x*eps_bar*d(rhou)/dy
             Vmath::Vmul(nPts,
                         &tmpar2[0], 1,
-                        &derivativesMix[0][1][0], 1,
+                        &derivativesMix[1][0][0], 1,
                         &tmpar2[0], 1);

             // tmp = h_y*eps_bar
@@ -1705,10 +1705,10 @@
                         &tmpar20[0], 1,
                         &tmpar20[0], 1);

-            // tmp = h_y*eps_bar*d(rhou)/dy
+            // tmp = h_y*eps_bar*d(rhov)/dx
             Vmath::Vmul(nPts,
                         &tmpar20[0], 1,
-                        &derivativesMix[1][0][0], 1,
+                        &derivativesMix[0][1][0], 1,
                         &tmpar20[0], 1);

             // Sxy = mu * (du/dy + dv/dx)


extended Kernel::setArg() function to work with dynamic local memory. #3

--- include/clpp/kernel.ipp
+++ include/clpp/kernel.ipp
@@ -24,7 +24,7 @@
 	namespace detail {
 		template<typename V>
 		struct SetArgImpl final {
-			static auto setArg(Kernel const& kernel, cl_uint index, V&& arg) {
+			static inline auto setArg(Kernel const& kernel, cl_uint index, V&& arg) {
 				return clSetKernelArg(
 					kernel.get(), index, sizeof(V), std::addressof(std::forward<V>(arg)));
 			}
@@ -32,7 +32,7 @@

 		template<typename V>
 		struct SetArgImpl<LocalMemory<V>> final {
-			static auto setArg(Kernel const& kernel, cl_uint index, LocalMemory<V> const& arg) {
+			static inline auto setArg(Kernel const& kernel, cl_uint index, LocalMemory<V> const& arg) {
 				return clSetKernelArg(kernel.get(), index, arg.getSizeInBytes(), nullptr);
 			}
 		};


add assert header

add assert header

--- include/cotl_stdlib.hpp
+++ include/cotl_stdlib.hpp
@@ -1,5 +1,8 @@
 #ifndef _COTL_STDLIB_HPP
 #define _COTL_STDLIB_HPP
+
+#define NDEBUG
+#include <cassert>

 #include <cstdlib>
 #include <cstddef>


New builder with indexes

New builder with indexes

--- include/dll/context.hpp
+++ include/dll/context.hpp
@@ -26,6 +26,19 @@
     using type = std::tuple<Context<DBN, Args>...>;
 };

+template<template<typename, std::size_t, typename...> class Context, typename DBN, typename T>
+struct dbn_context_builder_i_impl;
+
+template<template<typename, std::size_t, typename...> class Context, typename DBN, std::size_t... I>
+struct dbn_context_builder_i_impl <Context, DBN, std::index_sequence<I...>> {
+    using type = std::tuple<Context<DBN, I>...>;
+};
+
+template<template<typename, std::size_t, typename...> class Context, typename DBN>
+struct dbn_context_builder_i {
+    using type = typename dbn_context_builder_i_impl<Context, DBN, std::make_index_sequence<DBN::layers>>::type;
+};
+
 } //end of dll namespace

 #endif


tweaking sequence

tweaking sequence

--- include/ecuda/views.hpp
+++ include/ecuda/views.hpp
@@ -245,8 +245,8 @@
 	HOST DEVICE inline pointer data() const __NOEXCEPT__ { return ptr; }
 	HOST DEVICE inline size_type size() const __NOEXCEPT__ { return length; }

-	HOST DEVICE inline iterator begin() __NOEXCEPT__ { return iterator(ptr); }
-	HOST DEVICE inline iterator end() __NOEXCEPT__  {
+	HOST DEVICE inline iterator begin() __NOEXCEPT__ { return iterator(data()); }
+	HOST DEVICE inline iterator end() __NOEXCEPT__  { return iterator(data()+static_cast<int>(size()));
 		// NOTE: Important to pre-cast this __device_sequence's pointer to the
 		//       pointer type of the iterator BEFORE applying the addition of
 		//       the length value.  For example, if this is a padded_ptr
@@ -256,10 +256,10 @@
 		//       type will cause the pointer operator+() to set the location
 		//       at the start of the next row _after_ the padding.  This will
 		//       screw up iter.operator-(otheriter).
-		return iterator( static_cast<typename iterator::pointer>(ptr)+static_cast<int>(length) );
-	}
-	HOST DEVICE inline const_iterator begin() const __NOEXCEPT__ { return const_iterator(ptr); }
-	HOST DEVICE inline const_iterator end() const __NOEXCEPT__ {
+		//return iterator( static_cast<typename iterator::pointer>(ptr)+static_cast<int>(length) );
+	}
+	HOST DEVICE inline const_iterator begin() const __NOEXCEPT__ { return const_iterator(data()); }
+	HOST DEVICE inline const_iterator end() const __NOEXCEPT__ { return const_iterator(data()+static_cast<int>(size()));
 		// NOTE: Important to pre-cast this __device_sequence's pointer to the
 		//       pointer type of the iterator BEFORE applying the addition of
 		//       the length value.  For example, if this is a padded_ptr
@@ -269,7 +269,7 @@
 		//       type will cause the pointer operator+() to set the location
 		//       at the start of the next row _after_ the padding.  This will
 		//       screw up iter.operator-(otheriter).
-		return const_iterator( static_cast<typename const_iterator::pointer>(ptr)+static_cast<int>(length) );
+		//return const_iterator( static_cast<typename const_iterator::pointer>(ptr)+static_cast<int>(length) );
 	}

 	HOST DEVICE inline reverse_iterator rbegin() __NOEXCEPT__ { return reverse_iterator(end()); }
@@ -277,8 +277,8 @@
 	HOST DEVICE inline const_reverse_iterator rbegin() const __NOEXCEPT__ { return const_reverse_iterator(end()); }
 	HOST DEVICE inline const_reverse_iterator rend() const __NOEXCEPT__ { return const_reverse_iterator(begin()); }

-	DEVICE inline reference operator[]( const size_type index ) { return *(ptr+index); }
-	DEVICE inline const_reference operator[]( const size_type index ) const { return *(ptr+index); }
+	DEVICE inline reference operator[]( const size_type index ) { return *(data()+static_cast<int>(index)); }
+	DEVICE inline const_reference operator[]( const size_type index ) const { return *(data()+static_cast<int>(index)); }

 	template<class Iterator>
 	HOST DEVICE inline void assign( Iterator first, Iterator last ) { assign( first, last, category(), typename std::iterator_traits<Iterator>::iterator_category() ); }
@@ -315,8 +315,6 @@
 public:
 	typedef typename __device_grid_traits<T,PointerType,CategoryRow,CategoryColumn,ContainerType>::iterator iterator;
 	typedef typename __device_grid_traits<T,PointerType,CategoryRow,CategoryColumn,ContainerType>::const_iterator const_iterator;
-	//typedef typename __device_grid_iterator_traits<value_type,pointer,row_category,column_category>::iterator iterator;
-	//typedef typename __device_grid_iterator_traits<value_type,pointer,row_category,column_category>::const_iterator const_iterator;
 	typedef reverse_device_iterator<iterator> reverse_iterator;
 	typedef reverse_device_iterator<const_iterator> const_reverse_iterator;

@@ -480,6 +478,9 @@
 	HOST DEVICE inline row_type operator[]( const size_type index ) { return get_row(index); }
 	HOST DEVICE inline const_row_type operator[]( const size_type index ) const { return get_row(index); }

+	HOST DEVICE inline reference at( const size_type rowIndex, const size_type columnIndex ) { return *(data()+(number_columns()*rowIndex+columnIndex)); }
+	HOST DEVICE inline const_reference at( const size_type rowIndex, const size_type columnIndex ) const { return *(data()+(number_columns()*rowIndex+columnIndex)); }
+
 	template<class Iterator>
 	HOST DEVICE inline void assign( Iterator first, Iterator last ) { assign( first, last, column_category(), typename std::iterator_traits<Iterator>::iterator_category() ); }


remove dll late binding code from asf.  not only is it super ugly, it is not thread safe.  change to use GetProcAddress the same way everyone else in the world does.  (M-x un-bloom-ify)

--- bindings/java/src/jni/win32/service.cpp
+++ bindings/java/src/jni/win32/service.cpp
@@ -20,147 +20,35 @@
     id = env->GetFieldID(cls, field, "I"); \
     env->SetIntField(obj, id, val)

-/**
- * This code is stolen from misc/win32/misc.c and apr_private.h
- * This helper code resolves late bound entry points
- * missing from one or more releases of the Win32 API...
- * This is covered under the Apache Software License
- *
- * ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
- */
-
-typedef enum {
-    DLL_WINBASEAPI = 0,    // kernel32 From WinBase.h
-    DLL_WINADVAPI = 1,     // advapi32 From WinBase.h
-    DLL_WINSOCKAPI = 2,    // mswsock  From WinSock.h
-    DLL_WINSOCK2API = 3,   // ws2_32   From WinSock2.h
-    DLL_SHSTDAPI = 4,      // shell32  From ShellAPI.h
-    DLL_NTDLL = 5,         // shell32  From our real kernel
-    DLL_defined = 6        // must define as last idx_ + 1
-} dlltoken_e;
-
-FARPROC load_dll_func(dlltoken_e fnLib, TCHAR* fnName, int ordinal);
-
-#define DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
-typedef rettype (calltype *winapi_fpt_##fn) args; \
-static winapi_fpt_##fn winapi_pfn_##fn = NULL; \
-__inline rettype winapi_##fn args \
-{ if (!winapi_pfn_##fn) \
-winapi_pfn_##fn = (winapi_fpt_##fn) load_dll_func(lib, (wchar_t *)#fn, ord); \
-return (*(winapi_pfn_##fn)) names; }; \
-
-/* Win2K kernel only */
-DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI,
-                      ChangeServiceConfig2W, 0,
-                      (SC_HANDLE hService,
-                       DWORD dwInfoLevel,
-                       LPVOID lpInfo),
-                      (hService, dwInfoLevel, lpInfo));
-#undef ChangeServiceConfig2
-#define ChangeServiceConfig2 winapi_ChangeServiceConfig2W
-
-/* End Apache licensed code */
-
-static TCHAR* lateDllName[] = {
-    L"kernel32", L"advapi32", L"mswsock", L"ws2_32"  };
-static HMODULE lateDllHandle[] = {
-    NULL, NULL, NULL, NULL };
-
-FARPROC load_dll_func(dlltoken_e fnLib, TCHAR* fnName, int ordinal)
-{
-    if (!lateDllHandle[fnLib]) {
-        lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]);
-        if (!lateDllHandle[fnLib]) {
-            DWORD err = GetLastError();
-            fprintf(stderr, "GetLastError():   %d  %s\r\n",
-                    err, lateDllName[fnLib]);
-            return NULL;
-        }
-    }
-    if (ordinal)
-        return GetProcAddress(lateDllHandle[fnLib], (char *)ordinal);
-    else
-        return GetProcAddress(lateDllHandle[fnLib], (char *)fnName);
-}
-
-/*End ASF licensed code */
+typedef DWORD (CALLBACK *ChangeServiceConfig2_func_t)(SC_HANDLE,
+                                                      DWORD, LPVOID);

 JNIEXPORT jboolean SIGAR_JNI(win32_Service_ChangeServiceDescription)
 (JNIEnv *env, jclass, jlong handle, jstring description)
 {
-    jboolean            bResult = TRUE;
+    jboolean result = FALSE;
     SERVICE_DESCRIPTION servdesc;
-
-    OSVERSIONINFO osver; /* VER_PLATFORM_WIN32_NT */
-    osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-    GetVersionEx(&osver);
-
-    if ((osver.dwPlatformId == VER_PLATFORM_WIN32_NT)
-          && (osver.dwMajorVersion > 4)
-          && (ChangeServiceConfig2 != NULL)) {
-        servdesc.lpDescription = (LPTSTR)env->GetStringChars(description,
-                                                             NULL);
-        bResult = ChangeServiceConfig2((SC_HANDLE)handle,
-                                       SERVICE_CONFIG_DESCRIPTION, &servdesc);
-        env->ReleaseStringChars(description,
-                                (const jchar *)servdesc.lpDescription);
-    }
-    return bResult;
+    HINSTANCE lib;
+    ChangeServiceConfig2_func_t change_config;
+
+    if ((lib = LoadLibrary(L"advapi32"))) {
+        change_config = (ChangeServiceConfig2_func_t)
+            GetProcAddress(lib, "ChangeServiceConfig2W");
+
+        if (change_config) {
+            servdesc.lpDescription =
+                (LPTSTR)env->GetStringChars(description, NULL);
+
+            result = change_config((SC_HANDLE)handle,
+                                   SERVICE_CONFIG_DESCRIPTION, &servdesc);
+            env->ReleaseStringChars(description,
+                                    (const jchar *)servdesc.lpDescription);
+        }
+
+        FreeLibrary(lib);
+    }
+
+    return result;
 }

 JNIEXPORT jboolean SIGAR_JNI(win32_Service_CloseServiceHandle)


refln: fix hkl_cif_as_refln_block

refln: fix hkl_cif_as_refln_block

--- include/gemmi/refln.hpp
+++ include/gemmi/refln.hpp
@@ -193,7 +193,7 @@
   rb.entry_id = rb.block.name;
   impl::set_cell_from_mmcif(rb.block, rb.cell, /*mmcif=*/false);
   const char* hm_tag = "_symmetry_space_group_name_H-M";
-  if (const std::string* hm = block.find_value(hm_tag))
+  if (const std::string* hm = rb.block.find_value(hm_tag))
     rb.spacegroup = find_spacegroup_by_name(cif::as_string(*hm),
                                             rb.cell.alpha, rb.cell.gamma);
   rb.cell.set_cell_images_from_spacegroup(rb.spacegroup);


inplace_buff.hh: made InplaceBuffBase usable from outside InplaceBuff<> and also fixed UB

--- include/inplace_buff.hh
+++ include/inplace_buff.hh
@@ -10,6 +10,7 @@
 protected:
 	size_t max_size_;
 	char* p_;
+	char* p_value_when_unallocated_;

 public:
 	/**
@@ -106,20 +107,19 @@
 	// Do not allow to create CStringView of a temporary object
 	constexpr CStringView to_cstr() && = delete;

-	constexpr InplaceBuffBase(size_t s, size_t max_s, char* p) noexcept
-	   : size(s), max_size_(max_s), p_(p) {}
-
 protected:
+	constexpr InplaceBuffBase(size_t s, size_t max_s, char* p,
+	                          char* p_value_when_unallocated) noexcept
+	   : size(s), max_size_(max_s), p_(p),
+	     p_value_when_unallocated_(p_value_when_unallocated) {}
+
 	constexpr InplaceBuffBase(const InplaceBuffBase&) noexcept = default;
 	constexpr InplaceBuffBase(InplaceBuffBase&&) noexcept = default;
 	InplaceBuffBase& operator=(const InplaceBuffBase&) noexcept = default;
 	InplaceBuffBase& operator=(InplaceBuffBase&&) noexcept = default;

 	bool is_allocated() const noexcept {
-		// This is not pretty but works...
-		return (reinterpret_cast<const std::byte*>(p_) -
-		           reinterpret_cast<const std::byte*>(&p_) !=
-		        sizeof p_);
+		return (p_ != p_value_when_unallocated_);
 	}

 	void deallocate() noexcept {
@@ -128,7 +128,7 @@
 	}

 public:
-	~InplaceBuffBase() { deallocate(); }
+	virtual ~InplaceBuffBase() { deallocate(); }

 	template <class... Args,
 	          std::enable_if_t<(is_string_argument<Args> and ...), int> = 0>
@@ -150,7 +150,7 @@
 };

 template <size_t N>
-class InplaceBuff : protected InplaceBuffBase {
+class InplaceBuff : public InplaceBuffBase {
 private:
 	std::array<char, N> a_;

@@ -159,18 +159,39 @@

 	static_assert(N > 0, "Needed for accessing the array's 0-th element");

-	using InplaceBuffBase::is_allocated;
-
 public:
 	static constexpr size_t max_static_size = N;

-	constexpr InplaceBuff() noexcept : InplaceBuffBase(0, N, nullptr) {
-		p_ = &a_[0];
+	constexpr InplaceBuff() noexcept : InplaceBuffBase(0, N, nullptr, nullptr) {
+		p_ = a_.data();
+		p_value_when_unallocated_ = a_.data();
 	}

 	constexpr explicit InplaceBuff(size_t n)
-	   : InplaceBuffBase(n, std::max(N, n), nullptr) {
-		p_ = (n <= N ? &a_[0] : new char[n]);
+	   : InplaceBuffBase(n, std::max(N, n), nullptr, nullptr) {
+		p_ = (n <= N ? a_.data() : new char[n]);
+		p_value_when_unallocated_ = a_.data();
+	}
+
+	constexpr InplaceBuff(const InplaceBuff& ibuff) : InplaceBuff(ibuff.size) {
+		std::copy(ibuff.data(), ibuff.data() + ibuff.size, data());
+	}
+
+	InplaceBuff(InplaceBuff&& ibuff) noexcept
+	   : InplaceBuffBase(ibuff.size, std::max(N, ibuff.max_size_), ibuff.p_,
+	                     nullptr) {
+		p_value_when_unallocated_ = a_.data();
+		if (ibuff.is_allocated()) {
+			p_ = ibuff.p_;
+			ibuff.size = 0;
+			ibuff.max_size_ = N;
+			ibuff.p_ = ibuff.a_.data();
+
+		} else {
+			p_ = a_.data();
+			std::copy(ibuff.data(), ibuff.data() + ibuff.size, p_);
+			ibuff.size = 0;
+		}
 	}

 	template <class T, std::enable_if_t<not std::is_integral_v<std::remove_cv_t<
@@ -178,25 +199,6 @@
 	                                    int> = 0>
 	constexpr explicit InplaceBuff(T&& str) : InplaceBuff(string_length(str)) {
 		std::copy(::data(str), ::data(str) + size, p_);
-	}
-
-	constexpr InplaceBuff(const InplaceBuff& ibuff) : InplaceBuff(ibuff.size) {
-		std::copy(ibuff.data(), ibuff.data() + ibuff.size, data());
-	}
-
-	InplaceBuff(InplaceBuff&& ibuff) noexcept
-	   : InplaceBuffBase(ibuff.size, std::max(N, ibuff.max_size_), ibuff.p_) {
-		if (ibuff.is_allocated()) {
-			p_ = ibuff.p_;
-			ibuff.size = 0;
-			ibuff.max_size_ = N;
-			ibuff.p_ = &ibuff.a_[0];
-
-		} else {
-			p_ = &a_[0];
-			std::copy(ibuff.data(), ibuff.data() + ibuff.size, p_);
-			ibuff.size = 0;
-		}
 	}

 	// Used to unify constructors, as constructor taking one argument is
@@ -225,9 +227,10 @@

 	template <size_t M, std::enable_if_t<M != N, int> = 0>
 	InplaceBuff(InplaceBuff<M>&& ibuff) noexcept
-	   : InplaceBuffBase(ibuff.size, N, ibuff.p_) {
+	   : InplaceBuffBase(ibuff.size, N, ibuff.p_, nullptr) {
+		p_value_when_unallocated_ = a_.data();
 		if (ibuff.size <= N) {
-			p_ = &a_[0];
+			p_ = a_.data();
 			// max_size_ = N;
 			std::copy(ibuff.data(), ibuff.data() + ibuff.size, p_);
 			// Deallocate ibuff memory
@@ -247,7 +250,19 @@
 		// Take care of the ibuff's state
 		ibuff.size = 0;
 		ibuff.max_size_ = M;
-		ibuff.p_ = &ibuff.a_[0];
+		ibuff.p_ = ibuff.a_.data();
+	}
+
+	~InplaceBuff() { assert(p_value_when_unallocated_ == a_.data()); }
+
+	constexpr InplaceBuff& operator=(const InplaceBuff& ibuff) {
+		lossy_resize(ibuff.size);
+		std::copy(ibuff.data(), ibuff.data() + ibuff.size, data());
+		return *this;
+	}
+
+	constexpr InplaceBuff& operator=(InplaceBuff&& ibuff) noexcept {
+		return assign_move_impl(std::move(ibuff));
 	}

 	template <class T>
@@ -258,17 +273,16 @@
 		return *this;
 	}

-	constexpr InplaceBuff& operator=(const InplaceBuff& ibuff) {
-		lossy_resize(ibuff.size);
-		std::copy(ibuff.data(), ibuff.data() + ibuff.size, data());
-		return *this;
-	}
-
 	template <size_t M, std::enable_if_t<M != N, int> = 0>
 	constexpr InplaceBuff& operator=(const InplaceBuff<M>& ibuff) {
 		lossy_resize(ibuff.size);
 		std::copy(ibuff.data(), ibuff.data() + ibuff.size, data());
 		return *this;
+	}
+
+	template <size_t M, std::enable_if_t<M != N, int> = 0>
+	constexpr InplaceBuff& operator=(InplaceBuff<M>&& ibuff) noexcept {
+		return assign_move_impl(std::move(ibuff));
 	}

 private:
@@ -290,41 +304,12 @@
 		}

 		// Take care of the ibuff's state
-		ibuff.p_ = &ibuff.a_[0];
+		ibuff.p_ = ibuff.a_.data();
 		ibuff.size = 0;
 		ibuff.max_size_ = M;

 		return *this;
 	}
-
-public:
-	constexpr InplaceBuff& operator=(InplaceBuff&& ibuff) noexcept {
-		return assign_move_impl(std::move(ibuff));
-	}
-
-	template <size_t M, std::enable_if_t<M != N, int> = 0>
-	constexpr InplaceBuff& operator=(InplaceBuff<M>&& ibuff) noexcept {
-		return assign_move_impl(std::move(ibuff));
-	}
-
-	using InplaceBuffBase::append;
-	using InplaceBuffBase::back;
-	using InplaceBuffBase::begin;
-	using InplaceBuffBase::cbegin;
-	using InplaceBuffBase::cend;
-	using InplaceBuffBase::clear;
-	using InplaceBuffBase::data;
-	using InplaceBuffBase::end;
-	using InplaceBuffBase::front;
-	using InplaceBuffBase::lossy_resize;
-	using InplaceBuffBase::max_size;
-	using InplaceBuffBase::operator StringBase<char>;
-	using InplaceBuffBase::operator StringView;
-	using InplaceBuffBase::operator[];
-	using InplaceBuffBase::resize;
-	using InplaceBuffBase::size;
-	using InplaceBuffBase::to_cstr;
-	using InplaceBuffBase::to_string;
 };

 template <size_t N>


fixed scale_denominator

fixed scale_denominator

git-svn-id: 06a2cde72a096d93ff72b88e3e6711b8f00772a4@372 d397654b-2ff0-0310-9e29-ba003691a0f9

--- include/mapnik/rule.hpp
+++ include/mapnik/rule.hpp
@@ -262,7 +262,7 @@

         bool active(double scale) const
         {
-            return ( scale > min_scale_ && scale < max_scale_ );
+            return ( scale >= min_scale_ - 1e-6 && scale < max_scale_ + 1e-6);
         }

         void accept(filter_visitor<FeatureT>& v) const


util: make join function a noop when logging is disabled

thanks @f-koehler for pointing that out via profiling traces

--- include/pfasst/util.hpp
+++ include/pfasst/util.hpp
@@ -68,12 +68,15 @@
    * std::vector<double> vec{0.0, 0.5, 0.1};
    * join(vec, ", ");  // ==> "[0.0, 0.5, 0.1]"
    * @endcode
+   *
+   * @note This funtion is a noop when compiling with `PFASST_NO_LOGGING` defined.
    *
    * @ingroup Utilities
    */
   template<typename T>
   static string join(const vector<T>& vec, const string& sep)
   {
+#ifndef PFASST_NO_LOGGING
     stringstream out;
     out << "[" << LOG_FLOAT;
     for (size_t i = 0; i < vec.size() - 1; ++i) {
@@ -82,6 +85,9 @@
     out << vec.back();
     out << "]";
     return out.str();
+#else
+    return "";
+#endif
   }
 }  // ::pfasst


WaE: unused variable 'bSuccess'

WaE: unused variable 'bSuccess'

Change-Id: Ia76ac36d3220883aa72b67dbaaa5c0e0251e3cf3

--- include/rtl/ustring.hxx
+++ include/rtl/ustring.hxx
@@ -2091,6 +2091,7 @@
                                                    rSource.getLength(),
                                                    RTL_TEXTENCODING_UTF8,
                                                    RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR|RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR|RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR);
+        (void) bSuccess;
         assert(bSuccess);
         return aTarget;
     }


Remove unused SfxMiniRecordWriter ctor

Remove unused SfxMiniRecordWriter ctor

Change-Id: I97fd0bb73fd13af1c3b2a548b1329393cbc10924

--- include/svl/filerec.hxx
+++ include/svl/filerec.hxx
@@ -196,8 +196,6 @@

 public:
     inline          SfxMiniRecordWriter( SvStream *pStream, sal_uInt8 nTag );
-    inline          SfxMiniRecordWriter( SvStream *pStream, sal_uInt8 nTag,
-                                         sal_uInt32 nSize );
     inline          ~SfxMiniRecordWriter();

     inline SvStream& operator*() const;
@@ -592,23 +590,6 @@
     pStream->SeekRel( + SFX_REC_HEADERSIZE_MINI );
 }

-/** create a mini record with a known content size
- *
- * @param pStream the stream that will contain the record
- * @param nTag    a record tag between 0x01 and 0xFE
- * @param nSize   data size in Byte
- */
-inline SfxMiniRecordWriter::SfxMiniRecordWriter( SvStream* pStream, sal_uInt8 nTag, sal_uInt32 nSize )
-:   _pStream( pStream ),
-    _bHeaderOk(true)
-{
-    DBG_ASSERT( nTag != 0 && nTag != 0xFF, "invalid Tag" );
-    DBG(_nStartPos = pStream->Tell());
-    DBG( DbgOutf( "SfxFileRec: writing record to %ul", _nStartPos ) );
-
-    pStream->WriteUInt32( ( nTag << 24 ) | nSize );
-}
-
 /** The destructor closes the record automatically if not done earlier */
 inline SfxMiniRecordWriter::~SfxMiniRecordWriter()
 {


Try make VS 2015 happy

Try make VS 2015 happy

--- include/tao/seq/sum.hpp
+++ include/tao/seq/sum.hpp
@@ -47,16 +47,19 @@
          {
          };

-         template< typename T, T lhs, T rhs >
-         struct sum_minus_helper
+         template< typename T, T v >
+         struct unary_minus_t
          {
-            using type = std::integral_constant< T, lhs - rhs >;
+            using type = std::integral_constant< T, -v >;
          };
+
+         template< typename T, T v >
+         using unary_minus = typename unary_minus_t< T, v >::type;

          template< bool, std::size_t N, typename T, T... Ns >
          struct sum
          {
-            using type = typename sum_minus_helper< T, T( sizeof( collector< make_index_sequence< N >, ( ( Ns > 0 ) ? Ns : 0 )... > ) ), T( sizeof( collector< make_index_sequence< N >, ( ( Ns < 0 ) ? -Ns : 0 )... > ) ) >::type;
+            using type = std::integral_constant< T, T( sizeof( collector< make_index_sequence< N >, ( ( Ns > 0 ) ? Ns : 0 )... > ) ) - T( sizeof( collector< make_index_sequence< N >, ( ( Ns < 0 ) ? unary_minus< T, Ns >::value : 0 )... > ) ) >;
          };

          template< std::size_t N, typename T, T... Ns >


replaced snprintf() with sprintf() for portability

--- include/vigra/error.hxx
+++ include/vigra/error.hxx
@@ -23,13 +23,10 @@
 #ifndef VIGRA_ERROR_HXX
 #define VIGRA_ERROR_HXX

+#include <stdexcept>
 #include <stdio.h>
 #include "vigra/config.hxx"

-#ifdef _MSC_VER
-#  define snprintf _snprintf
-#endif
-
 /*! \page ErrorReporting Error Reporting

     \#include "vigra/error.hxx"
@@ -105,38 +102,27 @@

 namespace vigra {

-
 class ContractViolation : public StdException
 {
-  protected:
-#ifdef NO_INLINE_STATIC_CONST_DEFINITION
+  public:
+    ContractViolation(char const * prefix, char const * message,
+                      char const * file, int line)
+    {
+        sprintf(what_, "\n%.30s\n%.900s\n(%.100s:%d)\n", prefix, message, file, line);
+    }
+
+    ContractViolation(char const * prefix, char const * message)
+    {
+        sprintf(what_, "\n%.30s\n%.900s\n", prefix, message);
+    }
+
+    virtual const char * what() const throw()
+    {
+        return what_;
+    }
+
+  private:
     enum { bufsize_ = 1100 };
-#else
-    static const int bufsize_ = 1100;
-#endif
-
-  public:
-    ContractViolation(char const * message)
-    {
-        snprintf(what_, bufsize_, "%s", message);
-    }
-
-    ContractViolation()
-    {
-        what_[0] = 0;
-    }
-
-    ContractViolation(ContractViolation const & o)
-    : StdException(o)
-    {
-        snprintf(what_, bufsize_, "%s", o.what_);
-    }
-
-    virtual const char * what() const throw()
-    {
-        return what_;
-    }
-
     char what_[bufsize_];
 };

@@ -144,42 +130,36 @@
 {
   public:
     PreconditionViolation(char const * message, const char * file, int line)
-    {
-        snprintf( what_, bufsize_, "\nPrecondition violation!\n%s\n(%s:%d)\n", message, file, line);
-    }
+    : ContractViolation("Precondition violation!", message, file, line)
+    {}

     PreconditionViolation(char const * message)
-    {
-        snprintf( what_, bufsize_, "\nPrecondition violation!\n%s\n", message);
-    }
+    : ContractViolation("Precondition violation!", message)
+    {}
 };

 class PostconditionViolation : public ContractViolation
 {
   public:
     PostconditionViolation(char const * message, const char * file, int line)
-    {
-        snprintf( what_, bufsize_, "\nPostcondition violation!\n%s\n(%s:%d)\n", message, file, line);
-    }
+    : ContractViolation("Postcondition violation!", message, file, line)
+    {}

     PostconditionViolation(char const * message)
-    {
-        snprintf( what_, bufsize_, "\nPostcondition violation!\n%s\n", message);
-    }
+    : ContractViolation("Postcondition violation!", message)
+    {}
 };

 class InvariantViolation : public ContractViolation
 {
   public:
     InvariantViolation(char const * message, const char * file, int line)
-    {
-        snprintf( what_, bufsize_, "\nInvariant violation!\n%s\n(%s:%d)\n", message, file, line);
-    }
+    : ContractViolation("Invariant violation!", message, file, line)
+    {}

     InvariantViolation(char const * message)
-    {
-        snprintf( what_, bufsize_, "\nInvariant violation!\n%s\n", message);
-    }
+    : ContractViolation("Invariant violation!", message)
+    {}
 };

 #ifndef NDEBUG
@@ -208,9 +188,9 @@
 inline
 void throw_runtime_error(char const * message, char const * file, int line)
 {
-    char buf[1000];
-    snprintf(buf, 1000, "%s (%s:%d)", message, file, line);
-    throw std::runtime_error(buf);
+    char what_[1100];
+    sprintf(what_, "\n%.30s\n%.900s\n(%.100s:%d)\n");
+    throw std::runtime_error(what_);
 }

 #define vigra_precondition(PREDICATE, MESSAGE) vigra::throw_precondition_error((PREDICATE), MESSAGE, __FILE__, __LINE__)


attempt to fix field extract

attempt to fix field extract

--- ipthelper/ct.cpp
+++ ipthelper/ct.cpp
@@ -284,7 +284,7 @@
 	struct nlattr *tb[CTA_MAX + 1];

 	//Pointer to the current tb being queried
-	struct nlattr ** tb_cur;
+	struct nlattr ** tb_cur = tb;
 	int err;
 	char* data;
 	bool ret = true;
@@ -294,8 +294,8 @@
 		goto out;

 	//printf("root: %d\n", CTA_MAX + 1);
-
-	tb_cur = tb;
+
+
 	for (int i = 0; i < filter_len; i++)
 	{
 		cr_filter* f = &filter[i];
@@ -346,8 +346,11 @@
 	struct nfgenmsg *msg;
 	msg = (nfgenmsg *)NLMSG_DATA(nlh);

+
 	//Root data storage
 	struct nlattr *tb[CTA_MAX + 1];
+	struct nlattr ** tb_buf;
+

 	//Pointer to the current tb being queried
 	struct nlattr ** tb_cur;
@@ -365,22 +368,19 @@
 	{
 		cr_filter* f = &filter[i];

-		if (f->key == CTA_UNSPEC)
-		{
-			assert(i != 0);
-			//printf("&&\n");
-			// &&
-			tb_cur = tb;
-		}
-		else if (f->max != 0)
-		{
-			err = nla_parse_nested((struct nlattr **)f->internal, f->max, tb_cur[f->key], NULL);
+		if (f->max != 0)
+		{
+			tb_buf = malloc(sizeof(struct nlattr *) * (f->max + 1));
+			err = nla_parse_nested(tb_buf, f->max, tb_cur[f->key], NULL);
 			if (err < 0)
 			{
 				return true;//error
 			}

-			tb_cur = (nlattr **)f->internal;
+			if (tb_cur != tb){
+				free(tb_cur);
+			}
+			tb_cur = (nlattr **)tb_cur;
 		}
 		else
 		{


INTEGRATION: CWS opofxmlstorage (1.24.6); FILE MERGED 2006/05/23 15:11:13 mav 1.24.6.1: #122878# Iconified object replacement image must be handled by the container

--- embeddedobj/source/inc/oleembobj.hxx
+++ embeddedobj/source/inc/oleembobj.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: oleembobj.hxx,v $
  *
- *  $Revision: 1.24 $
- *
- *  last change: $Author: kz $ $Date: 2006-04-26 14:22:52 $
+ *  $Revision: 1.25 $
+ *
+ *  last change: $Author: obo $ $Date: 2006-10-13 11:30:21 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -306,6 +306,7 @@

     virtual ~OleEmbeddedObject();

+    void OnIconChanged_Impl();
     void OnViewChanged_Impl();

 // XEmbeddedObject


Changing direct access to variables to using the methods for rtpheaders

--- erizo/src/erizo/WebRtcConnection.cpp
+++ erizo/src/erizo/WebRtcConnection.cpp
@@ -190,7 +190,6 @@
             len = len - 1 - totalLength + rtpHeaderLength;
           }
         }
-
         this->queueData(0, buf, len, videoTransport_);
       }
     }
@@ -239,15 +238,17 @@
     RtcpHeader *chead = reinterpret_cast<RtcpHeader*> (buf);

     // PROCESS STATS
-    if (chead->packettype == RTCP_Receiver_PT){
-      thisStats_.setFragmentLost (chead->getFractionLost());
-      thisStats_.setPacketsLost (chead->getLostPackets());
-      thisStats_.setJitter (chead->getJitter());
-      statsListener_->notifyStats(thisStats_.getString());
-    }else if (chead->packettype == RTCP_Sender_PT){
-      thisStats_.setRtcpPacketSent(chead->getPacketsSent());
-      thisStats_.setRtcpBytesSent(chead->getOctetsSent());
-      statsListener_->notifyStats(thisStats_.getString());
+    if (this->statsListener_){ // if there is no listener we dont process stats
+      if (chead->packettype == RTCP_Receiver_PT){
+        thisStats_.setFragmentLost (chead->getFractionLost());
+        thisStats_.setPacketsLost (chead->getLostPackets());
+        thisStats_.setJitter (chead->getJitter());
+        statsListener_->notifyStats(thisStats_.getString());
+      }else if (chead->packettype == RTCP_Sender_PT){
+        thisStats_.setRtcpPacketSent(chead->getPacketsSent());
+        thisStats_.setRtcpBytesSent(chead->getOctetsSent());
+        statsListener_->notifyStats(thisStats_.getString());
+      }
     }

     // DELIVER FEEDBACK (RR, FEEDBACK PACKETS)
@@ -261,22 +262,19 @@
         // Check incoming SSRC
         RtpHeader *head = reinterpret_cast<RtpHeader*> (buf);
         RtcpHeader *chead = reinterpret_cast<RtcpHeader*> (buf);
-//        unsigned int recvSSRC = ntohl(head->ssrc);
-
-        unsigned int recvSSRC = head->getSSRC();
-
+        unsigned int recvSSRC;
         if (chead->packettype == RTCP_Sender_PT) { //Sender Report
-//          ELOG_DEBUG ("RTP Sender Report %d length %d ", chead->packettype, ntohs(chead->length));
-          recvSSRC = ntohl(chead->ssrc);
-        }
-
+          recvSSRC = chead->getSSRC();
+        }else{
+          recvSSRC = head->getSSRC();
+        }
         // Deliver data
         if (recvSSRC==this->getVideoSourceSSRC() || recvSSRC==this->getVideoSinkSSRC()) {
           videoSink_->deliverVideoData(buf, length);
         } else if (recvSSRC==this->getAudioSourceSSRC() || recvSSRC==this->getAudioSinkSSRC()) {
           audioSink_->deliverAudioData(buf, length);
         } else {
-          ELOG_DEBUG("Unknown SSRC %u, localVideo %u, remoteVideo %u, ignoring", recvSSRC, this->getVideoSourceSSRC(), this->getVideoSinkSSRC());
+          ELOG_ERROR("Unknown SSRC %u, localVideo %u, remoteVideo %u, ignoring", recvSSRC, this->getVideoSourceSSRC(), this->getVideoSinkSSRC());
         }
       } else if (transport->mediaType == AUDIO_TYPE) {
         if (audioSink_ != NULL) {


Add the following comment in the TClonesArray constructors:
   // The second argument s indicates an approximate number of objects
   // that will be entered in the array. If more than s objects are entered,
   // the array will be automatically expanded.

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

--- cont/src/TClonesArray.cxx
+++ cont/src/TClonesArray.cxx
@@ -1,4 +1,4 @@
-// @(#)root/cont:$Name:  $:$Id: TClonesArray.cxx,v 1.36 2003/02/22 13:25:52 brun Exp $
+// @(#)root/cont:$Name:  $:$Id: TClonesArray.cxx,v 1.37 2003/04/10 20:29:59 brun Exp $
 // Author: Rene Brun   11/02/96

 /*************************************************************************
@@ -83,6 +83,10 @@
    //          TObject::SetDtorOnly(0);
    //    }
    //
+   // The second argument s indicates an approximate number of objects
+   // that will be entered in the array. If more than s objects are entered,
+   // the array will be automatically expanded.
+   //
    // The third argument is not used anymore and only there for backward
    // compatibility reasons.
    //
@@ -129,6 +133,10 @@
    //       else
    //          TObject::SetDtorOnly(0);
    //    }
+   //
+   // The second argument s indicates an approximate number of objects
+   // that will be entered in the array. If more than s objects are entered,
+   // the array will be automatically expanded.
    //
    // The third argument is not used anymore and only there for backward
    // compatibility reasons.


Fixed a compiler error in UUID on OSX.

Fixed a compiler error in UUID on OSX.

Review: https://reviews.apache.org/r/38481

--- 3rdparty/libprocess/3rdparty/stout/include/stout/uuid.hpp
+++ 3rdparty/libprocess/3rdparty/stout/include/stout/uuid.hpp
@@ -30,8 +30,11 @@
 public:
   static UUID random()
   {
-    static THREAD_LOCAL boost::uuids::random_generator* generator =
-      new boost::uuids::random_generator();
+    static THREAD_LOCAL boost::uuids::random_generator* generator = NULL;
+
+    if (generator == NULL) {
+      generator = new boost::uuids::random_generator();
+    }

     return UUID((*generator)());
   }


Remove unnecessarily standard-incompliant code. am: 1142652106 am: 666c4e0ea4

Original change: https://android-review.googlesource.com/c/platform/external/perfetto/+/1356110

Change-Id: I8410f0e69d9bf0a8d1879796ac6732679380452c

--- src/trace_processor/importers/common/clock_tracker.cc
+++ src/trace_processor/importers/common/clock_tracker.cc
@@ -44,8 +44,7 @@
   const auto snapshot_id = cur_snapshot_id_++;

   // Clear the cache
-  static_assert(std::is_trivial<decltype(cache_)>::value, "must be trivial");
-  memset(&cache_[0], 0, sizeof(cache_));
+  cache_.fill({});

   // Compute the fingerprint of the snapshot by hashing all clock ids. This is
   // used by the clock pathfinding logic.


writeData() - call the event queue to check for an eventual CTS variation

--- qvspsocket.cpp
+++ qvspsocket.cpp
@@ -471,6 +471,9 @@
         return -1;
     }

+    // check for eventual CTS variation
+    QAbstractEventDispatcher::instance()->processEvents(QEventLoop::ProcessEventsFlag::AllEvents);
+
     if (qint64(writeBuffer.size()) + len + 1 > maxBufferSize) {
         this->setErrorString(tr("Internal write buffer overflow (max. size %1), write failed").arg(maxBufferSize));
         emit error(_error = QLowEnergyService::ServiceError::OperationError);


Checking block count in the beginning is redundant with checking block_count % block_info_max

--- rai/secure.cpp
+++ rai/secure.cpp
@@ -1812,23 +1812,20 @@
 	{
 		rai::account account (i->first);
 		rai::account_info info (i->second);
-		if (info.block_count >= block_info_max)
-		{
-			uint64_t block_count (1);
-			auto hash (info.open_block);
-			while (!hash.is_zero ())
+		size_t block_count (1);
+		auto hash (info.open_block);
+		while (!hash.is_zero ())
+		{
+			if ((block_count % block_info_max) == 0)
 			{
-				if (!(block_count % block_info_max))
-				{
-					rai::block_info block_info;
-					block_info.account = account;
-					rai::amount balance (block_balance (transaction_a, hash));
-					block_info.balance = balance;
-					block_info_put (transaction_a, hash, block_info);
-				}
-				hash = block_successor (transaction_a, hash);
-				++block_count;
+				rai::block_info block_info;
+				block_info.account = account;
+				rai::amount balance (block_balance (transaction_a, hash));
+				block_info.balance = balance;
+				block_info_put (transaction_a, hash, block_info);
 			}
+			hash = block_successor (transaction_a, hash);
+			++block_count;
 		}
 	}
 }


Stop on committed errorlog in manufacturing mode

Change-Id: I702901704d83b22c3faeb5a61e673cf98245f244
RTC:167554
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39403
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Reviewed-by: William G. Hoffa <7dd6aa5e78423995d9d7c7ecada5b77ee07f88cc@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <fb8db48116bc8a69e29dd8cdb037246f232f4af5@us.ibm.com>
Reviewed-by: Daniel M. Crowell <912029ca9254ac7b5854e56910561d682e1fa2d0@us.ibm.com>

--- src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -366,6 +366,7 @@
     uint32_t substep = 0;
     bool l_doReconfig = false;
     uint32_t numReconfigs = 0;
+    bool l_manufacturingMode = false;

     // soft reconfig loops happen really fast
     // and since for scale-out systems it only happens for istep 7
@@ -374,6 +375,24 @@
     const uint32_t MAX_NUM_RECONFIG_ATTEMPTS = 30;

     TRACFCOMP(g_trac_initsvc, ENTER_MRK"IStepDispatcher::executeAllISteps()");
+
+    // Find out if in manufacturing mode
+    TARGETING::Target* l_pTopLevel = nullptr;
+    TARGETING::targetService().getTopLevelTarget(l_pTopLevel);
+    // Assert if we still have a nullptr target
+    assert(l_pTopLevel != nullptr,"IstepDispatcher::executeAllISteps()"
+        " expected top level target, but got nullptr.");
+
+    auto l_mnfgFlags =
+        l_pTopLevel->getAttr<TARGETING::ATTR_MNFG_FLAGS>();
+
+    // Check to see if SRC_TERM bit is set in MNFG flags
+    if (l_mnfgFlags & TARGETING::MNFG_FLAG_SRC_TERM)
+    {
+        TRACFCOMP(g_trac_initsvc, ERR_MRK"executeAllISteps:"
+                  " In manufacturing mode");
+        l_manufacturingMode = true;
+    }

     while (istep < MaxISteps)
     {
@@ -407,19 +426,6 @@
                 TRACFCOMP(g_trac_initsvc, ERR_MRK"executeAllISteps:"
                           " Reconfig required after IStep %d:%d",
                           istep, substep);
-
-                // Find out if in manufacturing mode
-                bool l_manufacturingMode = false;
-                TARGETING::Target* l_pTopLevel = NULL;
-                TARGETING::targetService().getTopLevelTarget(l_pTopLevel);
-                TARGETING::ATTR_MNFG_FLAGS_type l_mnfgFlags =
-                    l_pTopLevel->getAttr<TARGETING::ATTR_MNFG_FLAGS>();
-                if (l_mnfgFlags & TARGETING::MNFG_FLAG_SRC_TERM)
-                {
-                    TRACFCOMP(g_trac_initsvc, ERR_MRK"executeAllISteps:"
-                              " In manufacturing mode");
-                    l_manufacturingMode = true;
-                }

                 // Find out if in MPIPL mode
                 bool l_MPIPLMode = false;
@@ -582,7 +588,7 @@
                                 // records have been set. We will not increment
                                 // the reboot count.
                                 TRACFCOMP(g_trac_initsvc, "Reconfig loop needed "
-                                    "but no new gard records were commited. Do "
+                                    "but no new gard records were committed. Do "
                                     "not increment reboot count.");
                             }

@@ -606,6 +612,38 @@
                     // else return the error from doIstep
                 }
             }
+
+#ifdef CONFIG_BMC_IPMI
+            if(l_manufacturingMode &&
+                (ERRORLOG::ErrlManager::errlCommittedThisBoot()))
+            {
+                TRACFCOMP(g_trac_initsvc, "Manufacturing Mode is set and an "
+                    "error log has been committed. Stopping the IPL.");
+
+                // Turn off the watchdog so it doesn't trip
+                errlHndl_t err_ipmi = IPMIWATCHDOG::setWatchDogTimer(
+                                   IPMIWATCHDOG::DEFAULT_WATCHDOG_COUNTDOWN,
+                                   static_cast<uint8_t>
+                                              (IPMIWATCHDOG::DO_NOT_STOP |
+                                               IPMIWATCHDOG::BIOS_FRB2),
+                                   IPMIWATCHDOG::NO_ACTIONS); // do nothing
+                if(err_ipmi)
+                {
+                   TRACFCOMP(g_trac_initsvc,
+                                  "init: ERROR: Failed to disable IPMI "
+                                  " watchdog");
+                    err_ipmi->collectTrace("INITSVC");
+                    errlCommit(err_ipmi, INITSVC_COMP_ID );
+                }
+
+                // Flush out the error logs so we can get as much info as
+                // possible
+                ERRORLOG::ErrlManager::callFlushErrorLogs();
+
+                // Stop the IPL
+                stop();
+            }
+#endif

             if (err)
             {


fixed a warning

fixed a warning

--- corelib/src/VWDictionary.cpp
+++ corelib/src/VWDictionary.cpp
@@ -276,8 +276,6 @@
 		}
 		indices.create(query.rows, knn, CV_32S);
 		dists.create(query.rows, knn, featuresType_ == CV_8UC1?CV_32S:CV_32F);
-
-		cv::flann::IndexParams i;

 		flann::Matrix<int> indicesF((int*)indices.data, indices.rows, indices.cols);


File system: fix SeekEnd behaviour, fix size() not being updated after write()

--- cores/esp8266/spiffs_api.cpp
+++ cores/esp8266/spiffs_api.cpp
@@ -221,99 +221,113 @@
     : _fs(fs)
     , _fd(fd)
     , _stat({0})
+    , _written(false)
     {
+        _getStat();
+    }
+
+    ~SPIFFSFileImpl() override {
+        close();
+    }
+
+    size_t write(const uint8_t *buf, size_t size) override {
+        CHECKFD();
+
+        auto result = SPIFFS_write(_fs->getFs(), _fd, (void*) buf, size);
+        if (result < 0) {
+            DEBUGV("SPIFFS_write rc=%d\r\n", result);
+            return 0;
+        }
+        _written = true;
+        return result;
+    }
+
+    size_t read(uint8_t* buf, size_t size) override {
+        CHECKFD();
+
+        auto result = SPIFFS_read(_fs->getFs(), _fd, (void*) buf, size);
+        if (result < 0) {
+            DEBUGV("SPIFFS_read rc=%d\r\n", result);
+            return 0;
+        }
+
+        return result;
+    }
+
+    void flush() override {
+        CHECKFD();
+
+        auto rc = SPIFFS_fflush(_fs->getFs(), _fd);
+        if (rc < 0) {
+            DEBUGV("SPIFFS_fflush rc=%d\r\n", rc);
+        }
+        _written = true;
+    }
+
+    bool seek(uint32_t pos, SeekMode mode) override {
+        CHECKFD();
+
+        int32_t offset = static_cast<int32_t>(pos);
+        if (mode == SeekEnd) {
+            offset = -offset;
+        }
+        auto rc = SPIFFS_lseek(_fs->getFs(), _fd, pos, (int) mode);
+        if (rc < 0) {
+            DEBUGV("SPIFFS_lseek rc=%d\r\n", rc);
+            return false;
+        }
+
+        return true;
+    }
+
+    size_t position() const override {
+        CHECKFD();
+
+        auto result = SPIFFS_lseek(_fs->getFs(), _fd, 0, SPIFFS_SEEK_CUR);
+        if (result < 0) {
+            DEBUGV("SPIFFS_tell rc=%d\r\n", result);
+            return 0;
+        }
+
+        return result;
+    }
+
+    size_t size() const override {
+        CHECKFD();
+        if (_written) {
+            _getStat();
+        }
+        return _stat.size;
+    }
+
+    void close() override {
+        CHECKFD();
+
+        SPIFFS_close(_fs->getFs(), _fd);
+        DEBUGV("SPIFFS_close: fd=%d\r\n", _fd);
+    }
+
+    const char* name() const override {
+        CHECKFD();
+
+        return (const char*) _stat.name;
+    }
+
+protected:
+    void _getStat() const{
         CHECKFD();
         auto rc = SPIFFS_fstat(_fs->getFs(), _fd, &_stat);
         if (rc != SPIFFS_OK) {
             DEBUGV("SPIFFS_fstat rc=%d\r\n", rc);
             _stat = {0};
         }
-    }
-
-    ~SPIFFSFileImpl() override {
-        close();
-    }
-
-    size_t write(const uint8_t *buf, size_t size) override {
-        CHECKFD();
-
-        auto result = SPIFFS_write(_fs->getFs(), _fd, (void*) buf, size);
-        if (result < 0) {
-            DEBUGV("SPIFFS_write rc=%d\r\n", result);
-            return 0;
-        }
-
-        return result;
-    }
-
-    size_t read(uint8_t* buf, size_t size) override {
-        CHECKFD();
-
-        auto result = SPIFFS_read(_fs->getFs(), _fd, (void*) buf, size);
-        if (result < 0) {
-            DEBUGV("SPIFFS_read rc=%d\r\n", result);
-            return 0;
-        }
-
-        return result;
-    }
-
-    void flush() override {
-        CHECKFD();
-
-        auto rc = SPIFFS_fflush(_fs->getFs(), _fd);
-        if (rc < 0) {
-            DEBUGV("SPIFFS_fflush rc=%d\r\n", rc);
-        }
-    }
-
-    bool seek(uint32_t pos, SeekMode mode) override {
-        CHECKFD();
-
-        auto rc = SPIFFS_lseek(_fs->getFs(), _fd, pos, (int) mode);
-        if (rc < 0) {
-            DEBUGV("SPIFFS_lseek rc=%d\r\n", rc);
-            return false;
-        }
-
-        return true;
-    }
-
-    size_t position() const override {
-        CHECKFD();
-
-        auto result = SPIFFS_lseek(_fs->getFs(), _fd, 0, SPIFFS_SEEK_CUR);
-        if (result < 0) {
-            DEBUGV("SPIFFS_tell rc=%d\r\n", result);
-            return 0;
-        }
-
-        return result;
-    }
-
-    size_t size() const override {
-        CHECKFD();
-
-        return _stat.size;
-    }
-
-    void close() override {
-        CHECKFD();
-
-        SPIFFS_close(_fs->getFs(), _fd);
-        DEBUGV("SPIFFS_close: fd=%d\r\n", _fd);
-    }
-
-    const char* name() const override {
-        CHECKFD();
-
-        return (const char*) _stat.name;
-    }
-
-protected:
+        _written = false;
+    }
+
     SPIFFSImpl* _fs;
     spiffs_file _fd;
-    spiffs_stat _stat;
+    mutable spiffs_stat _stat;
+    mutable bool        _written;
 };

 class SPIFFSDirImpl : public DirImpl {


INTEGRATION: CWS ooo19126 (1.2.102); FILE MERGED 2005/09/05 14:08:53 rt 1.2.102.1: #i54170# Change license header: remove SISSL

--- cosv/inc/cosv/stringdata.hxx
+++ cosv/inc/cosv/stringdata.hxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: stringdata.hxx,v $
  *
- *  $Revision: 1.2 $
+ *  $Revision: 1.3 $
  *
- *  last change: $Author: np $ $Date: 2002-11-01 12:18:50 $
+ *  last change: $Author: rt $ $Date: 2005-09-08 07:58:25 $
  *
- *  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
  *
  ************************************************************************/


Need to put macros into files to execute them.

--- html/src/TDocDirective.cxx
+++ html/src/TDocDirective.cxx
@@ -249,7 +249,7 @@
 }

 //______________________________________________________________________________
-void TDocMacroDirective::SubProcess(const TString& what) {
+void TDocMacroDirective::SubProcess(const TString& what, const TString& out) {

 }

@@ -309,7 +309,6 @@
       }
    }

-   Int_t error = TInterpreter::kNoError;
    Long_t ret = 0;
    if (fIsFilename) {
       TString filename;
@@ -388,29 +387,17 @@
       }
       invoc += "-E 'TDocMacroDirective::SubProcess(\""
          + fileSysName + "\",\"" + outfilename + "\");'";
-      TString subProcOut = gSystem->GetFromPipe(invoc.Data());
-      Ssiz_t posResult = subProcOut.Index("TDOCDIRECTIVE RESULT=");
-      if (posResult == TString::kNPOS) {
-         Error("GetResult", "Error running %s!", invoc.Data());
-         result = "";
-         return kFALSE;
-      }
-      TString tok;
-      for (Int_t i = 0; i < 2; ++i) {
-         if (!subProcOut.Tokenize(tok, posResult, "\n")) {
-            Error("GetResult", "Cannot find expected output running %s!", invoc.Data());
-            result = "";
-            return kFALSE;
-         }
-         Long_t tok(strlen("TDOCDIRECTIVE RESULT="), (Ssiz_t)-1).
-
-
-      ret = gROOT->ProcessLine(fileSysName, &error);
+      Int_t exitCode = gSystem->Exec(invoc.Data());
+
    } else {
-      gInterpreter->SaveContext();
-      gInterpreter->SaveGlobalsContext();
+      fileSysName = gSystem->TempDirectory();
+      fileSysName += '/';
+      TString directiveFilename;
+      GetName(directiveFilename);
+      fileSysName += directiveFilename;
       ret = fMacro->Exec(0, &error);
    }
+   ret = gROOT->ProcessLine(fileSysName, &error);

    if (fShowSource) {
       // convert the macro source


Work-around for the Intel v6 compiler.

Work-around for the Intel v6 compiler.

--- src/xalanc/XercesParserLiaison/XercesDOMException.cpp
+++ src/xalanc/XercesParserLiaison/XercesDOMException.cpp
@@ -70,6 +70,10 @@
 static XercesDOMException::ExceptionCode
 translateErrorCode(ExceptionType	theException)
 {
+	// Ugly hack for a bug in the Intel v6 compiler...
+#if __INTEL_COMPILER <= 600
+	return XercesDOMException::ExceptionCode(theException.code);
+#else
 	XercesDOMException::ExceptionCode	theXalanCode = XercesDOMException::UNKNOWN_ERR;

 	switch(theException.code)
@@ -140,6 +144,7 @@
 	};

 	return theXalanCode;
+#endif
 }