Bump version

Bump version

--- javascript.cpp
+++ javascript.cpp
@@ -21,8 +21,8 @@
 #include <jsapi.h>

-#define HJS_VERSION_STR "0.1"
-#define HJS_VERSION_FLOAT 0.1
+#define HJS_VERSION_STR "0.3"
+#define HJS_VERSION_FLOAT 0.3

 #define JSSTRING_TO_CHAR(jsstr) JS_EncodeString(context, jsstr)
 #define DEFINE_GLOBAL_PROP(name, value) JS_DefineProperty (*cx, *globals, name, value, nullptr, nullptr, \


Format: clang-format.sh run

Format: clang-format.sh run


Rebuild RenderGraph when changing scene from/to cubes

--- demo/smaaDemo.cpp
+++ demo/smaaDemo.cpp
@@ -2328,9 +2328,18 @@
 				// fallthrough
 			case SDL_SCANCODE_RIGHT:
 				{
+					// if old or new scene is cubes we must rebuild RG
+					if (activeScene == 0) {
+						rebuildRG = true;
+					}
+
 					// all images + cubes scene
 					unsigned int numScenes = static_cast<unsigned int>(images.size()) + 1;
 					activeScene = (activeScene + sceneIncrement + numScenes) % numScenes;
+
+					if (activeScene == 0) {
+						rebuildRG = true;
+					}
 				}
 				break;

@@ -3136,7 +3145,13 @@
 			ImGui::Combo("Scene", &s, &scenes[0], static_cast<int>(scenes.size()));
 			assert(s >= 0);
 			assert(s < int(scenes.size()));
+			if (s != int(activeScene)) {
+				// if old or new scene is cubes we must rebuild RG
+				if (activeScene == 0 || s == 0) {
+					rebuildRG = true;
+				}
 			activeScene = s;
+			}

 			ImGui::InputText("Load image", imageFileName, inputTextBufferSize);


access_log/Config: fix typo in comment

access_log/Config: fix typo in comment

--- src/access_log/Config.hxx
+++ src/access_log/Config.hxx
@@ -60,7 +60,7 @@
      *
      * Special value "null" specifies that access logging is disabled
      * completely, and "" (empty string) specifies that one-line
-     * logging is performed directly to stdandard output.
+     * logging is performed directly to standard output.
      */
     std::string command;


Fix incorrect behaviour of SDL during respose ACK whenr video and audio services starts

  - added condition in SendStartSessionAck to avoid sending max supported protocol version
    when video or audio services start.
    SDL must send negotiated protocol_version from message from mobile app

Related to Issue-1365

--- src/components/protocol_handler/src/protocol_handler_impl.cc
+++ src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -176,13 +176,16 @@

 void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
                                               uint8_t session_id,
-                                              uint8_t,
+                                              uint8_t protocol_version,
                                               uint32_t hash_id,
                                               uint8_t service_type,
                                               bool protection) {
   LOG4CXX_AUTO_TRACE(logger_);
-
   uint8_t protocolVersion = SupportedSDLProtocolVersion();
+
+  if (kRpc != service_type) {
+    protocolVersion = protocol_version;
+  }

   ProtocolFramePtr ptr(
       new protocol_handler::ProtocolPacket(connection_id,


Add another variant of RenderGraph::renderPass

--- demo/smaaDemo.cpp
+++ demo/smaaDemo.cpp
@@ -498,6 +498,8 @@
 	void createRenderPass(Renderer &renderer, RenderPasses::RenderPasses rp, const RenderPassDesc &desc);

 	void renderPass(RenderPasses::RenderPasses rp, Framebuffers::Framebuffers fb, std::function<void()> f);
+
+	void renderPass(Renderer &renderer, RenderPasses::RenderPasses rp, Framebuffers::Framebuffers fb, const FramebufferDesc &fbDesc, std::function<void()> f);

 	void createRenderTarget(Renderer &renderer, Rendertargets::Rendertargets rt, const RenderTargetDesc &desc);

@@ -2630,6 +2632,16 @@
 }

+void RenderGraph::renderPass(Renderer &renderer, RenderPasses::RenderPasses rp, Framebuffers::Framebuffers fb, const FramebufferDesc &fbDesc, std::function<void()> f) {
+	assert(state == State::Building);
+	assert(!framebuffers[fb]);
+
+	createFramebuffer(renderer, fb, fbDesc);
+
+	renderPass(rp, fb, f);
+}
+
+
 void RenderGraph::renderPass(RenderPasses::RenderPasses rp, Framebuffers::Framebuffers fb, std::function<void()> f) {
 	assert(state == State::Building);


Fix for incorrect datetime encoding in aviary contrib

--- src/condor_contrib/aviary/src/AviaryQueryServiceSkeleton.cpp
+++ src/condor_contrib/aviary/src/AviaryQueryServiceSkeleton.cpp
@@ -102,35 +102,35 @@
 }

 // unfortunately no convenience functions from WS02 for dateTime
-axutil_date_time_t* encodeDateTime(const time_t* _time) {
-	struct tm _tm;
+axutil_date_time_t* encodeDateTime(const time_t& ts) {
+	struct tm the_tm;

 	// need the re-entrant version because axutil_date_time_create
 	// calls time() again and overwrites static tm
-	localtime_r(_time,&_tm);
+	localtime_r(&ts,&the_tm);
 	// get our Axis2 env for the allocator
-	const axutil_env_t* _env = provider->getEnv();
-
-	axutil_date_time_t* _value = NULL;
-	_value = axutil_date_time_create(_env);
-
-    if (!_value)
+	const axutil_env_t* env = provider->getEnv();
+
+	axutil_date_time_t* time_value = NULL;
+	time_value = axutil_date_time_create(env);
+
+	if (!time_value)
     {
-        AXIS2_ERROR_SET(_env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(_env->log, AXIS2_LOG_SI, "Out of memory");
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Out of memory");
         return NULL;
     }

 	// play their game with adjusting the year and month offset
-	axutil_date_time_set_date_time(_value,_env,
-								   _tm.tm_year+1900,
-								   _tm.tm_mon+1,
-								   _tm.tm_mday,
-								   _tm.tm_hour,
-								   _tm.tm_min,
-								   _tm.tm_sec,
+	axutil_date_time_set_date_time(time_value,env,
+								   the_tm.tm_year+1900,
+								   the_tm.tm_mon+1,
+								   the_tm.tm_mday,
+								   the_tm.tm_hour,
+								   the_tm.tm_min,
+								   the_tm.tm_sec,
 								   0);
-	return _value;
+	return time_value;
 };

 void mapFieldsToSummary(const JobSummaryFields& fields, JobSummary* _summary) {
@@ -141,8 +141,8 @@
 	sid->setOwner(fields.owner);
 	_summary->getId()->setSubmission(sid);
 	// do date/time conversion
-	_summary->setQueued(encodeDateTime((const time_t*)&fields.queued));
-	_summary->setLast_update(encodeDateTime((const time_t*)&fields.last_update));
+	_summary->setQueued(encodeDateTime(fields.queued));
+	_summary->setLast_update(encodeDateTime(fields.last_update));
 	JobStatusType* jst = new JobStatusType;
 	jst->setJobStatusType(getJobStatusString(fields.status));
 	_summary->setJob_status(jst);
@@ -332,7 +332,7 @@
 	GetJobSummaryResponse* jobSummaryResponse = new GetJobSummaryResponse;
 	JobServerObject* jso = JobServerObject::getInstance();
 	JobSummaryCollection* job_results = new JobSummaryCollection;
-
+
 	IdCollection id_set;

 	if (_getJobSummary->isIdsNil() || _getJobSummary->getIds()->size() == 0) {
@@ -351,7 +351,7 @@
 			id_set.insert((*i)->getJob().c_str());
 		}
 	}
-
+
 	for (IdCollection::const_iterator i = id_set.begin(); id_set.end() != i; i++) {
 		JobSummary* js = new JobSummary;
 		const char* job = *i;


Comparing std::string with NULL is a bad idea, so just check whether its empty.

This code was crashing always with oprofile enabled, since it tried to create a StringRef
out of NULL, which run strlen on NULL.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@91046 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
+++ lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
@@ -76,7 +76,7 @@
  public:
   const char *getFilename(MDNode *Scope) {
     std::string &Filename = Filenames[Scope];
-    if (Filename == NULL) {
+    if (Filename.empty()) {
       DIScope S(Scope);
       Filename = S.getFilename();
     }


allow arbitrary file types (including Rmd) for help-doc command

--- src/cpp/session/modules/presentation/SlideRequestHandler.cpp
+++ src/cpp/session/modules/presentation/SlideRequestHandler.cpp
@@ -170,7 +170,7 @@
    return hasVersion;
 }

-bool knitSlides(const FilePath& slidesRmd, std::string* pErrMsg)
+bool performKnit(const FilePath& rmdFilePath, std::string* pErrMsg)
 {
    // R binary
    FilePath rProgramPath;
@@ -204,13 +204,13 @@
                      "               comment=NA);    "
                      "knit('%2%', encoding='%1%');");
    std::string encoding = projects::projectContext().defaultEncoding();
-   std::string cmd = boost::str(fmt % encoding % slidesRmd.filename());
+   std::string cmd = boost::str(fmt % encoding % rmdFilePath.filename());
    args.push_back(cmd);

    // options
    core::system::ProcessOptions options;
    core::system::ProcessResult result;
-   options.workingDir = slidesRmd.parent();
+   options.workingDir = rmdFilePath.parent();

    // run knit
    error = core::system::runProgram(
@@ -249,7 +249,7 @@
       if (rmdFile.exists())
       {
          std::string errMsg;
-         if (!knitSlides(rmdFile, &errMsg))
+         if (!performKnit(rmdFile, &errMsg))
          {
             pResponse->setError(http::status::InternalServerError,
                                 errMsg);
@@ -413,6 +413,62 @@
    }
 }

+void handlePresentationHelpMarkdownRequest(const FilePath& filePath,
+                                           const std::string& jsCallbacks,
+                                           core::http::Response* pResponse)
+{
+   // indirection on the actual md file (related to processing R markdown)
+   FilePath mdFilePath;
+
+   // knit if required
+   if (filePath.mimeContentType() == "text/x-r-markdown")
+   {
+      // actual file path will be the md file
+      mdFilePath = filePath.parent().complete(filePath.stem() + ".md");
+
+      // do the knit if we are in author mode
+      if (presentation::state::authorMode())
+      {
+         std::string errMsg;
+         if (!performKnit(filePath, &errMsg))
+         {
+            pResponse->setError(http::status::InternalServerError,
+                                errMsg);
+            return;
+         }
+      }
+   }
+   else
+   {
+      mdFilePath = filePath;
+   }
+
+   // read in the file (process markdown)
+   std::string helpDoc;
+   Error error = markdown::markdownToHTML(mdFilePath,
+                                          markdown::Extensions(),
+                                          markdown::HTMLOptions(),
+                                          &helpDoc);
+   if (error)
+   {
+      pResponse->setError(error);
+      return;
+   }
+
+   // process the template
+   std::map<std::string,std::string> vars;
+   vars["title"] = html_utils::defaultTitle(helpDoc);
+   vars["styles"] = resourceFiles().get("presentation/helpdoc.css");
+   vars["r_highlight"] = resourceFiles().get("r_highlight.html");
+   vars["mathjax"] = mathjaxIfRequired(helpDoc);
+   vars["content"] = helpDoc;
+   vars["js_callbacks"] = jsCallbacks;
+   pResponse->setNoCacheHeaders();
+   pResponse->setBody(resourceFiles().get("presentation/helpdoc.html"),
+                      text::TemplateFilter(vars));
+}
+
+
 } // anonymous namespace

@@ -498,30 +554,20 @@
       // save the help dir
       s_presentationHelpDir = filePath.parent();

-
-      // read in the file (process markdown)
-      std::string helpDoc;
-      Error error = markdown::markdownToHTML(filePath,
-                                             markdown::Extensions(),
-                                             markdown::HTMLOptions(),
-                                             &helpDoc);
-      if (error)
-      {
-         pResponse->setError(error);
-         return;
-      }
-
-      // process the template
-      std::map<std::string,std::string> vars;
-      vars["title"] = html_utils::defaultTitle(helpDoc);
-      vars["styles"] = resourceFiles().get("presentation/helpdoc.css");
-      vars["r_highlight"] = resourceFiles().get("r_highlight.html");
-      vars["mathjax"] = mathjaxIfRequired(helpDoc);
-      vars["content"] = helpDoc;
-      vars["js_callbacks"] = jsCallbacks;
-      pResponse->setNoCacheHeaders();
-      pResponse->setBody(resourceFiles().get("presentation/helpdoc.html"),
-                         text::TemplateFilter(vars));
+      // check for markdown
+      if (filePath.mimeContentType() == "text/x-markdown" ||
+          filePath.mimeContentType() == "text/x-r-markdown")
+      {
+         handlePresentationHelpMarkdownRequest(filePath,
+                                               jsCallbacks,
+                                               pResponse);
+      }
+
+      // just a stock file
+      else
+      {
+         pResponse->setFile(filePath, request);
+      }
    }

    // it's a relative file reference


playback knitr errors into presentation slide

--- src/cpp/session/modules/presentation/SlideRequestHandler.cpp
+++ src/cpp/session/modules/presentation/SlideRequestHandler.cpp
@@ -23,6 +23,7 @@
 #include <boost/format.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <boost/algorithm/string/predicate.hpp>
+#include <boost/algorithm/string/trim.hpp>

 #include <boost/regex.hpp>
 #include <boost/iostreams/filter/regex.hpp>
@@ -277,6 +278,7 @@
    args.push_back("--no-restore");
    args.push_back("-e");
    boost::format fmt("library(knitr); "
+                     "opts_knit$set(stop_on_error = 2L); "
                      "opts_chunk$set(cache=TRUE, "
                                     "cache.path='%1%-cache/', "
                                     "fig.path='%1%-figure/', "
@@ -313,9 +315,30 @@
    }
    else if (result.exitStatus != EXIT_SUCCESS)
    {
-      *pErrorResponse = ErrorResponse("Error occurred during knit: " +
-                                      result.stdErr);
-      return false;
+      // if the markdown file doesn't exist then create one to
+      // play the error text back into
+      if (!mdPath.exists())
+      {
+         Error error = core::writeStringToFile(mdPath,
+                                               mdPath.stem() +
+                                               "=======================\n");
+         if (error)
+            LOG_ERROR(error);
+      }
+
+      // append the knitr error message to the file
+      std::ostringstream ostr;
+      ostr << std::endl
+           << "```" << std::endl
+           << "Error executing R code:" << std::endl << std::endl
+           << boost::algorithm::trim_copy(result.stdErr) << std::endl
+           << "```" << std::endl;
+
+      Error error = core::appendToFile(mdPath, ostr.str());
+      if (error)
+         LOG_ERROR(error);
+
+      return true;
    }
    else
    {


trying to write normals

trying to write normals

--- apps/ifc_extract_meshes.cpp
+++ apps/ifc_extract_meshes.cpp
@@ -104,7 +104,10 @@
   fs::path json_path(json_out);
   for (const auto &obj : objects) {
     std::string fname = filename_out(std::get<1>(obj), std::get<2>(obj));
-    if (!OpenMesh::IO::write_mesh(std::get<0>(obj), fname)) {
+    OpenMesh::IO::Options wopts;
+    wopts += OpenMesh::IO::Options::VertexNormal;
+    wopts += OpenMesh::IO::Options::FaceNormal;
+    if (!OpenMesh::IO::write_mesh(std::get<0>(obj), fname, wopts)) {
       std::cerr << "Unable to write mesh to \"" + fname + "\"";
     }
     if (json) {


io_tester: Make RPS submitter multifiber

One fiber is sometimes not enough to saturate the disk even if
all shards are in use -- reactor spends too much time looping
between pollers and submitting tasks -- and the IO becomes CPU
bound.

Allow submitting RPS workload in several fibers. Once done this,
it's possible to add a protection from one shard overload --
since current RPS fiber generates requests without any checks
it's possible that one shard stalls and gets too much requests
in its queue thus making the situation even worse. Making each
fiber submit requests one-by-one (waiting in between) solves
this and makes RPS generator more stable and more scylla-like.

The "while at it" addon -- when fibers start they sleep for some
time not to resonate and generate more uniform distribution of
requests.

Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@scylladb.com>

--- apps/io_tester/io_tester.cc
+++ apps/io_tester/io_tester.cc
@@ -199,15 +199,17 @@
         });
     }

-    future<> issue_requests_at_rate(std::chrono::steady_clock::time_point stop, unsigned rps) {
-        return do_with(io_intent{}, 0u, [this, stop, rps] (io_intent& intent, unsigned& in_flight) {
+    future<> issue_requests_at_rate(std::chrono::steady_clock::time_point stop, unsigned rps, unsigned parallelism) {
+        return do_with(io_intent{}, 0u, [this, stop, rps, parallelism] (io_intent& intent, unsigned& in_flight) {
+          return parallel_for_each(boost::irange(0u, parallelism), [this, stop, rps, &intent, &in_flight, parallelism] (auto dummy) mutable {
             auto bufptr = allocate_aligned_buffer<char>(this->req_size(), _alignment);
             auto buf = bufptr.get();
             auto pause = std::chrono::duration_cast<std::chrono::microseconds>(1s) / rps;
+           return seastar::sleep((pause / parallelism) * dummy).then([this, buf, stop, pause, &intent, &in_flight] () mutable {
             return do_until([stop] { return std::chrono::steady_clock::now() > stop; }, [this, buf, stop, pause, &intent, &in_flight] () mutable {
                 auto start = std::chrono::steady_clock::now();
                 in_flight++;
-                (void)issue_request(buf, &intent).then_wrapped([this, start, stop, &in_flight] (auto size_f) {
+                return issue_request(buf, &intent).then_wrapped([this, start, pause, stop, &in_flight] (auto size_f) {
                     size_t size;
                     try {
                         size = size_f.get0();
@@ -222,13 +224,20 @@
                         this->add_result(size, std::chrono::duration_cast<std::chrono::microseconds>(now - start));
                     }
                     in_flight--;
-                    return make_ready_future<>();
+                    auto next = start + pause;
+                    if (next > now) {
+                        return seastar::sleep(std::chrono::duration_cast<std::chrono::microseconds>(next - now));
+                    } else {
+                        // probably the system cannot keep-up with this rate
+                        return make_ready_future<>();
+                    }
                 });
-                return seastar::sleep(std::max(std::chrono::duration_cast<std::chrono::microseconds>((start + pause) - std::chrono::steady_clock::now()), 0us));
-            }).then([&intent, &in_flight] {
+            });
+           }).then([&intent, &in_flight] {
                 intent.cancel();
                 return do_until([&in_flight] { return in_flight == 0; }, [] { return seastar::sleep(100ms /* ¯\_(ツ)_/¯ */); });
             }).finally([bufptr = std::move(bufptr)] {});
+          });
         });
     }

@@ -236,11 +245,10 @@
     future<> issue_requests(std::chrono::steady_clock::time_point stop) {
         _start = std::chrono::steady_clock::now();
         return with_scheduling_group(_sg, [this, stop] {
-            if (parallelism() != 0) {
+            if (rps() == 0) {
                 return issue_requests_in_parallel(stop, parallelism());
-            } else /* rps() != 0 */ {
-                assert(rps() != 0);
-                return issue_requests_at_rate(stop, rps());
+            } else {
+                return issue_requests_at_rate(stop, rps(), parallelism());
             }
         }).then([this] {
             _total_duration = std::chrono::steady_clock::now() - _start;
@@ -643,10 +651,6 @@
         if (node["rps"]) {
             sl.rps = node["rps"].as<unsigned>();
         }
-        if ((sl.parallelism == 0) == (sl.rps == 0)) {
-            fmt::print("Must specify exactly one of 'parallelism' or 'rps' parameters\n");
-            return false;
-        }

         if (node["shares"]) {
             sl.shares = node["shares"].as<unsigned>();


Fix Sky tests

Fix Sky tests

We need to initialize fallback_service_provider_ because its a scalar.

TBR=viettrungluu@chromium.org

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

--- mojo/public/cpp/application/lib/service_provider_impl.cc
+++ mojo/public/cpp/application/lib/service_provider_impl.cc
@@ -9,12 +9,13 @@

 namespace mojo {

-ServiceProviderImpl::ServiceProviderImpl() : binding_(this) {
+ServiceProviderImpl::ServiceProviderImpl()
+    : binding_(this), fallback_service_provider_(nullptr) {
 }

 ServiceProviderImpl::ServiceProviderImpl(
     InterfaceRequest<ServiceProvider> request)
-    : binding_(this, request.Pass()) {
+    : binding_(this, request.Pass()), fallback_service_provider_(nullptr) {
 }

 ServiceProviderImpl::~ServiceProviderImpl() {


Fix pdf suppression test for gm.

Fix pdf suppression test for gm.

git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@2284 2bbb7eff-a529-9590-31e7-b0007b416f81

--- gm/gmmain.cpp
+++ gm/gmmain.cpp
@@ -605,8 +605,9 @@
         for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); i++) {
             uint32_t gmFlags = gm->getFlags();

-            if ((kPDF_Backend == gRec[i].fBackend) && !doPDF ||
-                (gmFlags & GM::kSkipPDF_Flag)) {
+            if ((kPDF_Backend == gRec[i].fBackend) &&
+                (!doPDF || (gmFlags & GM::kSkipPDF_Flag)))
+            {
                 continue;
             }


Fix call recording, as initialization was done inside crazy recording defines, but shutdown/destruction was done in all cases, leading to trying to remove a non existant output link from mpCallrecMixer.  Now the call recorder exists no matter what defines are present, even without INSERT_RECORDERS and WantRecorders (static int, directly tied to INSERT_RECORDERS) being defined.

git-svn-id: 5274dacc98e2a95d0b0452670772bfdffe61ca90@9799 a612230a-c5fa-0310-af8b-88eea846685b

--- sipXmediaLib/src/mp/MpCallFlowGraph.cpp
+++ sipXmediaLib/src/mp/MpCallFlowGraph.cpp
@@ -387,7 +387,6 @@
 //
 ////////////////////////////////////////////////////////////////////////////
 #ifdef INSERT_RECORDERS /* [ */
-   ////////////////////////////////////////////////////////////////////
  if (WantRecorders) {
 #ifndef DISABLE_LOCAL_AUDIO // [
    mpRecorders[RECORDER_MIC] = new MprRecorder("RecordMic",
@@ -413,14 +412,6 @@
                                                     *mpEchoCancel, 1);
    assert(res == OS_SUCCESS);

-   // create Call recorder and connect it to mpCallrecMixer
-   mpRecorders[RECORDER_CALL] =
-      new MprRecorder("RecordCall", samplesPerFrame, samplesPerSec);
-   res = addResource(*(mpRecorders[RECORDER_CALL]));
-   assert(res == OS_SUCCESS);
-   res = addLink(*mpCallrecMixer, 0, *(mpRecorders[RECORDER_CALL]), 0);
-   assert(res == OS_SUCCESS);
-
 #ifdef HIGH_SAMPLERATE_AUDIO // [
    mpRecorders[RECORDER_ECHO_IN32] =
       new MprRecorder("RecordEchoIn32", samplesPerFrame, samplesPerSec);
@@ -436,8 +427,7 @@
    res = insertResourceAfter(*(mpRecorders[RECORDER_SPKR32K]), *mpToSpkr, 1);
    assert(res == OS_SUCCESS);
 #endif // HIGH_SAMPLERATE_AUDIO ]
-#endif // DISABLE_LOCAL_AUDIO ]
-   ////////////////////////////////////////////////////////////////////
+#endif // ndef DISABLE_LOCAL_AUDIO ]
  }
 #endif /* INSERT_RECORDERS ] */

@@ -451,6 +441,14 @@
    assert(res == OS_SUCCESS);
 ///////////////////////////////////////////////////////////////////////////////////

+   // Call Recording..  Always record calls.
+   // create Call recorder and connect it to mpCallrecMixer
+   mpRecorders[RECORDER_CALL] =
+      new MprRecorder("RecordCall", samplesPerFrame, samplesPerSec);
+   res = addResource(*(mpRecorders[RECORDER_CALL]));
+   assert(res == OS_SUCCESS);
+   res = addLink(*mpCallrecMixer, 0, *(mpRecorders[RECORDER_CALL]), 0);
+   assert(res == OS_SUCCESS);

    // ask the media processing task to manage the new flow graph
    pMediaTask = MpMediaTask::getMediaTask(0);


Improve getCurrentPosition() accuracy

Improve getCurrentPosition() accuracy

--- library/jni/openslmediaplayer/source/AudioPlayer.cpp
+++ library/jni/openslmediaplayer/source/AudioPlayer.cpp
@@ -229,11 +229,14 @@

     int32_t last_buffering_update_notified_position_;

+    timespec ts_playback_completed_;
     timespec ts_last_seek_request_;
     bool seek_pending_;
     int32_t pending_seek_position_;

     AudioMixer::mixing_stop_cause_t current_source_stop_cause_;
+
+    int32_t output_latency_ms_;
 };

 class TimeoutChecker {
@@ -510,7 +513,7 @@
       event_handler_(nullptr), data_source_(), mixer_control_handle_(), looping_(false), fade_in_out_enabled_(false),
       prepared_(false), started_(false), start_pending_(false), playback_completed_(false), last_stopped_position_(0),
       preparing_source_create_reason_(AUDIO_SOURCE_CREATE_REASON_NONE), next_player_(nullptr),
-      next_player_instance_id_(0), last_buffering_update_notified_position_(0),
+      next_player_instance_id_(0), last_buffering_update_notified_position_(0), ts_playback_completed_(utils::timespec_utils::ZERO()),
       ts_last_seek_request_(utils::timespec_utils::ZERO()), seek_pending_(false), pending_seek_position_(false),
       current_source_stop_cause_(MIXING_STOP_CAUSE_INVALID)
 {
@@ -534,6 +537,16 @@

     int result;
     uint32_t player_instance_id = 0;
+    uint32_t sampling_rate = 0;
+    uint32_t latency_in_frames = 0;
+
+    result = audio_system->getSystemOutputSamplingRate(&sampling_rate);
+    if (result != OSLMP_RESULT_SUCCESS)
+        return result;
+
+    result = audio_system->getOutputLatencyInFrames(&latency_in_frames);
+    if (result != OSLMP_RESULT_SUCCESS)
+        return result;

     // register as audio player client
     result = audio_system->registerAudioPlayer(holder_, player_instance_id);
@@ -557,6 +570,7 @@
     event_handler_ = args.event_handler;
     mixer_control_handle_ = reg_src_args.control_handle;
     preparing_source_create_reason_ = AUDIO_SOURCE_CREATE_REASON_NONE;
+    output_latency_ms_ = (latency_in_frames * 1000) / (sampling_rate / 1000);

     return OSLMP_RESULT_SUCCESS;
 }
@@ -1058,6 +1072,7 @@
             if (!looped) {
                 playback_completed_ = true;
                 last_stopped_position_ = completed_position;
+                utils::timespec_utils::get_current_time(ts_playback_completed_);
                 setStartedStatus(false, false);
             } else {
                 moveReadySourceToActiveSource(&mixer_da);
@@ -1070,6 +1085,7 @@

             playback_completed_ = true;
             last_stopped_position_ = completed_position;
+            utils::timespec_utils::get_current_time(ts_playback_completed_);
         }

         refreshCurrentSourceToMixer(&mixer_da);
@@ -1315,7 +1331,14 @@

     if (playback_completed_) {
         // playback completed
-        *position = last_stopped_position_;
+        timespec cur_time;
+        utils::timespec_utils::get_current_time(cur_time);
+        int64_t diff = utils::timespec_utils::sub_ret_ms(cur_time, ts_playback_completed_);
+        if (diff < output_latency_ms_) {
+            *position = (std::max)(0, last_stopped_position_ - static_cast<int32_t>(output_latency_ms_ - diff));
+        } else {
+            *position = last_stopped_position_;
+        }
         result = OSLMP_RESULT_SUCCESS;
     } else if (isSeeking()) {
         // seeking
@@ -1328,6 +1351,9 @@
     } else if (active_source_) {
         // playing
         result = active_source_->getCurrentPosition(position);
+        if (result == OSLMP_RESULT_SUCCESS && (*position) > 0) {
+            (*position) = (std::max)(0, (*position) - output_latency_ms_);
+        }
     } else if (ready_source_) {
         // paused
         result = ready_source_->getCurrentPosition(position);


[Exclusivity] Fix Definite Initialization for Diagnostics.

Handle mutating methods in initializers properly.

This only affects --enforce-exclusivity mode.
It will be unit tested by default soon.

--- lib/SILOptimizer/Mandatory/DIMemoryUseCollectorOwnership.cpp
+++ lib/SILOptimizer/Mandatory/DIMemoryUseCollectorOwnership.cpp
@@ -610,6 +610,19 @@
   }
 }

+/// Return the underlying accessed pointer value. This peeks through
+/// begin_access patterns such as:
+///
+/// %mark = mark_uninitialized [rootself] %alloc : $*T
+/// %access = begin_access [modify] [unknown] %mark : $*T
+/// apply %f(%access) : $(@inout T) -> ()
+static SILValue getAccessedPointer(SILValue Pointer) {
+  if (auto *Access = dyn_cast<BeginAccessInst>(Pointer))
+    return Access->getSource();
+
+  return Pointer;
+}
+
 /// Returns true when the instruction represents added instrumentation for
 /// run-time sanitizers.
 static bool isSanitizerInstrumentation(SILInstruction *Instruction,
@@ -804,8 +817,8 @@
         // individual sub-member is passed as inout, then we model that as an
         // inout use.
         auto Kind = DIUseKind::InOutUse;
-        if ((TheMemory.isStructInitSelf() || TheMemory.isProtocolInitSelf()) &&
-            Pointer == TheMemory.getAddress())
+        if ((TheMemory.isStructInitSelf() || TheMemory.isProtocolInitSelf())
+            && getAccessedPointer(Pointer) == TheMemory.getAddress())
           Kind = DIUseKind::Escape;

         addElementUses(BaseEltNo, PointeeType, User, Kind);


fix warning about size_t >= 0 (which must always be true)

--- gpu/src/GrTextureCache.cpp
+++ gpu/src/GrTextureCache.cpp
@@ -274,17 +274,19 @@
     return count;
 }

+#if GR_DEBUG
+static bool both_zero_or_nonzero(int count, size_t bytes) {
+    return (count == 0 && bytes == 0) || (count > 0 && bytes > 0);
+}
+#endif
+
 void GrTextureCache::validate() const {
     GrAssert(!fHead == !fTail);
-    GrAssert(!fEntryCount == !fEntryBytes);
-    GrAssert(!fClientDetachedBytes == !fClientDetachedBytes);
+    GrAssert(both_zero_or_nonzero(fEntryCount, fEntryBytes));
+    GrAssert(both_zero_or_nonzero(fClientDetachedCount, fClientDetachedBytes));
     GrAssert(fClientDetachedBytes <= fEntryBytes);
     GrAssert(fClientDetachedCount <= fEntryCount);
     GrAssert((fEntryCount - fClientDetachedCount) == fCache.count());
-    GrAssert(fEntryBytes >= 0);
-    GrAssert(fEntryCount >= 0);
-    GrAssert(fClientDetachedCount >= 0);
-    GrAssert(fClientDetachedBytes >= 0);

     fCache.validate();


Implement \splitline for TeX output.

Implement \splitline for TeX output.

--- graf2d/graf/src/TLatex.cxx
+++ graf2d/graf/src/TLatex.cxx
@@ -2021,6 +2021,7 @@
             t.ReplaceAll("#topbar","?");
             t.ReplaceAll("#arcbar","?");
             t.ReplaceAll("#downleftarrow","?");
+            t.ReplaceAll("#splitline","\\genfrac{}{}{0pt}{}");

             t.ReplaceAll("#","\\");
             t.ReplaceAll("%","\\%");


update texture coords

update texture coords

--- Emo-Android/jni/emo_drawable.cpp
+++ Emo-Android/jni/emo_drawable.cpp
@@ -405,15 +405,23 @@

 static float tex_coord_frame_startX(struct Drawable* drawable) {
     int xindex = drawable->frame_index % (int)floor(drawable->texture->width / (drawable->width  + drawable->border));
-    return drawable->border + (drawable->width * xindex);
+    return (drawable->border + drawable->width) * xindex + drawable->border;
 }

 static float tex_coord_frame_startY(struct Drawable* drawable) {
-    int ycount = (int)floor(drawable->texture->height / (drawable->height  + drawable->border)) - 1;
-    int yindex = ycount - drawable->frame_index / (int)floor(drawable->texture->width / (drawable->width  + drawable->border));
-    return drawable->border + (drawable->height * yindex);
-}
-
+    int ycount = (int)floor(drawable->texture->height / (drawable->height  + drawable->border));
+    int yindex = ycount - 1 - drawable->frame_index / (int)(floor(drawable->texture->width / (drawable->width  + drawable->border)));
+
+    return (drawable->border + drawable->height) * yindex + drawable->border;
+}
+
+float getTexCoordStartX(struct Drawable* drawable) {
+    if (drawable->hasSheet) {
+        return tex_coord_frame_startX(drawable) / (float)drawable->texture->glWidth;
+    } else {
+        return 0;
+    }
+}

 float getTexCoordEndX(struct Drawable* drawable) {
     if (drawable->hasSheet) {
@@ -423,14 +431,6 @@
     }
 }

-float getTexCoordStartX(struct Drawable* drawable) {
-    if (drawable->hasSheet) {
-        return (float)tex_coord_frame_startX(drawable) / (float)drawable->texture->glWidth;
-    } else {
-        return 0;
-    }
-}
-
 float getTexCoordStartY(struct Drawable* drawable) {
     if (drawable->hasSheet) {
         return (float)(tex_coord_frame_startY(drawable) + drawable->height) / (float)drawable->texture->glHeight;
@@ -441,7 +441,7 @@

 float getTexCoordEndY(struct Drawable* drawable) {
     if (drawable->hasSheet) {
-        return (float)tex_coord_frame_startY(drawable) / (float)drawable->texture->glHeight;
+        return tex_coord_frame_startY(drawable) / (float)drawable->texture->glHeight;
     } else {
         return 0;
     }


Fixed RemoveTag() crashing if the tag did not exist on the Entity

--- Engine/Jewel3D/Entity/Entity.cpp
+++ Engine/Jewel3D/Entity/Entity.cpp
@@ -217,14 +217,17 @@

 	void Entity::RemoveTag(unsigned tagId)
 	{
-		if (IsEnabled())
-		{
-			UnindexTag(tagId);
-		}
-
 		auto itr = std::find(tags.begin(), tags.end(), tagId);
+		if (itr == tags.end())
+			return;
+
 		*itr = tags.back();
 		tags.pop_back();
+
+		if (IsEnabled())
+		{
+			UnindexTag(tagId);
+		}
 	}

 	void Entity::IndexTag(unsigned tagId)


Remove warning

Remove warning

--- Engine/OutputSchedulerThread.cpp
+++ Engine/OutputSchedulerThread.cpp
@@ -701,7 +701,8 @@
         _imp->timer->playState = RUNNING;
     }

-    RenderDirection direction;
+    ///We will push frame to renders starting at startingFrame.
+    ///They will be in the range determined by firstFrame-lastFrame
     int startingFrame;
     int firstFrame,lastFrame;
     {
@@ -709,8 +710,6 @@

         QMutexLocker l(&_imp->runArgsMutex);
         _imp->livingRunArgs = _imp->requestedRunArgs;
-#pragma message WARN("Value stored to 'direction' is never read - please fix and comment")
-        direction = _imp->livingRunArgs.timelineDirection;
         firstFrame = _imp->livingRunArgs.firstFrame;
         lastFrame = _imp->livingRunArgs.lastFrame;
         startingFrame = timelineGetTime();


move lock_data_init position

move lock_data_init position

--- ha_mroonga.cc
+++ ha_mroonga.cc
@@ -2617,10 +2617,10 @@
 {
   int error = 0;
   MRN_DBUG_ENTER_METHOD();
-  thr_lock_data_init(&share->lock,&thr_lock_data,NULL);

   if (!(share = mrn_get_share(name, table, &error)))
     DBUG_RETURN(error);
+  thr_lock_data_init(&share->lock,&thr_lock_data,NULL);

   if (share->wrapper_mode)
   {


fix indent.

fix indent.

--- ha_mroonga.cc
+++ ha_mroonga.cc
@@ -1591,7 +1591,7 @@
   grn_obj *pkey_value_type = NULL; // we don't use this

   tbl_obj = grn_table_create(ctx, tbl_name, tbl_name_len, tbl_path,
-                         tbl_flags, pkey_type, pkey_value_type);
+                             tbl_flags, pkey_type, pkey_value_type);
   if (ctx->rc) {
     error = ER_CANT_CREATE_TABLE;
     my_message(error, ctx->errbuf, MYF(0));


Use file.addToWorkingSet instead of file.open

--- appshell/client_handler.cpp
+++ appshell/client_handler.cpp
@@ -343,7 +343,7 @@
 void ClientHandler::SendOpenFileCommand(CefRefPtr<CefBrowser> browser, const CefString &filename) {
   std::string filenameStr(filename);
   // FIXME: Use SendJSCommand once it supports parameters
-  std::string cmd = "require('command/CommandManager').execute('file.open',{fullPath:'" + filenameStr + "'})";
+  std::string cmd = "require('command/CommandManager').execute('file.addToWorkingSet',{fullPath:'" + filenameStr + "'})";
   browser->GetMainFrame()->ExecuteJavaScript(CefString(cmd.c_str()),
                                 browser->GetMainFrame()->GetURL(), 0);
 }


add a configuration of GLOBAL-esd-converter-schema with schema enabled

--- HLT/global/AliHLTGlobalAgent.cxx
+++ HLT/global/AliHLTGlobalAgent.cxx
@@ -192,6 +192,7 @@
   pHandler->CreateConfiguration("GLOBAL-flat-esd-converter", "GlobalFlatEsdConverter", esdInputs.Data(), "-object-compression=0");
   pHandler->CreateConfiguration("GLOBAL-esd-converter", "GlobalEsdConverter", esdInputs.Data(), "-object-compression=0");
   pHandler->CreateConfiguration("GLOBAL-esd-converter-friends", "GlobalEsdConverter", esdInputs.Data(), "-object-compression=0 -make-friends");
+  pHandler->CreateConfiguration("GLOBAL-esd-converter-schema", "GlobalEsdConverter", esdInputs.Data(), "-object-compression=0 -schema");
 #endif


Return data in internal SSL buffers after close (#4756)

When the TCP socket is closed there may be some data left in the
BearSSL internal buffers which can be read by the application.

The BearSSL pump, however, would always return no data available
in the case the socket was disconnected before checking if the
SSL was in a state where the app could possibly read.

Fix by returning if the state is available, even if the connection
is gone.  Eventually no more data will become available to read
and the original -1 will be returned.

This should match the existing axTLS ::connected() behavior.

--- libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp
+++ libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp
@@ -228,8 +228,7 @@
 }

 uint8_t WiFiClientSecure::connected() {
-  if (WiFiClient::connected() || available() ||
-      (_clientConnected() && _handshake_done)) {
+  if (available() || (_clientConnected() && _handshake_done)) {
     return true;
   }
   return false;
@@ -398,7 +397,7 @@
     }

     if (!(_client->state() == ESTABLISHED) && !WiFiClient::available()) {
-      return -1;
+      return (state & target) ? 0 : -1;
     }

     /*


DMI Linktraining and Centaur Dccal

DMI Linktraining and Centaur Dccal

Change-Id: Iada151d7849bbb77e73ef85298a0fbe9b0958eec
Original-Change-Id: I29e43df88a2a4ff2fff0b6bea8d1608a0b78edb1
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41730
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Reviewed-by: Matt K. Light <19ba8ed73a0b3c376c81fced381f1ac0f483b7c2@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Gary A. Peterson <4fad44d1159626f080df244aebc90d985f64f4dc@us.ibm.com>
Reviewed-by: Richard J. Knight <94c04f3910596886be97211d492ad29f0ba29cd5@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/io/p9_io_dmi_clear_firs.C
+++ src/import/chips/p9/procedures/hwp/io/p9_io_dmi_clear_firs.C
@@ -54,54 +54,52 @@
 //-----------------------------------------------------------------------------
 //  Definitions
 //-----------------------------------------------------------------------------
-fapi2::ReturnCode io_rx_fir_reset(
-    const fapi2::Target < fapi2::TARGET_TYPE_DMI >& i_target);
-
-fapi2::ReturnCode io_tx_fir_reset(
-    const fapi2::Target < fapi2::TARGET_TYPE_DMI >& i_target);
+fapi2::ReturnCode io_dmi_proc_rx_fir_reset(const DMI_PROC_TGT& i_tgt);
+fapi2::ReturnCode io_dmi_proc_tx_fir_reset(const DMI_PROC_TGT& i_tgt);
+
+fapi2::ReturnCode io_dmi_cn_rx_fir_reset(const DMI_CN_TGT& i_tgt);
+fapi2::ReturnCode io_dmi_cn_tx_fir_reset(const DMI_CN_TGT& i_tgt);

 /**
  * @brief Clears PHY Rx/Tx FIRs on the DMI(EDI+) specified target.  The FIRs
  *   are cleared by toggling a rx & tx fir reset bit.
- * @param[in] i_target         FAPI2 Target
- * @retval ReturnCode
- */
-fapi2::ReturnCode p9_io_dmi_clear_firs(
-    const fapi2::Target < fapi2::TARGET_TYPE_DMI >& i_target)
-{
-    FAPI_IMP("I/O Start DMI Clear FIRs");
-
-    FAPI_TRY(io_tx_fir_reset(i_target), "Tx Reset Failed");
-
-    FAPI_TRY(io_rx_fir_reset(i_target), "Rx Reset Failed");
-
-fapi_try_exit:
-    FAPI_IMP("I/O End DMI Clear FIRs");
+ * @param[in] i_tgt         FAPI2 Target
+ * @retval ReturnCode
+ */
+fapi2::ReturnCode p9_io_dmi_proc_clear_firs(const DMI_PROC_TGT& i_tgt)
+{
+    FAPI_IMP("I/O Start DMI Proc Clear FIRs");
+
+    FAPI_TRY(io_dmi_proc_tx_fir_reset(i_tgt), "Tx Reset Failed");
+
+    FAPI_TRY(io_dmi_proc_rx_fir_reset(i_tgt), "Rx Reset Failed");
+
+fapi_try_exit:
+    FAPI_IMP("I/O End DMI Proc Clear FIRs");
     return fapi2::current_err;
 }

 /**
  * @brief This function resets the Rx Firs on a EDI+ DMI
- * @param[in] i_target       FAPI2 Target
- * @retval ReturnCode
- */
-fapi2::ReturnCode io_rx_fir_reset(
-    const fapi2::Target < fapi2::TARGET_TYPE_DMI >& i_target)
+ * @param[in] i_tgt       FAPI2 Target
+ * @retval ReturnCode
+ */
+fapi2::ReturnCode io_dmi_proc_rx_fir_reset(const DMI_PROC_TGT& i_tgt)
 {
     const uint8_t GRP3 = 3;
     const uint8_t LN0 = 0;
     uint64_t l_data = 0;

-    FAPI_TRY(io::read(EDIP_RX_FIR_RESET, i_target, GRP3, LN0, l_data));
+    FAPI_TRY(io::read(EDIP_RX_FIR_RESET, i_tgt, GRP3, LN0, l_data));

     io::set (EDIP_RX_FIR_RESET, 0, l_data);
-    FAPI_TRY(io::write(EDIP_RX_FIR_RESET, i_target, GRP3, LN0, l_data));
+    FAPI_TRY(io::write(EDIP_RX_FIR_RESET, i_tgt, GRP3, LN0, l_data));

     io::set (EDIP_RX_FIR_RESET, 1, l_data);
-    FAPI_TRY(io::write(EDIP_RX_FIR_RESET, i_target, GRP3, LN0, l_data));
+    FAPI_TRY(io::write(EDIP_RX_FIR_RESET, i_tgt, GRP3, LN0, l_data));

     io::set (EDIP_RX_FIR_RESET, 0, l_data);
-    FAPI_TRY(io::write(EDIP_RX_FIR_RESET, i_target, GRP3, LN0, l_data));
+    FAPI_TRY(io::write(EDIP_RX_FIR_RESET, i_tgt, GRP3, LN0, l_data));

 fapi_try_exit:
     return fapi2::current_err;
@@ -109,27 +107,98 @@

 /**
  * @brief This function resets the Tx Firs on a EDI+ DMI
- * @param[in] i_target       FAPI2 Target
- * @retval ReturnCode
- */
-fapi2::ReturnCode io_tx_fir_reset(
-    const fapi2::Target < fapi2::TARGET_TYPE_DMI >& i_target)
+ * @param[in] i_tgt       FAPI2 Target
+ * @retval ReturnCode
+ */
+fapi2::ReturnCode io_dmi_proc_tx_fir_reset(const DMI_PROC_TGT& i_tgt)
 {
     const uint8_t GRP3 = 3;
     const uint8_t LN0 = 0;
     uint64_t l_data = 0;

-    FAPI_TRY(io::read(EDIP_TX_FIR_RESET, i_target, GRP3, LN0, l_data));
+    FAPI_TRY(io::read(EDIP_TX_FIR_RESET, i_tgt, GRP3, LN0, l_data));

     io::set (EDIP_TX_FIR_RESET, 0, l_data);
-    FAPI_TRY(io::write(EDIP_TX_FIR_RESET, i_target, GRP3, LN0, l_data));
+    FAPI_TRY(io::write(EDIP_TX_FIR_RESET, i_tgt, GRP3, LN0, l_data));

     io::set (EDIP_TX_FIR_RESET, 1, l_data);
-    FAPI_TRY(io::write(EDIP_TX_FIR_RESET, i_target, GRP3, LN0, l_data));
+    FAPI_TRY(io::write(EDIP_TX_FIR_RESET, i_tgt, GRP3, LN0, l_data));

     io::set (EDIP_TX_FIR_RESET, 0, l_data);
-    FAPI_TRY(io::write(EDIP_TX_FIR_RESET, i_target, GRP3, LN0, l_data));
-
-fapi_try_exit:
-    return fapi2::current_err;
-}
+    FAPI_TRY(io::write(EDIP_TX_FIR_RESET, i_tgt, GRP3, LN0, l_data));
+
+fapi_try_exit:
+    return fapi2::current_err;
+}
+
+
+/**
+ * @brief Clears PHY Rx/Tx FIRs on the DMI Centaur(EDI) specified target.  The FIRs
+ *   are cleared by toggling a rx & tx fir reset bit.
+ * @param[in] i_tgt         FAPI2 Target
+ * @retval ReturnCode
+ */
+fapi2::ReturnCode p9_io_dmi_cn_clear_firs(const DMI_CN_TGT& i_tgt)
+{
+    FAPI_IMP("I/O Start DMI Proc Clear FIRs");
+
+    FAPI_TRY(io_dmi_cn_tx_fir_reset(i_tgt), "Tx Reset Failed");
+
+    FAPI_TRY(io_dmi_cn_rx_fir_reset(i_tgt), "Rx Reset Failed");
+
+fapi_try_exit:
+    FAPI_IMP("I/O End DMI Proc Clear FIRs");
+    return fapi2::current_err;
+}
+
+/**
+ * @brief This function resets the Rx Firs on a EDI DMI Centaur
+ * @param[in] i_tgt       FAPI2 Target
+ * @retval ReturnCode
+ */
+fapi2::ReturnCode io_dmi_cn_rx_fir_reset(const DMI_CN_TGT& i_tgt)
+{
+    const uint8_t GRP0 = 0;
+    const uint8_t LN0 = 0;
+    uint64_t l_data = 0;
+
+    FAPI_TRY(io::read(EDI_RX_FIR_RESET, i_tgt, GRP0, LN0, l_data));
+
+    io::set (EDI_RX_FIR_RESET, 0, l_data);
+    FAPI_TRY(io::write(EDI_RX_FIR_RESET, i_tgt, GRP0, LN0, l_data));
+
+    io::set (EDI_RX_FIR_RESET, 1, l_data);
+    FAPI_TRY(io::write(EDI_RX_FIR_RESET, i_tgt, GRP0, LN0, l_data));
+
+    io::set (EDI_RX_FIR_RESET, 0, l_data);
+    FAPI_TRY(io::write(EDI_RX_FIR_RESET, i_tgt, GRP0, LN0, l_data));
+
+fapi_try_exit:
+    return fapi2::current_err;
+}
+
+/**
+ * @brief This function resets the Tx Firs on a EDI DMI Centaur
+ * @param[in] i_tgt       FAPI2 Target
+ * @retval ReturnCode
+ */
+fapi2::ReturnCode io_dmi_cn_tx_fir_reset(const DMI_CN_TGT& i_tgt)
+{
+    const uint8_t GRP0 = 0;
+    const uint8_t LN0 = 0;
+    uint64_t l_data = 0;
+
+    FAPI_TRY(io::read(EDI_TX_FIR_RESET, i_tgt, GRP0, LN0, l_data));
+
+    io::set (EDI_TX_FIR_RESET, 0, l_data);
+    FAPI_TRY(io::write(EDI_TX_FIR_RESET, i_tgt, GRP0, LN0, l_data));
+
+    io::set (EDI_TX_FIR_RESET, 1, l_data);
+    FAPI_TRY(io::write(EDI_TX_FIR_RESET, i_tgt, GRP0, LN0, l_data));
+
+    io::set (EDI_TX_FIR_RESET, 0, l_data);
+    FAPI_TRY(io::write(EDI_TX_FIR_RESET, i_tgt, GRP0, LN0, l_data));
+
+fapi_try_exit:
+    return fapi2::current_err;
+}


Characterization Default Image

Characterization Default Image

Change-Id: I6133bc762513a38a58e48feedf7952e65a7fa378
Original-Change-Id: I24ce2816a6e5583824f94db4f200cba9e0a2ec74
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43407
Tested-by: PPE CI <dc75934ba5befb9221434e67a247b93aec46b36b@us.ibm.com>
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Reviewed-by: Michael S. Floyd <fe74c9a922ad1b821954b2cbd8912f02d8d2c303@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: BRIAN D. VICTOR <b7917073e39d65dc28470b9836a55eb633564312@ibm.com>
Reviewed-by: Gregory S. Still <4249770c9038596e9483266bcd48707ac69ee60b@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/lib/p9_hcd_memmap_homer.H
+++ src/import/chips/p9/procedures/hwp/lib/p9_hcd_memmap_homer.H
@@ -82,10 +82,10 @@
           (HOMER_PPMR_HEADER_ADDR + PPMR_HEADER_SIZE))

 HCD_CONST(HOMER_OCC_PSTATE_PARAM_BLOCK_ADDR,
-          (HOMER_PPMR_BASE_ADDR + OCC_PSTATE_PARAM_BLOCK_PPMR_OFFSET));
+          (HOMER_PPMR_BASE_ADDR + OCC_PSTATE_PARAM_BLOCK_PPMR_OFFSET))
 HCD_CONST(HOMER_PGPE_PSTATE_OUTPUT_TABLES_ADDR,
-          (HOMER_PPMR_BASE_ADDR + PGPE_PSTATE_OUTPUT_TABLES_PPMR_OFFSET));
+          (HOMER_PPMR_BASE_ADDR + PGPE_PSTATE_OUTPUT_TABLES_PPMR_OFFSET))
 HCD_CONST(HOMER_OCC_WOF_TABLES_ADDR,
-          (HOMER_PPMR_BASE_ADDR + OCC_WOF_TABLES_PPMR_OFFSET));
+          (HOMER_PPMR_BASE_ADDR + OCC_WOF_TABLES_PPMR_OFFSET))

 #endif /* __P9_HCD_MEMMAP_HOMER_H__ */


MCD disable workaround for HW423589 (option1)

chip_ec_attributes.xml
  add ATTR_CHIP_EC_FEATURE_HW423589_OPTION1, defines set of chips which need
  MCD disable for HW423589 (applied to Nimbus EC20 and 22+)

p9.cxa.scom.initfile
p9.int.scom.initfile
p9.l2.scan.initfile
p9.l3.scan.initfile
p9.mmu.scom.initfile
p9.ncu.scan.initfile
p9.npu.scom.initfile
p9.nx.scom.initfile
p9.trace.scan.initfile
p9.vas.scom.initfile
p9_pcie_config.C
  set unit scope disable dials

p9_sbe_scominit.C
p9_pm_pba_init.C
  set PBA unit scope disable dial

p9_pm_set_homer_bar.C
  change PBA0 default command scope from GROUP to NODAL

p9.fbc.ab_hp.scom.initfile
  disable group master setup

p9_setup_bars.C
p9_setup_bars_defs.H
  skip MCD setup for HW423589_OPTION1

Change-Id: Id7bd8e745328736b79856f71057983bdd757c169
Original-Change-Id: I402701bdd3266e19dbbe8c717b8a54942e3c9ee2
CQ: HW423589
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48961
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: HWSV CI <ae069ce3805842f4ed79e0ef7868baadb5df0a6b@us.ibm.com>
Tested-by: PPE CI <dc75934ba5befb9221434e67a247b93aec46b36b@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: Dean Sanner <3b8f978f111a0718dcf88848e092ac780da17ab3@us.ibm.com>
Reviewed-by: Thi N. Tran <25a2bca7ae5a8ea03be09ca8d282480c08c13052@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/nest/p9_setup_bars_defs.H
+++ src/import/chips/p9/procedures/hwp/nest/p9_setup_bars_defs.H
@@ -295,6 +295,7 @@
     uint64_t base_address_mmio;
     std::vector<p9_setup_bars_addr_range> ranges;
     uint8_t hw423589_option2;
+    uint8_t hw423589_option1;
     uint8_t extended_addressing_mode;
 };


PM: Handling scan ring offset update in various error paths.

Commit addresses some expected error scenarios while updating following
headers:
    -  SGPE Image Header
    -  CME  Image Header
    -  CPMR Image Header
    -  QPMR Image Header

Change-Id: Ic7dc1af3145d1db55d5432f103a924c2f06f0fbe
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33304
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: ADAM S. HALE <565a07773395749f48bad07be92a9dcf73b9c6e6@us.ibm.com>
Dev-Ready: ADAM S. HALE <565a07773395749f48bad07be92a9dcf73b9c6e6@us.ibm.com>
Reviewed-by: Gregory S. Still <4249770c9038596e9483266bcd48707ac69ee60b@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33305
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: Daniel M. Crowell <912029ca9254ac7b5854e56910561d682e1fa2d0@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C
+++ src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C
@@ -555,19 +555,33 @@
         pCpmrHdr->cmePstateOffset           =   CPMR_CME_HCODE_OFFSET + SWIZZLE_4_BYTE(pCmeHdr->g_cme_pstate_region_offset);
         pCpmrHdr->cmePstateOffset           =   SWIZZLE_4_BYTE(pCpmrHdr->cmePstateOffset);
         pCpmrHdr->cmePstateLength           =   0;
-        pCpmrHdr->cmeCommonRingOffset       =   CPMR_CME_HCODE_OFFSET + SWIZZLE_4_BYTE(pCmeHdr->g_cme_common_ring_offset);
-        pCpmrHdr->cmeCommonRingOffset       =   SWIZZLE_4_BYTE(pCpmrHdr->cmeCommonRingOffset);
         pCpmrHdr->cmeImgLength              =   pCmeHdr->g_cme_hcode_length;// already swizzled
-        pCpmrHdr->cmeCommonRingLength       =   pCmeHdr->g_cme_common_ring_length;
-        pCpmrHdr->coreSpecRingOffset        =   SWIZZLE_4_BYTE(CME_INST_SPEC_RING_START);
-        pCpmrHdr->coreSpecRingLength        =   pCmeHdr->g_cme_max_spec_ring_length; // already swizzled
         pCpmrHdr->coreScomOffset            =   SWIZZLE_4_BYTE(CORE_SCOM_START);
         pCpmrHdr->coreScomLength            =   SWIZZLE_4_BYTE(CORE_SCOM_RES_SIZE);

+        if( pCmeHdr->g_cme_common_ring_length )
+        {
+            pCpmrHdr->cmeCommonRingOffset       =   CPMR_CME_HCODE_OFFSET + SWIZZLE_4_BYTE(pCmeHdr->g_cme_common_ring_offset);
+            pCpmrHdr->cmeCommonRingOffset       =   SWIZZLE_4_BYTE(pCpmrHdr->cmeCommonRingOffset);
+            pCpmrHdr->cmeCommonRingLength       =   pCmeHdr->g_cme_common_ring_length;
+        }
+
+        if( pCmeHdr->g_cme_max_spec_ring_length )
+        {
+            pCpmrHdr->coreSpecRingOffset        =   SWIZZLE_4_BYTE(CME_INST_SPEC_RING_START);
+            pCpmrHdr->coreSpecRingLength        =   pCmeHdr->g_cme_max_spec_ring_length; // already swizzled
+        }
+
         //Updating CME Image header
         pCmeHdr->g_cme_magic_number         =   SWIZZLE_8_BYTE(CME_MAGIC_NUMBER);
-        pCmeHdr->g_cme_scom_offset          =   SWIZZLE_4_BYTE(pCmeHdr->g_cme_core_spec_ring_offset) +
-                                                SWIZZLE_4_BYTE(pCmeHdr->g_cme_max_spec_ring_length); //Multiple of 32B block
+
+        pCmeHdr->g_cme_scom_offset          =   SWIZZLE_4_BYTE(pCmeHdr->g_cme_hcode_length) +
+                                                SWIZZLE_4_BYTE(pCmeHdr->g_cme_pstate_region_length) +
+                                                SWIZZLE_4_BYTE(pCmeHdr->g_cme_common_ring_length);
+        pCmeHdr->g_cme_scom_offset          =
+            ((pCmeHdr->g_cme_scom_offset + CME_BLOCK_READ_LEN - 1 ) >> CME_BLK_SIZE_SHIFT);
+        //Adding to it instance ring length which is already a multiple of 32B
+        pCmeHdr->g_cme_scom_offset          +=  SWIZZLE_4_BYTE(pCmeHdr->g_cme_max_spec_ring_length);
         pCmeHdr->g_cme_scom_offset          =   SWIZZLE_4_BYTE(pCmeHdr->g_cme_scom_offset);
         pCmeHdr->g_cme_scom_length          =   SWIZZLE_4_BYTE(CORE_SCOM_PER_CME);

@@ -578,13 +592,13 @@
         FAPI_INF("  PS Offset       = 0x%08X",  SWIZZLE_4_BYTE(pCmeHdr->g_cme_pstate_region_offset));
         FAPI_INF("  PS Size         = 0x%08X",  SWIZZLE_4_BYTE(pCmeHdr->g_cme_pstate_region_length));
         FAPI_INF("  CR Offset       = 0x%08X",  SWIZZLE_4_BYTE(pCmeHdr->g_cme_common_ring_offset));
+        FAPI_INF("  CR Ovrd Offset  = 0x%08X", SWIZZLE_4_BYTE(pCmeHdr->g_cme_cmn_ring_ovrd_offset ));
         FAPI_INF("  CR Size         = 0x%08X",  SWIZZLE_4_BYTE(pCmeHdr->g_cme_common_ring_length));
-        FAPI_INF("  CR Ovrd Offset  = 0x%08X", SWIZZLE_4_BYTE(pCmeHdr->g_cme_cmn_ring_ovrd_offset ));
         FAPI_INF("  CSR Offset      = 0x%08X (Real offset / 32) ", SWIZZLE_4_BYTE(pCmeHdr->g_cme_core_spec_ring_offset));
         FAPI_INF("  CSR Length      = 0x%08X (Real length / 32)", SWIZZLE_4_BYTE(pCmeHdr->g_cme_max_spec_ring_length) );
-        FAPI_INF("  CPMR Phy Add    = 0x%016lx", SWIZZLE_8_BYTE(pCmeHdr->g_cme_cpmr_PhyAddr));
         FAPI_INF("  SCOM Offset     = 0x%08X",  SWIZZLE_4_BYTE(pCmeHdr->g_cme_scom_offset));
         FAPI_INF("  SCOM Area Len   = 0x%08X",  SWIZZLE_4_BYTE(pCmeHdr->g_cme_scom_length));
+        FAPI_INF("  CPMR Phy Add    = 0x%016lx", SWIZZLE_8_BYTE(pCmeHdr->g_cme_cpmr_PhyAddr));
         FAPI_INF("========================= CME Header End ==================================");

         FAPI_INF("==========================CPMR Header===========================================");
@@ -646,10 +660,6 @@

         pQpmrHdr->magic_number                  =   SWIZZLE_8_BYTE(QPMR_MAGIC_NUMBER);
         pSgpeHdr->g_sgpe_magic_number           =   SWIZZLE_8_BYTE(SGPE_MAGIC_NUMBER);
-        pSgpeHdr->g_sgpe_cmn_ring_occ_offset    =   pQpmrHdr->sgpeImgLength;
-        pSgpeHdr->g_sgpe_spec_ring_occ_offset   =   SWIZZLE_4_BYTE(pSgpeHdr->g_sgpe_cmn_ring_occ_offset) +
-                SWIZZLE_4_BYTE(pQpmrHdr->quadCommonRingLength);
-        pSgpeHdr->g_sgpe_spec_ring_occ_offset   =   SWIZZLE_4_BYTE(pSgpeHdr->g_sgpe_spec_ring_occ_offset);

         FAPI_INF("==============================QPMR==================================");
         FAPI_INF("  Magic Num               : 0x%16lX", SWIZZLE_8_BYTE(pQpmrHdr->magic_number));
@@ -810,15 +820,20 @@
             o_qpmrHdr.quadScomOffset  = SWIZZLE_4_BYTE(CACHE_SCOM_START);

             sgpeHeader_t* pImgHdr = (sgpeHeader_t*)& i_pChipHomer->qpmrRegion.sgpeRegion.sgpeSramImage[SGPE_INT_VECT];
-            pImgHdr->g_sgpe_cmn_ring_occ_offset = o_qpmrHdr.sgpeImgLength;
+            pImgHdr->g_sgpe_cmn_ring_occ_offset         =   o_qpmrHdr.sgpeImgLength;
+            pImgHdr->g_sgpe_cmn_ring_ovrd_occ_offset    =   0;
+            pImgHdr->g_sgpe_spec_ring_occ_offset        =   0;
+            pImgHdr->g_sgpe_scom_offset                 =   0;
+

             FAPI_INF("SGPE Header");
-            FAPI_INF("  Magic Num     = 0x%16lX", SWIZZLE_8_BYTE(pImgHdr->g_sgpe_magic_number));
-            FAPI_INF("  Reset Addr    = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_reset_address));
-            FAPI_INF("  IVPR Addr     = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_ivpr_address));
-            FAPI_INF("  Build Date    = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_build_date));
-            FAPI_INF("  Version       = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_build_ver));
-            FAPI_INF("  CR OCC Offset = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_cmn_ring_occ_offset));
+            FAPI_INF("  Magic Num       = 0x%16lX", SWIZZLE_8_BYTE(pImgHdr->g_sgpe_magic_number));
+            FAPI_INF("  Reset Addr      = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_reset_address));
+            FAPI_INF("  IVPR Addr       = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_ivpr_address));
+            FAPI_INF("  Build Date      = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_build_date));
+            FAPI_INF("  Version         = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_build_ver));
+            FAPI_INF("  CR OCC Offset   = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_cmn_ring_occ_offset));
+            FAPI_INF("  CR Ovrd Offset  = 0x%08X", SWIZZLE_4_BYTE(pImgHdr->g_sgpe_cmn_ring_ovrd_occ_offset));

         }
         while(0);
@@ -1058,7 +1073,7 @@
             if( rcTemp )
             {
                 FAPI_ERR("Failed to copy PGPE Level2 bootloader");
-                retCode = BUILD_FAIL_SGPE_BL2;
+                retCode = BUILD_FAIL_PGPE_BL2;
                 break;
             }

@@ -1355,8 +1370,13 @@
                 pRingPayload = pRingPayload + ringSize;
             }

-            io_cmnRingSize += (pRingPayload - pRingStart);
-            ALIGN_DWORD(tempSize, io_cmnRingSize)
+            ringSize = (pRingPayload - pRingStart);
+
+            if( ringSize > CORE_COMMON_RING_INDEX_SIZE )
+            {
+                io_cmnRingSize += (pRingPayload - pRingStart);
+                ALIGN_DWORD(tempSize, io_cmnRingSize)
+            }
         }
         while(0);

@@ -1661,6 +1681,7 @@

             ringLength  =  SWIZZLE_4_BYTE(pCmeHdr->g_cme_pstate_region_offset) + SWIZZLE_4_BYTE(
                                pCmeHdr->g_cme_pstate_region_length);
+            //save the length where hcode ends
             tempLength  =  ringLength;

             layoutCmnRingsForCme( i_pHomer,
@@ -1674,25 +1695,41 @@

             if( i_pOverride )
             {
-                uint32_t tempOffset = 0;
-                ALIGN_DWORD( tempOffset, ringLength );
-                pCmeHdr->g_cme_cmn_ring_ovrd_offset = ringLength;
-
-                layoutCmeScanOverride( i_pHomer,
-                                       i_pOverride,
-                                       i_chipState,
-                                       i_ringData,
-                                       i_debugMode,
-                                       i_imgType,
-                                       ringLength );
-            }
-
-            pCmeHdr->g_cme_common_ring_length = ringLength - tempLength;
-            pCmeHdr->g_cme_core_spec_ring_offset        =
-                SWIZZLE_4_BYTE(pCmeHdr->g_cme_common_ring_offset) + pCmeHdr->g_cme_common_ring_length;
-            pCmeHdr->g_cme_core_spec_ring_offset        =
-                ( ( pCmeHdr->g_cme_core_spec_ring_offset + CME_BLOCK_READ_LEN - 1 ) >> CME_BLK_SIZE_SHIFT );
-            ringLength = (pCmeHdr->g_cme_core_spec_ring_offset << CME_BLK_SIZE_SHIFT );
+                uint32_t temp = 0;
+                uint32_t tempRc = 0;
+                ALIGN_DWORD( temp, ringLength );
+                temp = ringLength;
+
+                tempRc = layoutCmeScanOverride( i_pHomer,
+                                                i_pOverride,
+                                                i_chipState,
+                                                i_ringData,
+                                                i_debugMode,
+                                                i_imgType,
+                                                ringLength );
+
+                if( BUILD_FAIL_OVERRIDE == tempRc )
+                {
+                    //found no core overrides
+                    pCmeHdr->g_cme_cmn_ring_ovrd_offset = 0;
+                }
+                else
+                {
+                    pCmeHdr->g_cme_cmn_ring_ovrd_offset = temp;
+                }
+            }
+
+            pCmeHdr->g_cme_common_ring_length = ringLength - tempLength; //cmn ring end - hcode end
+
+            if( !pCmeHdr->g_cme_common_ring_length )
+            {
+                //No common ring , so force offset to be 0
+                pCmeHdr->g_cme_common_ring_offset = 0;
+            }
+
+            tempLength = ringLength;
+            tempLength = (( tempLength + CME_BLOCK_READ_LEN - 1 ) >> CME_BLK_SIZE_SHIFT ); //multiple of 32B
+            ringLength = tempLength << CME_BLK_SIZE_SHIFT; //start position of instance rings

             layoutInstRingsForCme( i_pHomer,
                                    i_chipState,
@@ -1758,6 +1795,8 @@
                                     ImageType_t i_imgType,
                                     RingBucket& io_sgpeRings )
     {
+        FAPI_DBG("> layoutCmnRingsForSgpe");
+
         uint32_t rc = IMG_BUILD_SUCCESS;
         uint32_t sgpeHcodeSize      =   SWIZZLE_4_BYTE(io_qpmrHdr.sgpeImgLength);
         uint8_t* pCmnRingPayload    =   &i_pHomer->qpmrRegion.sgpeRegion.sgpeSramImage[sgpeHcodeSize +
@@ -1826,6 +1865,8 @@
         }
         while(0);   //building common rings

+        FAPI_DBG("< layoutCmnRingsForSgpe");
+
         return rc;
     }

@@ -2001,18 +2042,20 @@
                                     i_imgType,
                                     sgpeRings );

-            pSgpeImgHdr->g_sgpe_spec_ring_occ_offset    =   SWIZZLE_4_BYTE(pSgpeImgHdr->g_sgpe_cmn_ring_occ_offset) +
-                    io_qpmrHdr.quadCommonRingLength;
-            pSgpeImgHdr->g_sgpe_scom_offset     =
-                pSgpeImgHdr->g_sgpe_spec_ring_occ_offset + io_qpmrHdr.quadSpecRingLength;
-
-            FAPI_DBG("SGPE Header Ring Details ");
-            FAPI_DBG("Common Ring Offset            %d (0x%08X) ",
-                     SWIZZLE_4_BYTE(pSgpeImgHdr->g_sgpe_cmn_ring_occ_offset),
-                     SWIZZLE_4_BYTE(pSgpeImgHdr->g_sgpe_cmn_ring_occ_offset));
-            FAPI_DBG("Instance Ring Offset          %d (0x%08X) ",
-                     SWIZZLE_4_BYTE(pSgpeImgHdr->g_sgpe_spec_ring_occ_offset),
-                     SWIZZLE_4_BYTE(pSgpeImgHdr->g_sgpe_spec_ring_occ_offset));
+            if( 0 == io_qpmrHdr.quadCommonRingLength )
+            {
+                //If quad common rings don't exist ensure its offset in image header  is zero
+                pSgpeImgHdr->g_sgpe_cmn_ring_occ_offset = 0;
+            }
+
+            if( io_qpmrHdr.quadSpecRingLength > 0 )
+            {
+                pSgpeImgHdr->g_sgpe_spec_ring_occ_offset    =   io_qpmrHdr.quadCommonRingLength +
+                        SWIZZLE_4_BYTE(io_qpmrHdr.sgpeImgLength);
+                pSgpeImgHdr->g_sgpe_scom_offset             =
+                    SWIZZLE_4_BYTE(io_qpmrHdr.sgpeImgLength) + io_qpmrHdr.quadCommonRingLength +
+                    io_qpmrHdr.quadSpecRingLength;
+            }
         }
         while(0);   //building instance rings


Change indexing in TriangulateFilter to avoid signed/unsigned bug when indices.size() == 0 for a primitive.

--- libmesh/plugins/common-filters/TriangulateFilter.cpp
+++ libmesh/plugins/common-filters/TriangulateFilter.cpp
@@ -96,16 +96,16 @@
                     // the different triplet for each winding order: 0, 1, 2 or
                     // 1, 0, 2.

-                    for(int tri_idx = 0; tri_idx < prim_it->indices.size()-2; tri_idx++) {
+                    for(int tri_idx = 2; tri_idx < prim_it->indices.size(); tri_idx++) {
                         if (tri_idx % 2 == 0) {
+                            new_prim.indices.push_back( prim_it->indices[tri_idx-2] );
+                            new_prim.indices.push_back( prim_it->indices[tri_idx-1] );
                             new_prim.indices.push_back( prim_it->indices[tri_idx] );
-                            new_prim.indices.push_back( prim_it->indices[tri_idx+1] );
-                            new_prim.indices.push_back( prim_it->indices[tri_idx+2] );
                         }
                         else {
-                            new_prim.indices.push_back( prim_it->indices[tri_idx+1] );
-                            new_prim.indices.push_back( prim_it->indices[tri_idx+0] );
-                            new_prim.indices.push_back( prim_it->indices[tri_idx+2] );
+                            new_prim.indices.push_back( prim_it->indices[tri_idx-1] );
+                            new_prim.indices.push_back( prim_it->indices[tri_idx-2] );
+                            new_prim.indices.push_back( prim_it->indices[tri_idx] );
                         }
                     }

@@ -119,10 +119,10 @@
                     // Triangle fans are pretty simple. They generate n
                     // triangles for n+2 vertices. Triangle n is formed by
                     // vertices 0, n+1, n+2, in that order.
-                    for(int tri_idx = 0; tri_idx < prim_it->indices.size()-2; tri_idx++) {
+                    for(int tri_idx = 2; tri_idx < prim_it->indices.size(); tri_idx++) {
                         new_prim.indices.push_back( prim_it->indices[0] );
-                        new_prim.indices.push_back( prim_it->indices[tri_idx+1] );
-                        new_prim.indices.push_back( prim_it->indices[tri_idx+2] );
+                        new_prim.indices.push_back( prim_it->indices[tri_idx-1] );
+                        new_prim.indices.push_back( prim_it->indices[tri_idx] );
                     }

                     *prim_it = new_prim;


INTEGRATION: CWS hr50 (1.18.96); FILE MERGED 2008/04/10 17:39:30 hr 1.18.96.1: #i86574#: fix warning (gcc-4.2.3)

--- lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: sspellimp.cxx,v $
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -568,8 +568,9 @@
             xPropHelper = pPropHelper;
             pPropHelper->AddAsPropListener();   //! after a reference is established
         }
-        else
+        else {
             DBG_ERROR( "wrong number of arguments in sequence" );
+        }

     }
 }


Use vulkan result check macro

Use vulkan result check macro

--- skeletalanimation/skeletalanimation.cpp
+++ skeletalanimation/skeletalanimation.cpp
@@ -104,13 +104,23 @@
 	// Bone transformations
 	std::vector<aiMatrix4x4> boneTransforms;

+	// Modifier for the animation
 	float animationSpeed = 0.75f;
+	// Currently active animation
+	aiAnimation* pAnimation;

 	// Vulkan buffers
 	vkMeshLoader::MeshBuffer meshBuffer;
 	// Reference to assimp mesh
 	// Required for animation
 	VulkanMeshLoader *meshLoader;
+
+	// Set active animation by index
+	void setAnimation(uint32_t animationIndex)
+	{
+		assert(animationIndex < meshLoader->pScene->mNumAnimations);
+		pAnimation = meshLoader->pScene->mAnimations[animationIndex];
+	}

 	// Load bone information from ASSIMP mesh
 	void loadBones(uint32_t meshIndex, const aiMesh* pMesh, std::vector<VertexBoneData>& Bones)
@@ -295,8 +305,6 @@
 	{
 		std::string NodeName(pNode->mName.data);

-		const aiAnimation* pAnimation = meshLoader->pScene->mAnimations[0];
-
 		aiMatrix4x4 NodeTransformation(pNode->mTransformation);

 		const aiNodeAnim* pNodeAnim = findNodeAnim(pAnimation, NodeName);
@@ -313,7 +321,6 @@

 		aiMatrix4x4 GlobalTransformation = ParentTransform * NodeTransformation;

-		// todo : replace name lookup with hash or index
 		if (boneMapping.find(NodeName) != boneMapping.end())
 		{
 			uint32_t BoneIndex = boneMapping[NodeName];
@@ -471,11 +478,8 @@

 	void draw()
 	{
-		VkResult err;
-
 		// Get next image in the swap chain (back/front buffer)
-		err = swapChain.acquireNextImage(semaphores.presentComplete, &currentBuffer);
-		assert(!err);
+		VK_CHECK_RESULT(swapChain.acquireNextImage(semaphores.presentComplete, &currentBuffer));

 		submitPostPresentBarrier(swapChain.buffers[currentBuffer].image);

@@ -484,16 +488,13 @@
 		submitInfo.pCommandBuffers = &drawCmdBuffers[currentBuffer];

 		// Submit to queue
-		err = vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE);
-		assert(!err);
+		VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));

 		submitPrePresentBarrier(swapChain.buffers[currentBuffer].image);

-		err = swapChain.queuePresent(queue, currentBuffer, semaphores.renderComplete);
-		assert(!err);
-
-		err = vkQueueWaitIdle(queue);
-		assert(!err);
+		VK_CHECK_RESULT(swapChain.queuePresent(queue, currentBuffer, semaphores.renderComplete));
+
+		VK_CHECK_RESULT(vkQueueWaitIdle(queue));
 	}

 	// Load a mesh based on data read via assimp
@@ -506,6 +507,7 @@
 		skinnedMesh->meshLoader->assetManager = androidApp->activity->assetManager;
 #endif
 		skinnedMesh->meshLoader->LoadMesh(getAssetPath() + "models/goblin.dae", 0);
+		skinnedMesh->setAnimation(0);

 		// Setup bones
 		// One vertex bone info structure per vertex
@@ -754,8 +756,7 @@
 				poolSizes.data(),
 				2);

-		VkResult vkRes = vkCreateDescriptorPool(device, &descriptorPoolInfo, nullptr, &descriptorPool);
-		assert(!vkRes);
+		VK_CHECK_RESULT(vkCreateDescriptorPool(device, &descriptorPoolInfo, nullptr, &descriptorPool));
 	}

 	void setupDescriptorSetLayout()
@@ -779,16 +780,14 @@
 				setLayoutBindings.data(),
 				setLayoutBindings.size());

-		VkResult err = vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &descriptorSetLayout);
-		assert(!err);
+		VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &descriptorSetLayout));

 		VkPipelineLayoutCreateInfo pPipelineLayoutCreateInfo =
 			vkTools::initializers::pipelineLayoutCreateInfo(
 				&descriptorSetLayout,
 				1);

-		err = vkCreatePipelineLayout(device, &pPipelineLayoutCreateInfo, nullptr, &pipelineLayout);
-		assert(!err);
+		VK_CHECK_RESULT(vkCreatePipelineLayout(device, &pPipelineLayoutCreateInfo, nullptr, &pipelineLayout));
 	}

 	void setupDescriptorSet()
@@ -799,9 +798,8 @@
 				&descriptorSetLayout,
 				1);

-		VkResult vkRes = vkAllocateDescriptorSets(device, &allocInfo, &descriptorSet);
-		assert(!vkRes);
-
+		VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &descriptorSet));
+
 		VkDescriptorImageInfo texDescriptor =
 			vkTools::initializers::descriptorImageInfo(
 				textures.colorMap.sampler,
@@ -924,13 +922,11 @@
 		pipelineCreateInfo.stageCount = shaderStages.size();
 		pipelineCreateInfo.pStages = shaderStages.data();

-		VkResult err = vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.skinning);
-		assert(!err);
+		VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.skinning));

 		shaderStages[0] = loadShader(getAssetPath() + "shaders/skeletalanimation/texture.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
 		shaderStages[1] = loadShader(getAssetPath() + "shaders/skeletalanimation/texture.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
 		vkTools::checkResult(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.texture));
-
 	}

 	// Prepare and initialize uniform buffer containing shader uniforms


*** empty log message ***

*** empty log message ***

--- gtimeline.cpp
+++ gtimeline.cpp
@@ -109,6 +109,9 @@

   CreateControls();
 ////@end gTimeline creation
+
+  splitter->Unsplit();
+
   return true;
 }


Disable inliner/CallGraph pass where not needed: it is slow.

--- interpreter/cling/lib/Interpreter/IncrementalParser.cpp
+++ interpreter/cling/lib/Interpreter/IncrementalParser.cpp
@@ -84,6 +84,13 @@
     m_ASTTransformers.push_back(new NullDerefProtectionTransformer(TheSema));
     m_ASTTransformers.push_back(new CheckEmptyTransactionTransformer(TheSema));

+#ifdef _LIBCPP_VERSION
+    // libc++ relies on force_inline attributes, else symbols will be missing.
+    // But its passes (CallGraph and Inliner) - being module passes - have a
+    // quadratically increasing runtime: for each transaction they need to
+    // iterate over all previous transactions' functions.
+    // Until this is solved (for instance by feeding only the new functions
+    // to the CallGraph) we penalize only the use of libc++.
     if (m_CodeGen) {
       llvm::Module* TheModule = m_CodeGen->GetModule();
       // IR passes make sense if we do CodeGen.
@@ -93,6 +100,7 @@
                                                  CI->getLangOpts(),
                                                  CI->getCodeGenOpts()));
     }
+#endif
   }

   void


- disable all menu choices that aren't implemented.  Only a few remaining! - implement the Edit Keyboard dialog using ParamDialog instead of the   handcoded thing. - make Serial/Parallel dialog look a little better - change order of "other" dialog to get ips and vga_update_interval on top

--- gui/wxmain.cc
+++ gui/wxmain.cc
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////
-// $Id: wxmain.cc,v 1.26 2002/09/03 05:32:49 bdenney Exp $
+// $Id: wxmain.cc,v 1.27 2002/09/03 08:55:35 bdenney Exp $
 /////////////////////////////////////////////////////////////////
 //
 // wxmain.cc implements the wxWindows frame, toolbar, menus, and dialogs.
@@ -286,6 +286,13 @@
   menuBar->Append( menuLog, "&Log" );
   menuBar->Append( menuHelp, "&Help" );
   SetMenuBar( menuBar );
+
+  // disable things that don't work yet
+  menuDebug->Enable (ID_Debug_ShowCpu, FALSE);  // not implemented
+  menuDebug->Enable (ID_Debug_ShowMemory, FALSE);  // not implemented
+  menuLog->Enable (ID_Log_View, FALSE);  // not implemented
+  menuLog->Enable (ID_Log_PrefsDevice, FALSE);  // not implemented
+
   CreateStatusBar();
   SetStatusText( "Welcome to wxWindows!" );

@@ -505,34 +512,14 @@

 void MyFrame::OnEditKeyboard(wxCommandEvent& WXUNUSED(event))
 {
-  ConfigKeyboardDialog dlg (this, -1);
-  for (int i=0; i<n_keyboard_type_names; i++)
-    dlg.AddType (keyboard_type_names[i]);
-  bx_param_enum_c *type = (bx_param_enum_c*)
-    SIM->get_param (BXP_KBD_TYPE);
-  bx_param_num_c *serdel = (bx_param_num_c*)
-    SIM->get_param (BXP_KBD_SERIAL_DELAY);
-  bx_param_num_c *pstdel = (bx_param_num_c*)
-    SIM->get_param (BXP_KBD_PASTE_DELAY);
-  bx_param_bool_c *enableKeymap = (bx_param_bool_c*)
-    SIM->get_param (BXP_KEYBOARD_USEMAPPING);
-  bx_param_string_c *keymap = (bx_param_string_c*)
-    SIM->get_param (BXP_KEYBOARD_MAP);
-  dlg.SetType (type->get ());
-  dlg.SetSerialDelay (serdel->get ());
-  dlg.SetPasteDelay (pstdel->get ());
-  dlg.SetKeymapEnable (enableKeymap->get ());
-  dlg.SetKeymap (wxString (keymap->getptr ()));
-  int n = dlg.ShowModal ();
-  if (n == wxOK) {
-    type->set (dlg.GetType ());
-    serdel->set (dlg.GetSerialDelay ());
-    pstdel->set (dlg.GetPasteDelay ());
-    enableKeymap->set (dlg.GetKeymapEnable ());
-    char buf[1024];
-    safeWxStrcpy (buf, dlg.GetKeymap (), sizeof (buf));
-    keymap->set (buf);
-  }
+  ParamDialog dlg(this, -1);
+  dlg.SetTitle ("Configure Keyboard");
+  dlg.AddParam (SIM->get_param (BXP_KBD_TYPE));
+  dlg.AddParam (SIM->get_param (BXP_KBD_SERIAL_DELAY));
+  dlg.AddParam (SIM->get_param (BXP_KBD_PASTE_DELAY));
+  dlg.AddParam (SIM->get_param (BXP_KEYBOARD_USEMAPPING));
+  dlg.AddParam (SIM->get_param (BXP_KEYBOARD_MAP));
+  dlg.ShowModal ();
 }

 void MyFrame::OnEditSerialParallel(wxCommandEvent& WXUNUSED(event))
@@ -548,7 +535,10 @@
 void MyFrame::OnEditLoadHack(wxCommandEvent& WXUNUSED(event))
 {
   ParamDialog dlg(this, -1);
-  dlg.AddParam (SIM->get_param (BXP_LOAD32BITOS));
+  bx_list_c *list = (bx_list_c*) SIM->get_param (BXP_LOAD32BITOS);
+  dlg.SetTitle (list->get_name ());
+  for (int i=0; i<list->get_size (); i++)
+    dlg.AddParam (list->get (i));
   dlg.ShowModal ();
 }

@@ -556,6 +546,8 @@
 {
   ParamDialog dlg(this, -1);
   dlg.SetTitle ("Other Options");
+  dlg.AddParam (SIM->get_param (BXP_IPS));
+  dlg.AddParam (SIM->get_param (BXP_VGA_UPDATE_INTERVAL));
   dlg.AddParam (SIM->get_param (BXP_LOG_FILENAME));
   dlg.AddParam (SIM->get_param (BXP_LOG_PREFIX));
   dlg.AddParam (SIM->get_param (BXP_MOUSE_ENABLED));
@@ -569,8 +561,6 @@
   dlg.AddParam (SIM->get_param (BXP_SCREENMODE));
 #endif
   dlg.AddParam (SIM->get_param (BXP_I440FX_SUPPORT));
-  dlg.AddParam (SIM->get_param (BXP_IPS));
-  dlg.AddParam (SIM->get_param (BXP_VGA_UPDATE_INTERVAL));

   int n = dlg.ShowModal ();
 }


add hello team

add hello team

--- MSWEproject/MSWEproject/main.cpp
+++ MSWEproject/MSWEproject/main.cpp
@@ -2,7 +2,7 @@
 #include <stdio.h>

 int main(void) {
-	printf("Hello");
+	printf("Hello team");
 	getchar();

 	return 0;


Made another run at 2600 colours.

Made another run at 2600 colours.

--- Machines/Atari2600/Atari2600.cpp
+++ Machines/Atari2600/Atari2600.cpp
@@ -39,7 +39,7 @@
 			"uint y = c & 14u;"
 			"uint iPhase = (c >> 4);"

-			"float phaseOffset = 6.283185308 * float(iPhase + 13u) / 14.0;"
+			"float phaseOffset = 6.283185308 * float(iPhase - 1u) / 13.0;"
 			"return (float(y) / 14.0) * (1.0 - amplitude) + step(1, iPhase) * amplitude * cos(phase + phaseOffset);"
 		"}");
 	_crt->set_output_device(Outputs::CRT::Television);
@@ -55,8 +55,10 @@
 			"uint y = c & 14u;"
 			"uint iPhase = (c >> 4);"

-			"float phaseOffset = (0.5 + 2.0 * (float(iPhase&1u) - 0.5) * (float((iPhase >> 1) + (iPhase&1u)) / 14.0));"
-			"return (float(y) / 14.0) * (1.0 - amplitude) + step(4, (iPhase + 2u) & 15u) * amplitude * cos(phase + 6.283185308 * phaseOffset);"
+			"uint direction = iPhase & 1u;"
+			"float phaseOffset = float(7u - direction) + (float(direction) - 0.5) * 2.0 * float(iPhase >> 1);"
+			"phaseOffset *= 6.283185308 / 12.0;"
+			"return (float(y) / 14.0) * (1.0 - amplitude) + step(4, (iPhase + 2u) & 15u) * amplitude * cos(phase + phaseOffset);"
 		"}");
 	_crt->set_new_timing(228, 312, Outputs::CRT::ColourSpace::YUV, 228, 1);
 }
@@ -171,6 +173,9 @@
 	}

 	// store colour
+//	static int lc;
+//	if(_vSyncEnabled) lc = 0; else lc += (offset == 159) ? 1 : 0;
+//	*pixel = (uint8_t)(((offset  / 10) << 4) | (((lc >> 4)&7) << 1));
 	*pixel = outputColour;
 }


Raise exceptions on planes with too high tesselation to fit in 16-bit indexes

--- OgreMain/src/OgreMeshManager.cpp
+++ OgreMain/src/OgreMeshManager.cpp
@@ -424,6 +424,10 @@
     //-----------------------------------------------------------------------
     void MeshManager::loadManualPlane(Mesh* pMesh, MeshBuildParams& params)
     {
+		if ((params.xsegments + 1) * (params.ysegments + 1) > 65536)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Plane tesselation is too high, must generate max 65536 vertices",
+				__FUNCTION__);
         SubMesh *pSub = pMesh->createSubMesh();

         // Set up vertex data
@@ -570,6 +574,10 @@
     //-----------------------------------------------------------------------
     void MeshManager::loadManualCurvedPlane(Mesh* pMesh, MeshBuildParams& params)
     {
+		if ((params.xsegments + 1) * (params.ysegments + 1) > 65536)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Plane tesselation is too high, must generate max 65536 vertices",
+				__FUNCTION__);
         SubMesh *pSub = pMesh->createSubMesh();

         // Set options
@@ -723,9 +731,14 @@
     //-----------------------------------------------------------------------
     void MeshManager::loadManualCurvedIllusionPlane(Mesh* pMesh, MeshBuildParams& params)
     {
+		if (params.ySegmentsToKeep == -1) params.ySegmentsToKeep = params.ysegments;
+
+		if ((params.xsegments + 1) * (params.ySegmentsToKeep + 1) > 65536)
+			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+				"Plane tesselation is too high, must generate max 65536 vertices",
+				__FUNCTION__);
         SubMesh *pSub = pMesh->createSubMesh();

-        if (params.ySegmentsToKeep == -1) params.ySegmentsToKeep = params.ysegments;

         // Set up vertex data
         // Use a single shared buffer


Fix typo in previous.

Fix typo in previous.

--- OgreRenderingModule/Renderer.cpp
+++ OgreRenderingModule/Renderer.cpp
@@ -582,8 +582,9 @@

         bool applyFPSLimit = true;

+        NaaliGraphicsView *view = framework_->Ui()->GraphicsView();
+
 #ifdef USE_D3D9_SUBSURFACE_BLIT
-        NaaliGraphicsView *view = framework_->Ui()->GraphicsView();

         if (view->IsViewDirty() || resized_dirty_)
         {
@@ -710,21 +711,18 @@
                 resized_dirty_--;
         }
 #else
-
-        NaaliGraphicsView *graphicsView = framework_->Ui()->GraphicsView();
-
-        if (graphicsView->IsViewDirty())
+        if (view->IsViewDirty())
         {
             PROFILE(Renderer_Render_QtBlit);

-            QImage *backBuffer = graphicsView->BackBuffer();
+            QImage *backBuffer = view->BackBuffer();
             if (!backBuffer)
                 return;

-            QSize viewsize(graphicsView->viewport()->size());
+            QSize viewsize(view->viewport()->size());
             QRect viewrect(QPoint(0, 0), viewsize);

-            QSize gviewsize(graphicsView->size());
+            QSize gviewsize(view->size());

             QSize mainwindowSize(framework_->Ui()->MainWindow()->size());
             QSize renderWindowSize(renderWindow->OgreRenderWindow()->getWidth(), renderWindow->OgreRenderWindow()->getHeight());
@@ -740,7 +738,7 @@

             // Paint ui view into buffer
             QPainter painter(backBuffer);
-            graphicsView->viewport()->render(&painter, QPoint(0,0), QRegion(viewrect), QWidget::DrawChildren);
+            view->viewport()->render(&painter, QPoint(0,0), QRegion(viewrect), QWidget::DrawChildren);

             renderWindow->UpdateOverlayImage(*backBuffer);
             if (resized_dirty_ > 0)


Rename variable name

Rename variable name

--- jubatus/core/classifier/nearest_neighbor_classifier.cpp
+++ jubatus/core/classifier/nearest_neighbor_classifier.cpp
@@ -245,7 +245,7 @@
 }

 void nearest_neighbor_classifier::regenerate_label_counter() {
-  labels_t labels;
+  labels_t new_labels;

   {
     shared_ptr<const storage::column_table> table =
@@ -255,7 +255,7 @@
     for (size_t i = 0, n = table->size(); i < n; ++i) {
       std::string id = table->get_key(i);
       std::string label = get_label_from_id(id);
-      labels[label] += 1;
+      new_labels[label] += 1;
     }
   }

@@ -264,10 +264,10 @@
        iter != labels_.end(); ++iter) {
     if (labels.find(iter->first) == labels.end()) {
       // labels registered by set_label are exist
-      labels[iter->first] = iter->second;
-    }
-  }
-  labels_.swap(labels);
+      new_labels[iter->first] = iter->second;
+    }
+  }
+  labels_.swap(new_labels);
 }

 }  // namespace classifier


[analyzer] MacOSKeychainAPIChecker: Remove now-unnecessary check::EndPath.

Also, don't bother to stop tracking symbols in the return value, either.
They are now properly considered live during checkDeadSymbols.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@168068 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
+++ lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
@@ -26,9 +26,7 @@

 namespace {
 class MacOSKeychainAPIChecker : public Checker<check::PreStmt<CallExpr>,
-                                               check::PreStmt<ReturnStmt>,
                                                check::PostStmt<CallExpr>,
-                                               check::EndPath,
                                                check::DeadSymbols> {
   mutable OwningPtr<BugType> BT;

@@ -56,10 +54,8 @@
   };

   void checkPreStmt(const CallExpr *S, CheckerContext &C) const;
-  void checkPreStmt(const ReturnStmt *S, CheckerContext &C) const;
   void checkPostStmt(const CallExpr *S, CheckerContext &C) const;
   void checkDeadSymbols(SymbolReaper &SR, CheckerContext &C) const;
-  void checkEndPath(CheckerContext &C) const;

 private:
   typedef std::pair<SymbolRef, const AllocationState*> AllocationPair;
@@ -486,28 +482,6 @@
   }
 }

-void MacOSKeychainAPIChecker::checkPreStmt(const ReturnStmt *S,
-                                           CheckerContext &C) const {
-  const Expr *retExpr = S->getRetValue();
-  if (!retExpr)
-    return;
-
-  // If inside inlined call, skip it.
-  const LocationContext *LC = C.getLocationContext();
-  if (LC->getParent() != 0)
-    return;
-
-  // Check  if the value is escaping through the return.
-  ProgramStateRef state = C.getState();
-  SymbolRef sym = state->getSVal(retExpr, LC).getAsLocSymbol();
-  if (!sym)
-    return;
-  state = state->remove<AllocatedData>(sym);
-
-  // Proceed from the new state.
-  C.addTransition(state);
-}
-
 // TODO: This logic is the same as in Malloc checker.
 const Stmt *
 MacOSKeychainAPIChecker::getAllocationSite(const ExplodedNode *N,
@@ -602,55 +576,6 @@

   // Generate the new, cleaned up state.
   C.addTransition(State, N);
-}
-
-// TODO: Remove this after we ensure that checkDeadSymbols are always called.
-void MacOSKeychainAPIChecker::checkEndPath(CheckerContext &C) const {
-  ProgramStateRef state = C.getState();
-
-  // If inside inlined call, skip it.
-  if (C.getLocationContext()->getParent() != 0)
-    return;
-
-  AllocatedDataTy AS = state->get<AllocatedData>();
-  if (AS.isEmpty())
-    return;
-
-  // Anything which has been allocated but not freed (nor escaped) will be
-  // found here, so report it.
-  bool Changed = false;
-  AllocationPairVec Errors;
-  for (AllocatedDataTy::iterator I = AS.begin(), E = AS.end(); I != E; ++I ) {
-    Changed = true;
-    state = state->remove<AllocatedData>(I->first);
-    // If the allocated symbol is null or if error code was returned at
-    // allocation, do not report.
-    ConstraintManager &CMgr = state->getConstraintManager();
-    ConditionTruthVal AllocFailed = CMgr.isNull(state, I.getKey());
-    if (AllocFailed.isConstrainedTrue() ||
-        definitelyReturnedError(I->second.Region, state,
-                                C.getSValBuilder())) {
-      continue;
-    }
-    Errors.push_back(std::make_pair(I->first, &I->second));
-  }
-
-  // If no change, do not generate a new state.
-  if (!Changed) {
-    C.addTransition(state);
-    return;
-  }
-
-  static SimpleProgramPointTag Tag("MacOSKeychainAPIChecker : EndPathLeak");
-  ExplodedNode *N = C.addTransition(C.getState(), C.getPredecessor(), &Tag);
-
-  // Generate the error reports.
-  for (AllocationPairVec::iterator I = Errors.begin(), E = Errors.end();
-                                                       I != E; ++I) {
-    C.emitReport(generateAllocatedDataNotReleasedReport(*I, N, C));
-  }
-
-  C.addTransition(state, N);
 }


Load some PWG4 and PWG3muon libraries needed to read the AOD from the Analysis Train

--- PWG3/vertexingHF/LoadLibraries.C
+++ PWG3/vertexingHF/LoadLibraries.C
@@ -12,6 +12,13 @@
   gSystem->Load("libCORRFW.so");
   gSystem->Load("libPWG3base.so");
   gSystem->Load("libPWG3vertexingHF.so");
+  if(!useParFiles) {
+    gSystem->Load("libJETAN");
+    gSystem->Load("libPWG3base");
+    gSystem->Load("libPWG3muon");
+    gSystem->Load("libPWG4PartCorrBase");
+    gSystem->Load("libPWG4PartCorrDep");
+  }

   if(useParFiles) {
     setupPar("STEERBase");
@@ -70,4 +77,4 @@
     gSystem->ChangeDirectory(ocwd.Data());
   }
   return 1;
-}+}


[Hexagon] Other attempt to fix build with enabled asserts broken in 290024 (NFC).

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@290028 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
+++ lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//

+#include "Hexagon.h"
 #include "HexagonTargetStreamer.h"
 #include "MCTargetDesc/HexagonInstPrinter.h"
 #include "MCTargetDesc/HexagonMCAsmInfo.h"


Add missing semicolon

Add missing semicolon

--- hypno_eye.cpp
+++ hypno_eye.cpp
@@ -71,7 +71,7 @@
 void HypnoEye::rotateCCW(uint8_t steps) {
 	if (rotation < steps) {
 		steps -= rotation;
-		rotation = OUTER_LEDS - (steps % OUTER_LEDS)
+		rotation = OUTER_LEDS - (steps % OUTER_LEDS);
 	} else {
 		rotation -= steps;
 	}


Fixed a bug in RandStateSystemTest with main, allocating wrong size for cl_argv

git-svn-id: 173bfced7225b0a4144fa0e9d72f2fb8f54e5b79@9999 7c0444ca-5550-0410-9008-faecdbe78eb5

--- RandStateSystemTest/src/main.cpp
+++ RandStateSystemTest/src/main.cpp
@@ -33,7 +33,7 @@
    }

    int cl_argc = argc + 2;
-   char ** cl_argv = (char **) calloc(sizeof(cl_argc+1),sizeof(char *));
+   char ** cl_argv = (char **) calloc(cl_argc+1,sizeof(char *));
    assert(cl_argv);
    for (int k=0; k<argc; k++) {
       cl_argv[k] = strdup(argv[k]);


[C bindings] Test auto for map and list serialisation added

Change-Id: I38697d5f81a19ba42bc9b4d6d8b61bcaed700f3a
Reviewed-on: http://gerrit.aldebaran.lan:8080/4555
Reviewed-by: proullon <ffff9135679d397f48dd743107119b1f6fc32d3d@aldebaran-robotics.com>
Tested-by: proullon <ffff9135679d397f48dd743107119b1f6fc32d3d@aldebaran-robotics.com>

--- libqimessaging/tests/test_c_bindings/test_c_message.cpp
+++ libqimessaging/tests/test_c_bindings/test_c_message.cpp
@@ -7,7 +7,23 @@

 #include <qimessaging/c/api_c.h>
 #include <qimessaging/c/qi_c.h>
+#include <qimessaging/datastream.hpp>
+#include <c/src/message_c_p.h>
 #include <gtest/gtest.h>
+
+qi::IDataStream &get_is(qi_message_data_t *m)
+{
+  if (!m->is)
+    m->is = new qi::IDataStream(*m->buff);
+  return *(m->is);
+}
+
+qi::ODataStream &get_os(qi_message_data_t *m)
+{
+  if (!m->os)
+    m->os = new qi::ODataStream(*m->buff);
+  return *(m->os);
+}

 TEST(TestMessage, SimpleOperation)
 {
@@ -100,22 +116,91 @@
   data = qi_message_read_raw(m, &size);
   memcpy(&magic, data, 4);
   ASSERT_EQ(0x42DEAD42, magic);
-  ASSERT_EQ(4, size);
+  ASSERT_EQ((unsigned int) 4, size);

   qi_message_destroy(m);
 }

 TEST(TestMessage, TestList)
 {
-  ASSERT_TRUE(false);
-}
-
-TEST(TestMessage, TestTuple)
-{
-  ASSERT_TRUE(false);
+  std::list<int> value;
+  std::list<int>::iterator it, it2;
+
+  qi_message_t* m= qi_message_create();
+
+  value.push_back(1);
+  value.push_back(2);
+  value.push_back(3);
+  value.push_back(4);
+  value.push_back(5);
+
+  get_os((qi_message_data_t*) m) << value;
+  // Our buffer travel around...
+
+  // Toh ! a C client :
+  // Get list back
+  std::list<int> mirror;
+  unsigned int i = 0;
+  unsigned int size = qi_message_read_list_size(m);
+  ASSERT_EQ(value.size(), size);
+
+  while (i < size)
+  {
+    mirror.push_back(qi_message_read_int32(m));
+    i++;
+  }
+
+  // Compare
+  ASSERT_EQ(value.size(), mirror.size());
+  it2 = mirror.begin();
+  for (it = value.begin(); it != value.end(); ++it)
+  {
+    ASSERT_EQ(*it, *it2);
+    ASSERT_TRUE(it2 != mirror.end());
+    ++it2;
+  }
+
+  qi_message_destroy(m);
 }

 TEST(TestMessage, TestMap)
 {
-  ASSERT_TRUE(false);
-}
+  std::map<std::string, int> value;
+  std::map<std::string, int>::iterator it, it2;
+
+  qi_message_t* m= qi_message_create();
+
+  value["Foo"] = 0;
+  value["Bar"] = 1;
+  value["Cham"] = 2;
+  value["Pion"] = 3;
+
+  get_os((qi_message_data_t *) m) << value;
+
+  // Our buffer travel around...
+
+  // Toh ! a C client :
+  // Get list back
+  std::map<std::string, int> mirror;
+  unsigned int i = 0;
+  unsigned int size = qi_message_read_list_size(m);
+  ASSERT_EQ(value.size(), size);
+
+  while (i < size)
+  {
+    mirror[qi_message_read_string(m)] = qi_message_read_int32(m);
+    i++;
+  }
+
+  // Compare
+  ASSERT_EQ(value.size(), mirror.size());
+  it2 = mirror.begin();
+  for (it = value.begin(); it != value.end(); ++it)
+  {
+    ASSERT_EQ(*it, *it2);
+    ASSERT_TRUE(it2 != mirror.end());
+    ++it2;
+  }
+
+  qi_message_destroy(m);
+}