Force VfW mode for H.264 if the avcC atom is missing

git-svn-id: d8f21eb7283bfb39ebab2f8f9b4a259b233f9348@692 621663c8-3916-0410-8f58-edc14a8543d5

--- MatroskaCodecIDs.cpp
+++ MatroskaCodecIDs.cpp
@@ -41,8 +41,11 @@

 	if (dir == kToSampleDescription) {
 		KaxCodecPrivate *codecPrivate = FindChild<KaxCodecPrivate>(*tr_entry);
-		if (codecPrivate == NULL)
+		if (codecPrivate == NULL) {
+			// technically invalid file, assume that the h.264 is in VfW format (no pts, etc).
+			(*desc)->dataFormat = 'H264';
 			return noErr;
+		}

 		Handle imgDescExt = NewHandle(codecPrivate->GetSize());
 		memcpy(*imgDescExt, codecPrivate->GetBuffer(), codecPrivate->GetSize());


stuff

stuff

--- src/morda/widgets/core/Widget.hpp
+++ src/morda/widgets/core/Widget.hpp
@@ -402,7 +402,7 @@

 	/**
 	 * @brief Handle keyboard key event.
-	 * This method is called by framework when a widget is requested to handle a key event. So, the widget is either a focused widget or root widet.
+	 * This method is called by framework when a widget is requested to handle a key event. So, the widget is either a focused widget or root widget.
 	 * @param isDown - was the key pressed (true) or released (false).
 	 * @param keyCode - keyboard key code.
 	 * @return true to consume event and prevent its further propagation.


alloc_failure_injector: Log backtrace of failures

Useful when debugging incorrect behavior triggered by injected failures.

--- util/alloc_failure_injector.cc
+++ util/alloc_failure_injector.cc
@@ -20,15 +20,22 @@
  */

 #include "util/alloc_failure_injector.hh"
+#include "util/backtrace.hh"
+#include "util/log.hh"

 namespace seastar {
 namespace memory {
+
+static logger log("failure_injector");

 thread_local alloc_failure_injector the_alloc_failure_injector;

 void alloc_failure_injector::fail() {
     _failed = true;
     cancel();
+    if (log.is_enabled(log_level::trace)) {
+        log.trace("Failing at {}", current_backtrace());
+    }
     _on_alloc_failure();
 }


Documentation fix.

Documentation fix.

--- src/multimedia/qmediarecorder.cpp
+++ src/multimedia/qmediarecorder.cpp
@@ -331,8 +331,7 @@
 }

 /*!
-    Returns a list of resolutions video can be encoded at.  An empty list is returned if the video
-    encoder supports arbitrary resolutions within the minimum and maximum range.
+    Returns a list of resolutions video can be encoded at.

     If non null video \a settings parameter is passed,
     the returned list is reduced to resolution supported with partial settings like video codec or framerate applied.


Raise IOError on pos < 0 in hdfs_file.seek, like a Python file

--- src/native_core_hdfs/hdfs_file.cc
+++ src/native_core_hdfs/hdfs_file.cc
@@ -321,6 +321,14 @@
     if (! PyArg_ParseTuple(args, "n", &position))
         return NULL;

+    if (position < 0) {
+        // raise an IOError like a regular python file
+        errno = EINVAL;
+        PyErr_SetFromErrno(PyExc_IOError);
+        errno = 0;
+        return NULL;
+    }
+
     int result = hdfsSeek(self->fs, self->file, position);
     return Py_BuildValue("i", result);
 }


Fixed bug with newer visual studio compiler

--- Compiler/Nigel/HelperDefinitions.cpp
+++ Compiler/Nigel/HelperDefinitions.cpp
@@ -33,7 +33,7 @@

-	#if (_MSC_VER == 1900 || _MSC_VER == 1910) //bug-workaround (VC_2015)
+	#if (_MSC_VER >= 1900 && _MSC_VER <= 1911) //bug-workaround (VC_2015+)

 		String8 to_utf8( const String16 &str )
 		{


Jsonbuffersize definition added

Jsonbuffersize definition added

--- Connecting_to_phone/PacmanServer.cpp
+++ Connecting_to_phone/PacmanServer.cpp
@@ -22,7 +22,9 @@
 		httpCode = http.POST(message);
 	} while (httpCode != HTTP_CODE_OK);

-	DynamicJsonBuffer jsonBuffer;
+
+	const size_t bufferSize = JSON_ARRAY_SIZE(4) + JSON_ARRAY_SIZE(62) + 66*JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(3) + 1180;
+	DynamicJsonBuffer jsonBuffer(bufferSize);
 	String registrationResponse = http.getString();
 	http.end();


Fix windows build after r24191.

Fix windows build after r24191.

TBR=titzer@chromium.org

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

git-svn-id: f98b9d40cb02301bc76fa9e1b46ee668158567fd@24197 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

--- test/cctest/compiler/test-representation-change.cc
+++ test/cctest/compiler/test-representation-change.cc
@@ -273,7 +273,7 @@
       Node* n = r.jsgraph()->Int32Constant(*i);
       Node* c = r.changer()->GetRepresentationFor(n, kRepWord32 | kTypeInt32,
                                                   kRepFloat32);
-      r.CheckFloat32Constant(c, *i);
+      r.CheckFloat32Constant(c, static_cast<float>(*i));
     }
   }

@@ -283,7 +283,7 @@
       Node* n = r.jsgraph()->Int32Constant(*i);
       Node* c = r.changer()->GetRepresentationFor(n, kRepWord32 | kTypeUint32,
                                                   kRepFloat32);
-      r.CheckFloat32Constant(c, *i);
+      r.CheckFloat32Constant(c, static_cast<float>(*i));
     }
   }
 }
@@ -304,7 +304,7 @@
   {
     FOR_INT32_INPUTS(i) {
       if (!IsFloat32Int32(*i)) continue;
-      Node* n = r.jsgraph()->Float32Constant(*i);
+      Node* n = r.jsgraph()->Float32Constant(static_cast<float>(*i));
       Node* c = r.changer()->GetRepresentationFor(n, kRepFloat32 | kTypeInt32,
                                                   kRepWord32);
       r.CheckInt32Constant(c, *i);
@@ -346,7 +346,7 @@
   {
     FOR_UINT32_INPUTS(i) {
       if (!IsFloat32Uint32(*i)) continue;
-      Node* n = r.jsgraph()->Float32Constant(*i);
+      Node* n = r.jsgraph()->Float32Constant(static_cast<float>(*i));
       Node* c = r.changer()->GetRepresentationFor(n, kRepFloat32 | kTypeUint32,
                                                   kRepWord32);
       r.CheckUint32Constant(c, *i);


[Tests]lock vector to avoid potential flaky test (#9656)

--- src/ray/gcs/pubsub/test/gcs_pub_sub_test.cc
+++ src/ray/gcs/pubsub/test/gcs_pub_sub_test.cc
@@ -58,7 +58,8 @@
                  std::vector<std::string> &result) {
     std::promise<bool> promise;
     auto done = [&promise](const Status &status) { promise.set_value(status.ok()); };
-    auto subscribe = [&result](const std::string &id, const std::string &data) {
+    auto subscribe = [this, &result](const std::string &id, const std::string &data) {
+      absl::MutexLock lock(&vector_mutex_);
       result.push_back(data);
     };
     RAY_CHECK_OK((pub_sub_->Subscribe(channel, id, subscribe, done)));
@@ -69,7 +70,8 @@
                     std::vector<std::pair<std::string, std::string>> &result) {
     std::promise<bool> promise;
     auto done = [&promise](const Status &status) { promise.set_value(status.ok()); };
-    auto subscribe = [&result](const std::string &id, const std::string &data) {
+    auto subscribe = [this, &result](const std::string &id, const std::string &data) {
+      absl::MutexLock lock(&vector_mutex_);
       result.push_back(std::make_pair(id, data));
     };
     RAY_CHECK_OK((pub_sub_->SubscribeAll(channel, subscribe, done)));
@@ -95,7 +97,8 @@

   template <typename Data>
   void WaitPendingDone(const std::vector<Data> &data, int expected_count) {
-    auto condition = [&data, expected_count]() {
+    auto condition = [this, &data, expected_count]() {
+      absl::MutexLock lock(&vector_mutex_);
       RAY_CHECK((int)data.size() <= expected_count)
           << "Expected " << expected_count << " data " << data.size();
       return (int)data.size() == expected_count;
@@ -106,6 +109,7 @@
   std::shared_ptr<gcs::RedisClient> client_;
   const std::chrono::milliseconds timeout_ms_{60000};
   std::shared_ptr<gcs::GcsPubSub> pub_sub_;
+  absl::Mutex vector_mutex_;

  private:
   boost::asio::io_service io_service_;
@@ -226,6 +230,7 @@
     auto subscribe = [this, channel, &result](const std::string &id,
                                               const std::string &data) {
       RAY_CHECK_OK(pub_sub_->Unsubscribe(channel, id));
+      absl::MutexLock lock(&vector_mutex_);
       result.push_back(data);
     };
     RAY_CHECK_OK((pub_sub_->Subscribe(channel, object_id.Hex(), subscribe, done)));


Added new function to avoid problems with degenerate triangles

--- Cpp/Simulation/ODECustomGeometry.cpp
+++ Cpp/Simulation/ODECustomGeometry.cpp
@@ -398,7 +398,16 @@
     tri2loc.b = T21*tri2.b;
     tri2loc.c = T21*tri2.c;
     Segment3D s;
-    if(tri2loc.intersects(tri1,s)) {
+    //this is here to avoid degenerate triangles
+    bool collides;
+    Vector3 n1,n2;
+    n1.setCross(tri1.b-tri1.a,tri1.c-tri1.a);
+    n2.setCross(tri2.b-tri2.a,tri2.c-tri2.a);
+    if(n2.normSquared() > n1.normSquared())
+      collides = tri2loc.intersects(tri1,s);
+    else
+      collides = tri1.intersects(tri2loc,s);
+    if(collides) {
       gCustomGeometryMeshesIntersect = true;
       if(warnedCount % 1000 == 0) {
 	printf("ODECustomMesh: Triangles penetrate margin %g+%g: can't trust contact detector\n",outerMargin1,outerMargin2);


look for textures in more places

look for textures in more places

--- src/renderer/editor/import_asset_dialog.cpp
+++ src/renderer/editor/import_asset_dialog.cpp
@@ -350,6 +350,13 @@
 					tex.src = src_dir;
 					tex.src << file_info.m_basename << "." << file_info.m_extension;
 					tex.is_valid = PlatformInterface::fileExists(tex.src);
+
+					if (!tex.is_valid)
+					{
+						tex.src = src_dir;
+						tex.src << tex.path;
+						tex.is_valid = PlatformInterface::fileExists(tex.src);
+					}
 				}

 				tex.import = true;


Fix copy-and-paste error in exception message.

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

--- utils/TableGen/NeonEmitter.cpp
+++ utils/TableGen/NeonEmitter.cpp
@@ -89,7 +89,7 @@
       return 'i';
     case 'f':
       return 'h';
-    default: throw "unhandled type in widen!";
+    default: throw "unhandled type in narrow!";
   }
   return '\0';
 }


linking nodes and collections

linking nodes and collections

--- src/runtime/collections/CollectionsImpl.cpp
+++ src/runtime/collections/CollectionsImpl.cpp
@@ -777,15 +777,15 @@
                                                              xqp_string()).getStore();

     GENV_ITEMFACTORY->createAnyURI(catalogResolvedUriItem, catalogResolvedUriString);
-    }
-    catch (error::ZorbaError& e)
-    {
-      ZORBA_ERROR_LOC_DESC(FODC0005, loc, e.theDescription);
-    }
+  }
+  catch (error::ZorbaError& e)
+  {
+    ZORBA_ERROR_LOC_DESC(FODC0005, loc, e.theDescription);
+  }

   // Load the catalog document, if it has not been loaded before
-    try
-    {
+  try
+  {
     catalogRootNode = GENV_STORE.getDocument(catalogResolvedUriString);

     if (catalogRootNode == NULL)
@@ -797,10 +797,10 @@
                                 false);
     }
   }
-    catch (error::ZorbaError& e)
-    {
-      ZORBA_ERROR_LOC_DESC(e.theErrorCode, loc, e.theDescription);
-    }
+  catch (error::ZorbaError& e)
+  {
+    ZORBA_ERROR_LOC_DESC(e.theErrorCode, loc, e.theDescription);
+  }

   // Navigate the catalog doc to extract the uri of each data doc and then, if
   // the data doc is not loaded already, create a collection for it, load the
@@ -831,7 +831,7 @@
             {
               if (catalogAttr->getStringValue()->indexOf("/") == -1)
                 docURI = URI(catalogURI, catalogAttr->getStringValue().getp());
-            else
+              else
                 docURI = URI(catalogAttr->getStringValue().getp());

               docUriString = docURI.toString().getStore();
@@ -845,15 +845,15 @@
               ZORBA_ERROR_LOC_DESC(FODC0005, loc, e.theDescription);
             }

-              try
-              {
+            try
+            {
               theColl = theSctx->get_collection_uri_resolver()->
                         resolve(docResolvedUriItem, theSctx);

               if (theColl == NULL)
               {
                 theColl = GENV_STORE.createCollection(docResolvedUriString);
-
+
                 docRootNode = GENV_STORE.getDocument(docResolvedUriString);

                 if (docRootNode == NULL)
@@ -862,26 +862,26 @@
                                 resolve(docResolvedUriItem, theSctx, false, false);

                   theColl->addNode(docRootNode, 1);
-              }
+                }
                 else
-              {
+                {
                   store::CopyMode lCopyMode;
                   copyNode = docRootNode->copy(NULL, NULL, lCopyMode);
                   theColl->addNode(copyNode, 1);
-              }
+                }
               }
             }
-              catch (error::ZorbaError& e)
-              {
-                ZORBA_ERROR_LOC_DESC(e.theErrorCode, loc, e.theDescription);
-              }
+            catch (error::ZorbaError& e)
+            {
+              ZORBA_ERROR_LOC_DESC(e.theErrorCode, loc, e.theDescription);
             }
           }
+        }
         attributesIte->close();
-        }
       }
+    }
     childrenIte->close();
-    }
+  }

   STACK_END (state);
 }


typo in a comment

typo in a comment

--- src/octomap_path_planner_node.cpp
+++ src/octomap_path_planner_node.cpp
@@ -548,7 +548,7 @@
             pow(goal_.pose.orientation.y, 2) +
             pow(goal_.pose.orientation.z, 2);

-    // if so, we never have position error:
+    // if so, we never have an orientation error:
     if(qnorm < 1e-5) return 0;

     // "Robotica - Modellistica Pianificazione e Controllo" eq. 3.88


added clFlush after enqueue

added clFlush after enqueue

Solves a problem with amd graphic cards.

--- src/opencl/command_dispatcher.cpp
+++ src/opencl/command_dispatcher.cpp
@@ -75,6 +75,12 @@
                     cl_command_queue cmd_q =
                             m_parent->m_devices.front().cmd_queue.get();
                     job->enqueue(cmd_q);
+                    cl_int err{clFlush(cmd_q)};
+                    if (err != CL_SUCCESS) {
+                        throw runtime_error("[!!!] clFlush: '"
+                                                 + get_opencl_error(err)
+                                                 + "'.");
+                    }
                 }
                 catch (exception& e) {
                     cerr << e.what() << endl;


Restore previous default shared name

Restore previous default shared name

--- src/overpass_api/core/settings.cc
+++ src/overpass_api/core/settings.cc
@@ -94,7 +94,7 @@

   base_directory("./"),
   logfile_name("transactions.log"),
-  shared_name_base("/osm3s_v0.7.59"),
+  shared_name_base("/osm3s_v0.7.59_mmd"),
   shared_name_suffix(get_shared_name_suffix()),
   version("0.7.59_mmd"),
   source_hash(GIT_VERSION),
@@ -114,7 +114,7 @@
   if (suffix_c != nullptr)
     return "_" + std::string(suffix_c);

-  return "_mmd";
+  return "";
 }


Remove redundant Q_ASSERT from qmlvisual autotest.

Change-Id: I5c413793ee6322b5be1ae52658362803dc4c2010
Task-number: QTBUG-17582
Reviewed-by: Alan Alpert
(cherry picked from commit d6bd4db2db6dbefec327e226bf54a69a20690a45)

--- tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
+++ tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
@@ -240,8 +240,6 @@

 void action(Mode mode, const QString &file)
 {
-    Q_ASSERT(mode != Test);
-
     QString testdata = tst_qmlvisual::toTestScript(file,mode);

     QStringList arguments;


qqmldebugclient.cpp: Fix warning about missing return.

In file included from ../shared/qqmldebugclient.cpp:473:0:
../shared/qqmldebugclient.cpp: In member function
'QString QQmlDebugClient::stateString() const':
../shared/qqmldebugclient.cpp:452:1: warning: control reaches end of
non-void function

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

--- tests/auto/qml/debugger/shared/qqmldebugclient.cpp
+++ tests/auto/qml/debugger/shared/qqmldebugclient.cpp
@@ -449,6 +449,7 @@
     case Unavailable: return QLatin1String("Unavailable");
     case Enabled: return QLatin1String("Enabled");
     }
+    return QLatin1String("Invalid");
 }

 void QQmlDebugClient::sendMessage(const QByteArray &message)


move local type to global scope

move local type to global scope

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

--- src/paintown-engine/game/game.cpp
+++ src/paintown-engine/game/game.cpp
@@ -698,6 +698,16 @@
     }
 }

+struct GameData{
+    GameData(vector<Paintown::Object*> players, const Filesystem::AbsolutePath & path):
+        world(players, path),
+        players(players){
+        }
+
+    AdventureWorld world;
+    vector<Paintown::Object*> players;
+};
+
 static void realGame(const vector<Util::Future<Paintown::Object*> * > & futurePlayers, const Level::LevelInfo & levelInfo, const string & level){

     class GameContext: public Loader::LoadingContext {
@@ -728,7 +738,7 @@
                     Util::Future<Paintown::Object*> * future = *fit;
                     players.push_back(future->get());
                 }
-                data = new Data(players, Filesystem::find(path));
+                data = new GameData(players, Filesystem::find(path));
             } catch (const LoadException & exception){
                 failed = new LoadException(exception);
             }
@@ -748,17 +758,7 @@
             return data->players;
         }

-        struct Data{
-            Data(vector<Paintown::Object*> players, const Filesystem::AbsolutePath & path):
-                world(players, path),
-                players(players){
-                }
-
-            AdventureWorld world;
-            vector<Paintown::Object*> players;
-        };
-
-        Util::ReferenceCount<Data> data;
+        Util::ReferenceCount<GameData> data;
         vector<Util::Future<Paintown::Object*> * > futurePlayers;
         Filesystem::RelativePath path;
         Util::ReferenceCount<LoadException> failed;


two-way merge on createDictOMPRecursive

two-way merge on createDictOMPRecursive

--- src/paths/long/BuildReadQGraph.cc
+++ src/paths/long/BuildReadQGraph.cc
@@ -287,7 +287,7 @@
             for ( BRQ_Entry const& entry : hhs )
                     if ( entry.getKDef().isNull() )
                         eb.buildEdge(entry);
-
+

         size_t nRegularEdges = pEdges->size();
         size_t nTotalLength = pEdges->SizeSum();
@@ -966,12 +966,28 @@
         #pragma omp task shared(reads,quals,entries2)
         { entries2 = createDictOMPRecursive(NULL, reads, quals, mid_point, to, batch_size, minQual, minFreq); }
         #pragma omp taskwait
-        kmer_list = entries1;
         kmer_list.reserve(entries1.size() + entries2.size());
+        auto end1=entries1.end(),end2=entries2.end();
+        auto itr1=entries1.begin(),itr2=entries2.begin();
+        while (itr1<end1 and itr2<end2){
+            if (*itr1==*itr2){
+                kmer_list.push_back(*itr1);
+                combine_Entries(kmer_list.back(),*itr2);
+                ++itr1;
+                ++itr2;
+            } else if (*itr1<*itr2){
+                kmer_list.push_back(*itr1);
+                ++itr1;
+            } else {
+                kmer_list.push_back(*itr2);
+                ++itr2;
+            }
+        }
+        while (itr1<end1) kmer_list.push_back(*itr1++);
+        while (itr2<end2) kmer_list.push_back(*itr2++);
+
         entries1.clear();
-        kmer_list.insert(kmer_list.end(),entries2.begin(),entries2.end());
         entries2.clear();
-

     } else { //just do the kmer creation and sort/collapse
         //#pragma omp critical
@@ -1000,14 +1016,15 @@

             }
         }
+        std::sort(kmer_list.begin(), kmer_list.end());
+        collapse_entries(kmer_list);
     }
     //sort
     //#pragma omp critical
     //std::cout << "createDictOMPRecursive (thread "<<omp_get_thread_num()<<") from " << from << " to " << to << ", sorting/collapsing "<<kmer_list.size()<<" kmers ..."
     //          << std::endl;

-    std::sort(kmer_list.begin(), kmer_list.end());
-    collapse_entries(kmer_list);
+
     if (NULL != dict) { //merge sort and return that
         (*dict) = new BRQ_Dict(kmer_list.size());
         uint64_t used = 0,not_used=0;


Don't free this tone curve

Don't free this tone curve

It will get freed by lcms when the profile is closed.

--- src/photoshop/SuperPNG_Output.cpp
+++ src/photoshop/SuperPNG_Output.cpp
@@ -372,8 +372,6 @@
 								}
 							}
 						}
-
-						cmsFreeToneCurve(gammaTable);
 					}
 				}


#23996 Try again on SCARD_W_UNRESPONSIVE_CARD error

--- SCError.cpp
+++ SCError.cpp
@@ -68,7 +68,7 @@
     else if((int)err == SCARD_W_UNRESPONSIVE_CARD)
     {
         SCardLog::writeMessage("[%i:%i][%s:%d] SCARD_W_UNRESPONSIVE_CARD", cid, tid, __FUNC__, __LINE__, err);
-        throw NoCardInReaderError();
+        throw CardResetError();
     }
     else if((int)err == SCARD_E_NO_READERS_AVAILABLE)
     {


fix compile warning

fix compile warning

--- SM_Test.inl
+++ SM_Test.inl
@@ -40,8 +40,8 @@
 	bool odd_nodes = false;
 	for (int i = 0, n = area.size(), j = n - 1; i < n; ++i)
 	{
-		if ((area[i].y < v.y && area[j].y >= v.y ||
-			 area[j].y < v.y && area[i].y >= v.y) &&
+		if (((area[i].y < v.y && area[j].y >= v.y) ||
+			 (area[j].y < v.y && area[i].y >= v.y)) &&
 			(area[i].x <= v.x || area[j].x <= v.x))
 		{
 			odd_nodes ^= (area[i].x + (v.y - area[i].y) / (area[j].y - area[i].y) * (area[j].x - area[i].x) < v.x);


Blocking write seems to actually write, and not defer till later

--- Strategy.cc
+++ Strategy.cc
@@ -31,12 +31,7 @@
   buf = new cl::Buffer(*c, CL_MEM_READ_WRITE, size, nullptr, &err);
   CHECKERR

-  /**
-   * TODO: check if blocking read does this correctly itself
-   */
-  cl::Event event;
-  err = queue->enqueueWriteBuffer(*buf, CL_FALSE, 0, size, l->data, 0, &event);
-  event.wait();
+  err = queue->enqueueWriteBuffer(*buf, CL_TRUE, 0, size, l->data);
 }

 void GPUNeighbourPropagation::execute() {


fixed undead zombies (& others)

fixed undead zombies (& others)

--- src/game/sys/state/state_comp.cpp
+++ src/game/sys/state/state_comp.cpp
@@ -88,6 +88,9 @@
 				case Entity_state::dying:
 					return Entity_state::dead;

+				case Entity_state::dead:
+					return Entity_state::dead;
+
 				default:
 					return Entity_state::idle;
 			}


virtual destructor

virtual destructor

--- src/generator/litesql-gen-cpp.cpp
+++ src/generator/litesql-gen-cpp.cpp
@@ -157,8 +157,9 @@
     assign.body(o.inherits + "::operator=(obj);");
     assign.body("return *this;");

-
-    cl.method(cons1).method(cons2).method(cons3).method(assign);
+    Method dest("~" + o.name);
+    dest.virtual_();
+    cl.method(cons1).method(cons2).method(cons3).method(dest).method(assign);

 }
 void writeObjRelationHandles(Class& cl, xml::Object& o) {


[Parser] Auto-adds types again

[Parser] Auto-adds types again

--- src/occaParserStatement.cpp
+++ src/occaParserStatement.cpp
@@ -317,8 +317,6 @@
       initLoadFromNode(nodeRoot);
       initOrganization();

-      print();
-
       if(sInfo->type & declareStatementType)
         splitDeclareStatement();

@@ -338,8 +336,6 @@

       else
         organize();
-
-      print();
     }

     void expNode::organize(){
@@ -480,10 +476,10 @@

       typeInfo &type = newExp.addTypeInfoNode(0);

+      int leafPos = type.loadFrom(*this, 0);
+
       if(addTypesToScope)
-        sInfo->addType(type);
-
-      int leafPos = type.loadFrom(*this, 0);
+        sInfo->up->addType(type);

       expNode::swap(*this, newExp);
     }
@@ -1674,10 +1670,39 @@
       }

       case (expType::variable):{
-        if(leafCount)
-          out << tab << leaves[0]->value;
-        else
+        // [[[const] [int] [*]] [x]]
+        if(leafCount){
+          const bool hasLQualifier = (leaves[0]->info & (expType::qualifier |
+                                                         expType::type));
+
+          const bool hasRQualifier = (((hasLQualifier + 1) < leafCount) &&
+                                      (leaves[hasLQualifier + 1]->info & (expType::qualifier |
+                                                                          expType::type)));
+
+          if(hasLQualifier){
+            out << *(leaves[0]);
+
+            if((leaves[0]->info & expType::qualifier) ||
+               ((leaves[0]->leafCount) &&
+                (leaves[0]->lastLeaf()->info & expType::qualifier))){
+
+              out << ' ';
+            }
+          }
+
+          out << *(leaves[hasLQualifier]);
+
+          if(hasRQualifier){
+            if( !(leaves[hasLQualifier + 1]->hasAnArrayQualifier()) )
+              out << ' ';
+
+            out << *(leaves[hasLQualifier + 1]);
+          }
+        }
+        // [x]
+        else{
           out << value;
+        }

         break;
       }


unique listener thread name

unique listener thread name

--- src/detection_win.cpp
+++ src/detection_win.cpp
@@ -264,7 +264,7 @@
 DWORD WINAPI ListenerThread( LPVOID lpParam )
 {

-    const char *className = "ListnerThread";
+    const char *className = "ListnerThreadUsbDetection";

     WNDCLASSA wincl = {0};
     wincl.hInstance = GetModuleHandle(0);


CSE333: FileReader done

CSE333: FileReader done

--- uw_cse333/hw/hw4/FileReader.cc
+++ uw_cse333/hw/hw4/FileReader.cc
@@ -54,8 +54,10 @@

   HWSize_t size;
   std::unique_ptr<char, MallocDeleter<char> > ptr { ::ReadFile(fullfile.c_str(), &size) };
+
+  if (ptr.get() == nullptr) return false;
+
   *str = std::string(ptr.get(), size);
-
   return true;
 }


Remove [[maybe_unused]] workaround in MetalCodeGen.

This effectively rolls back http://review.skia.org/538045.

Change-Id: I9c457a6c9c9ba98d4c2e3a6af03c5dd80c76beb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540082
Auto-Submit: John Stiles <f4fcf42d3bb5924557f1eeb3be66747535e585da@google.com>
Commit-Queue: John Stiles <f4fcf42d3bb5924557f1eeb3be66747535e585da@google.com>
Reviewed-by: Brian Osman <794c0b5534edf5601d88e1d41975d0262da12894@google.com>

--- src/sksl/codegen/SkSLMetalCodeGenerator.cpp
+++ src/sksl/codegen/SkSLMetalCodeGenerator.cpp
@@ -2148,16 +2148,6 @@
 }

 void MetalCodeGenerator::writeVarDeclaration(const VarDeclaration& varDecl) {
-    // The graphite shaders include functions with `switch` statements using named constant labels.
-    // When called with known values, the switch is eliminated. This leaves unused variables like:
-    //   const int kFoo = ...;
-    // All of these happen to be `const int`. As a hack, mark any `const int` as maybe_unused, to
-    // suppress warnings from the metal compiler when validation is enabled.
-    if ((varDecl.var().modifiers().fFlags & Modifiers::kConst_Flag) &&
-        varDecl.var().type().matches(*fContext.fTypes.fInt)) {
-        this->write("[[maybe_unused]] ");
-    }
-
     this->writeModifiers(varDecl.var().modifiers());
     this->writeType(varDecl.var().type());
     this->write(" ");


Повна версія проги...

Повна версія проги...

--- project.cpp
+++ project.cpp
@@ -1,10 +1,15 @@
-#include "glut.h"
+#include "gl/glut.h"
 #include <cmath>
 #include <GL/gl.h>
 #include <GL/glu.h>
 #include <cmath>
 #include <math.h>

+
+bool liana_hit = false;
+float ly=0;
+float dly=0;
+bool ball_hit = false;
 float drx2=0.5;
 float drx=0.5;
 float dry=0.5;
@@ -21,18 +26,22 @@
 float gfPosY2= 180;
 float gfPosY3=-270;
 float gfPosX3=-550;
-float gfDeltaY=0.5;
-float gfDeltaY2=0.5;
+float gfDeltaY=3;
+float gfDeltaY2=3;
 float gfDeltaX3=0.3;
 float gfDeltaY3=0.2;
+float gfPosX5= 480;// (kusok perekladiny)
+float gfDeltaX5=1; // (kusok perekladiny)
+float gfPosY5= -459;// (kusok perekladiny)
+float gfDeltaY5=1.5; // (kusok perekladiny)
 float gfRotZ= 0;
-float gfDeltaZ=0.05;
+float gfDeltaZ=0.5;
 float gfx=285;
-float mrt=3; //kyt
+float mrt=13; //kyt
 float gfPyshkaX=185;
 float gfPyshkaY=44;
-float gfDeltaX1=cos(mrt*0.017);
-float gfDeltaY1=sin(mrt*0.017);
+float gfDeltaX1=cos(mrt*0.017)*5.2;
+float gfDeltaY1=sin(mrt*0.017)*5.2;
 float gfDeltaX4=-cos(mrt*0.017); //zmichenn9 v livo garmatu
 float gfPyshkaX1;
 float gfDeltaY4=sin(mrt*0.017); //zmichenn9 v livo garmatu
@@ -41,9 +50,9 @@
 float gfkytpovoroty=0;
 float gfdeltakytpovoroty=0.05;
 float gfPosX= 0;
-float gfDeltaX=0.15;
+float gfDeltaX=0.0;
 float angle1=80;
-float deltaangle=0.2;
+float deltaangle=0;
 float gfrombPosX= 75;
 float ZnachenX=0;

@@ -68,10 +77,11 @@
  {

  //jadro
-
+  if (!ball_hit && !liana_hit) {
  glColor3f(0.0, 0.0, 0.0);
  drawCircle( gfPyshkaX, gfPyshkaY, 14,60);
  glEnd();
+  }

  //kinec garmatu

@@ -130,7 +140,7 @@
  glColor3f(0.0, 0.0, 0.0);

  //Opora
-
+   if (!liana_hit) {
  glBegin(GL_QUADS);
  glColor3f(0.0, 1.0, 0.0);
  glVertex2i(680, -460);
@@ -141,22 +151,23 @@
  glColor3f(0.0, 1.0, 0.0);
  glVertex2i(680, 250);
  glEnd();
+   }

  //perekladina

  glBegin(GL_LINE_LOOP);
  glColor3f(0.0, 0.0, 0.0);
- glVertex2i(500, 250);
- glColor3f(0.0, 0.0, 0.0);
- glVertex2i(880, 250);
- glColor3f(0.0, 0.0, 0.0);
- glVertex2i(880, 270);
- glColor3f(0.0, 0.0, 0.0);
- glVertex2i(500, 270);
+ glVertex2i(500, 250-ly);
+ glColor3f(0.0, 0.0, 0.0);
+ glVertex2i(880, 250-ly);
+ glColor3f(0.0, 0.0, 0.0);
+ glVertex2i(880, 270-ly);
+ glColor3f(0.0, 0.0, 0.0);
+ glVertex2i(500, 270-ly);
  glEnd();

  //punktir
-
+ if (!liana_hit) {
  glEnable(GL_LINE_STIPPLE);
  glLineStipple(1,0x00FF);
  glBegin(GL_LINE_LOOP);
@@ -170,16 +181,37 @@
  glVertex2i(680, 250);
  glEnd();
  glDisable(GL_LINE_STIPPLE);
-
+ }
  //kulka

  glColor3f(1.0, 0.0, 0.0);
- drawCircle(689, 321, 50,60);
+ drawCircle(689, 321-ly, 50,60);
+
+ if(gfPyshkaX>1450 && gfPyshkaX<1500 && gfPyshkaY>0 && gfPyshkaY<500 && mrt > 5 && mrt < 15 && !liana_hit)
+ {
+	 gfDeltaX1=0;
+	 gfDeltaY1=0;
+	 dly=10;
+	 liana_hit = true;
+ }
+
+ ly+=dly;
+
+ if(!liana_hit) {
+	 dly=0;
+ }

  //Romb
  if (mrt>5) { gfDeltaX = 0;
 			deltaangle = 0;
 			}
+
+ if(gfPyshkaX>570 && !ball_hit && mrt<5) {gfDeltaX = 0.5;
+ deltaangle = 0.2;
+ ball_hit = true;
+ gfDeltaX1=0;
+
+ }

 			  glPushMatrix();
 			  glTranslatef(-gfPosX-80,-382,0);
@@ -199,6 +231,9 @@

 	   }
+	if(ly>700) {
+		dly=0;
+	}
 	if (hit) {
 		rx1-=drx;
 		ry1+=dry;
@@ -209,7 +244,7 @@
 	{
 		drx2=0;
 	}
-	if (ry1 > 800)
+	if (ry1 > 900)
 	{
 		drx = dry = 0;
 	}
@@ -332,11 +367,12 @@
                glVertex2i(350, 200);
        glEnd();
        glDisable(GL_LINE_STIPPLE);
-
+
+	   //1 kusok
          void Pidvis1();
          {
          glBegin(GL_QUADS);
-                          glColor3f(0.0, 0.0, 0.0);
+               glColor3f(0.0, 0.0, 0.0);
                glVertex2i(155, gfPosY2);
                glColor3f(0.0, 0.0, 0.0);
                glVertex2i(155, gfPosY2+20);
@@ -349,6 +385,7 @@
        glEnd();
          }

+		 //2kusok
          void Pidvis2();
          {
          glBegin(GL_QUADS);
@@ -401,14 +438,57 @@
          gfPyshkaX += gfDeltaX1;
          gfPyshkaY += gfDeltaY1;
          }
-
+         //animatsiya perekladiny
          if(gfPosY >= 200 || gfPosY <= -200)
          {
                         gfDeltaY=0;
          }
-         if(gfPosY2 >= 200 || gfPosY2 <= -460)
+         //animatsiya kusochkiv=)
+		 if(gfPosY2 >= 200 || gfPosY2 <= -459)
          {
                         gfDeltaY2=0;
+						glBegin(GL_QUADS);
+		                     glColor3f(1.0, 1.0, 1.0);
+							 glVertex2i(480, -439);
+							 glColor3f(1.0, 1.0, 1.0);
+						     glVertex2i(480, -459);
+							 glColor3f(1.0, 1.0, 1.0);
+							 glVertex2i(520, -459);
+							 glColor3f(1.0, 1.0, 1.0);
+						     glVertex2i(520, -439);
+						glEnd();
+						glBegin(GL_QUADS);
+							 glColor3f(0.0, 0.0, 0.0);
+							 glVertex2i(gfPosX5, gfPosY5+20);
+						     glColor3f(0.0, 0.0, 0.0);
+						     glVertex2i(gfPosX5, gfPosY5);
+						     glColor3f(0.0, 0.0, 0.0);
+							 glVertex2i(gfPosX5+40, gfPosY5);
+						     glColor3f(0.0, 0.0, 0.0);
+							 glVertex2i(gfPosX5+40, gfPosY5+20);
+						glEnd();
+						gfPosX5+=gfDeltaX5;
+				        gfPosY5+=gfDeltaY5;
+						if(gfPosY5 <= -459 || gfPosY5 >= -400)
+				            {
+					            gfDeltaY5=-gfDeltaY5;
+				            }
+						if(gfPosX5 <= 450 || gfPosX5 >= 639)
+				            {
+					            gfDeltaY5=0;
+					            gfDeltaX5=0;
+					            glBegin(GL_QUADS);
+		                             glColor3f(1.0, 1.0, 1.0);
+                                     glVertex2i(639, -459);
+                                     glColor3f(1.0, 1.0, 1.0);
+                                     glVertex2i(679, -459);
+                                     glColor3f(1.0, 1.0, 1.0);
+                                     glVertex2i(679, -459+21);
+                                     glColor3f(1.0, 1.0, 1.0);
+                                     glVertex2i(639, -459+21);
+	                            glEnd();
+
+				            }
          }
          glutPostRedisplay();
          glPopMatrix();
@@ -427,10 +507,10 @@
          glPopMatrix();

          glPushMatrix();
-         if(gfPyshkaX >= 1275)
-         {
-                        if( gfPyshkaY >= 500 || gfPyshkaY>= 200 )
-                 {
+         if(gfPyshkaX >= 1275 && gfPyshkaX <= 1285 && mrt>=17 )
+         {
+
+
                          gfDeltaX1=0;
                          gfDeltaY1=0;

@@ -446,7 +526,7 @@
        glEnd();
          gfPosY -= gfDeltaY;
          gfPosY2 -= gfDeltaY2;
-                        }}
+                        }
          glPopMatrix();

          glutPostRedisplay();


further improvements to tabcontrol optimal size

One calculation takes the vertical offset into account, which we want
for height. But that one calculates the label width according to the
double-decker layout for over-wide layout, which we don't want.

--- vcl/source/control/tabctrl.cxx
+++ vcl/source/control/tabctrl.cxx
@@ -2152,12 +2152,16 @@
             if (aPageSize.Height() > aOptimalPageSize.Height())
                 aOptimalPageSize.Height() = aPageSize.Height();

+            TabControl* pThis = const_cast<TabControl*>(this);
+
             sal_uInt16 nPos = it - mpTabCtrlData->maItemList.begin();
-            TabControl* pThis = const_cast<TabControl*>(this);
             Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aPageSize.Width(), aPageSize.Height());
             if (aTabRect.Bottom() > nTabLabelsBottom)
                 nTabLabelsBottom = aTabRect.Bottom();
-            nTotalTabLabelWidths += aTabRect.GetWidth();
+
+            ImplTabItem* pItem = const_cast<ImplTabItem*>(&(*it));
+            Size aTabSize = pThis->ImplGetItemSize(pItem, LONG_MAX);
+            nTotalTabLabelWidths += aTabSize.Width();
         }

         Size aOptimalSize(aOptimalPageSize);


INTEGRATION: CWS docking1 (1.27.38); FILE MERGED 2004/06/16 09:49:06 ssa 1.27.38.4: #i25121# improve floater positioning 2004/06/11 16:02:20 ssa 1.27.38.3: #i25121# improve new subtoolbars 2004/05/07 15:54:25 ssa 1.27.38.2: #i25117# support menu and indicator for clipped toolbar items and customization menu 2004/04/22 15:26:34 ssa 1.27.38.1: #i24913# correct float hittest, the position of floating windows is not zero anymore

--- vcl/source/window/floatwin.cxx
+++ vcl/source/window/floatwin.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: floatwin.cxx,v $
  *
- *  $Revision: 1.27 $
- *
- *  last change: $Author: vg $ $Date: 2004-01-06 14:11:39 $
+ *  $Revision: 1.28 $
+ *
+ *  last change: $Author: obo $ $Date: 2004-07-06 13:48:51 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -377,6 +377,9 @@
                 break;
         }

+#if 0   // TODO: this should only happen if the mouse pointer is over the menu
+        // as it only affects a single window manager, a better solution should be found
+        // currently it makes exact positioning impossible
         /*
          *  #95901# avoid mouse pointer for popup menus because
          *  of sawfish window manager. This cannot be done in
@@ -387,6 +390,7 @@
               (nArrangeAry[nArrangeIndex] == FLOATWIN_POPUPMODE_RIGHT) )
             && ( nFlags & FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE ) )
             aPos.X() += 2;
+#endif

         // Evt. noch anpassen
         if ( bBreak && !(nFlags & FLOATWIN_POPUPMODE_NOAUTOARRANGE) )
@@ -467,19 +471,24 @@

     do
     {
-        Rectangle devRect( pWin->ImplOutputToUnmirroredAbsoluteScreenPixel( Rectangle( pWin->ScreenToOutputPixel(pWin->GetPosPixel()), pWin->GetSizePixel()) ) ) ;
+        // compute the floating window's size in absolute screen coordinates
+
+        // use the border window to have the exact position
+        Window *pBorderWin = pWin->GetWindow( WINDOW_BORDER );
+
+        Point aPt;  // the top-left corner in output coordinates ie (0,0)
+        Rectangle devRect( pBorderWin->ImplOutputToUnmirroredAbsoluteScreenPixel( Rectangle( aPt, pBorderWin->GetSizePixel()) ) ) ;
         if ( devRect.IsInside( aAbsolute ) )
         {
             rHitTest = IMPL_FLOATWIN_HITTEST_WINDOW;
             return pWin;
         }

-        // test, if mouse in rectangle
-        /*
-         *  maFloatRect is set in startpopup mode and
-         *  already is in parent coordinates.
-         */
-        if ( pWin->maFloatRect.IsInside( rPos ) )
+        // test, if mouse is in rectangle, (this is typically the rect of the active
+        // toolbox item or similar)
+        // note: maFloatRect is set in FloatingWindow::StartPopupMode() and
+        //       is already in absolute device coordinates
+        if ( pWin->maFloatRect.IsInside( aAbsolute ) )
         {
             rHitTest = IMPL_FLOATWIN_HITTEST_RECT;
             return pWin;
@@ -636,18 +645,14 @@

 void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
 {
-    DBG_ASSERT( (GetStyle() & WB_MOVEABLE) || !(nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF),
-                "TearOff only allowed, when FloatingWindow moveable" );
-
-    // Wenn Fenster sichtbar, dann vorher hiden, da es sonst flackert
+    // avoid flickering
     if ( IsVisible() )
         Show( FALSE, SHOW_NOFOCUSCHANGE );

-    // Wenn Fenster klein, dann vorher aufklappen
     if ( IsRollUp() )
         RollDown();

-    // Title wegnehmen
+    // remove title
     mnOldTitle = mnTitle;
     if ( nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF )
         SetTitleType( FLOATWIN_TITLE_TEAROFF );
@@ -661,17 +666,20 @@
         nFlags &= ~FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;

     // #102010# For debugging Accessibility
-    // MT->SSA: I wanted to set that flag in menu.cxx, why do you remove it above???
     static const char* pEnv = getenv("SAL_FLOATWIN_NOAPPFOCUSCLOSE" );
     if( pEnv && *pEnv )
         nFlags |= FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;

-    // Fenster-Position ermitteln und setzen
+    // compute window position according to flags and arrangement
     USHORT nArrangeIndex;
     SetPosPixel( ImplCalcPos( this, rRect, nFlags, nArrangeIndex ) );

-    // Daten seten und Fenster anzeigen
+    // set data and display window
+    // convert maFloatRect to absolute device coordinates
+    // so they can be compared across different frames
+    // !!! rRect is expected to be in screen coordinates of the parent frame window !!!
     maFloatRect             = rRect;
+    maFloatRect.SetPos( GetParent()->OutputToAbsoluteScreenPixel( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) ) );
     maFloatRect.Left()     -= 2;
     maFloatRect.Top()      -= 2;
     maFloatRect.Right()    += 2;
@@ -686,50 +694,15 @@
     mbOldSaveBackMode       = IsSaveBackgroundEnabled();
     EnableSaveBackground();

-/*
-    // Abfragen, ob Animation eingeschaltet ist
-    if ( (Application::GetSettings().GetAnimationOptions() & ANIMATION_OPTION_POPUP) &&
-         !(nFlags & FLOATWIN_POPUPMODE_NOANIMATION) )
-    {
-        USHORT nAniFlags;
-        switch ( nArrangeAry[nArrangeIndex] )
-        {
-            case FLOATWIN_POPUPMODE_LEFT:
-                nAniFlags = STARTANIMATION_LEFT;
-                break;
-            case FLOATWIN_POPUPMODE_RIGHT:
-                nAniFlags = STARTANIMATION_RIGHT;
-                break;
-            case FLOATWIN_POPUPMODE_UP:
-                nAniFlags = STARTANIMATION_UP;
-                break;
-            case FLOATWIN_POPUPMODE_DOWN:
-                nAniFlags = STARTANIMATION_DOWN;
-                break;
-        }
-        if ( !(nFlags & FLOATWIN_POPUPMODE_ANIMATIONSLIDE) )
-        {
-            if ( bLeft )
-                nAniFlags |= STARTANIMATION_LEFT;
-            else
-                nAniFlags |= STARTANIMATION_RIGHT;
-            if ( bTop )
-                nAniFlags |= STARTANIMATION_UP;
-            else
-                nAniFlags |= STARTANIMATION_DOWN;
-        }
-
-        ImpStartAnimation( this, nAniFlags );
-    }
-    else
-*/
-    // FloatingWindow in Liste der Fenster aufnehmen, die sich im PopupModus
-    // befinden
+    // add FloatingWindow to list of windows that are in popup mode
     ImplSVData* pSVData = ImplGetSVData();
     mpNextFloat = pSVData->maWinData.mpFirstFloat;
     pSVData->maWinData.mpFirstFloat = this;
     if( nFlags & FLOATWIN_POPUPMODE_GRABFOCUS )
-        mbGrabFocus = TRUE;     // force key input even without focus (useful for menues)
+    {
+        // force key input even without focus (useful for menues)
+        mbGrabFocus = TRUE;
+    }
     Show( TRUE, SHOW_NOACTIVATE );
 }

@@ -737,7 +710,7 @@

 void FloatingWindow::StartPopupMode( ToolBox* pBox, ULONG nFlags )
 {
-    // Selektieten Button ermitteln
+    // get selected button
     USHORT nItemId = pBox->GetDownItemId();
     if ( !nItemId )
         return;
@@ -745,9 +718,10 @@
     mpBox = pBox;
     pBox->ImplFloatControl( TRUE, this );

-    // Daten von der ToolBox holen
+    // retrieve some data from the ToolBox
     Rectangle aRect = pBox->GetItemRect( nItemId );
     Point aPos;
+    // convert to parent's screen coordinates
     aPos = GetParent()->OutputToScreenPixel( GetParent()->AbsoluteScreenToOutputPixel( pBox->OutputToAbsoluteScreenPixel( aRect.TopLeft() ) ) );
     aRect.SetPos( aPos );


INTEGRATION: CWS pchfix02 (1.34.112); FILE MERGED 2006/09/01 17:57:54 kaib 1.34.112.1: #i68856# Added header markers and pch files

--- vcl/source/window/floatwin.cxx
+++ vcl/source/window/floatwin.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: floatwin.cxx,v $
  *
- *  $Revision: 1.34 $
- *
- *  last change: $Author: hr $ $Date: 2006-06-19 19:37:55 $
+ *  $Revision: 1.35 $
+ *
+ *  last change: $Author: obo $ $Date: 2006-09-17 12:18:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -32,6 +32,9 @@
  *    MA  02111-1307  USA
  *
  ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"

 #ifndef _SV_SVSYS_HXX
 #include <svsys.h>


INTEGRATION: CWS uaa06 (1.7.20); FILE MERGED 2008/05/16 05:20:58 obr 1.7.20.2: #i87426# replace FILLER role with option pane again for dialogs and alerts 2008/05/08 12:39:09 obr 1.7.20.1: #i87426# repaired broken a11y hierarchy of a number of dialogs

--- vcl/unx/gtk/a11y/atkwindow.cxx
+++ vcl/unx/gtk/a11y/atkwindow.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: atkwindow.cxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -35,7 +35,10 @@
 #include <vcl/window.hxx>

 #include "atkwindow.hxx"
+#include "atkwrapper.hxx"
 #include "atkregistry.hxx"
+
+#include <com/sun/star/accessibility/AccessibleRole.hpp>

 using namespace ::com::sun::star::accessibility;
 using namespace ::com::sun::star::uno;
@@ -45,6 +48,76 @@
 static void (* window_real_initialize) (AtkObject *obj, gpointer data) = NULL;
 static void (* window_real_finalize) (GObject *obj) = NULL;
 static G_CONST_RETURN gchar* (* window_real_get_name) (AtkObject *accessible) = NULL;
+
+static void
+init_from_window( AtkObject *accessible, Window *pWindow )
+{
+    static AtkRole aDefaultRole = ATK_ROLE_INVALID;
+
+    // Special role for sub-menu and combo-box popups that are exposed directly
+    // by their parents already.
+    if( aDefaultRole == ATK_ROLE_INVALID )
+        aDefaultRole = atk_role_register( "redundant object" );
+
+    AtkRole role = aDefaultRole;
+
+    // Determine the appropriate role for the GtkWindow
+    switch( pWindow->GetAccessibleRole() )
+    {
+        case AccessibleRole::ALERT:
+            role = ATK_ROLE_ALERT;
+            break;
+
+        case AccessibleRole::DIALOG:
+            role = ATK_ROLE_DIALOG;
+            break;
+
+        case AccessibleRole::FRAME:
+            role = ATK_ROLE_FRAME;
+            break;
+
+        /* Ignore window objects for sub-menus, combo- and list boxes,
+         *  which are exposed as children of their parents.
+         */
+        case AccessibleRole::WINDOW:
+        {
+            USHORT type = WINDOW_WINDOW;
+            bool parentIsMenuFloatingWindow = false;
+
+            Window *pParent = pWindow->GetParent();
+            if( pParent ) {
+                type = pParent->GetType();
+                parentIsMenuFloatingWindow = ( TRUE == pParent->IsMenuFloatingWindow() );
+            }
+
+            if( (WINDOW_LISTBOX != type) && (WINDOW_COMBOBOX != type) &&
+                (WINDOW_MENUBARWINDOW != type) && ! parentIsMenuFloatingWindow )
+            {
+                role = ATK_ROLE_WINDOW;
+            }
+        }
+        break;
+
+        default:
+        {
+            Window *pChild = pWindow->GetChild( 0 );
+            if( pChild )
+            {
+                if( WINDOW_HELPTEXTWINDOW == pChild->GetType() )
+                {
+                    role = ATK_ROLE_TOOL_TIP;
+                    pChild->SetAccessibleRole( AccessibleRole::LABEL );
+                    accessible->name = g_strdup( rtl::OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() );
+                }
+            }
+            break;
+        }
+    }
+
+    accessible->role = role;
+}
+
+/*****************************************************************************/

 static gint
 ooo_window_wrapper_clear_focus(gpointer)
@@ -75,27 +148,28 @@
         Window *pWindow = pFrame->GetWindow();
         if( pWindow )
         {
+            init_from_window( obj, pWindow );
+
             Reference< XAccessible > xAccessible( pWindow->GetAccessible(true) );
-            ooo_wrapper_registry_add( xAccessible, obj );
-            g_object_set_data( G_OBJECT(obj), "ooo:registry-key", xAccessible.get() );
-        }
-    }
-
-    /* GetAtkRole returns ATK_ROLE_INVALID for all non VCL windows, i.e.
-     * native Gtk+ file picker etc.
-     */
-    AtkRole newRole = GtkSalFrame::GetAtkRole( GTK_WINDOW( data ) );
-    if( newRole != ATK_ROLE_INVALID )
-        obj->role = newRole;
-
-    if( obj->role == ATK_ROLE_TOOL_TIP )
-    {
-        /* HACK: Avoid endless loop when get_name is called from
-         * gail_window_new() context, which leads to the code path
-         * showing up in wrapper_factory_create_accessible with no
-         * accessible assigned to the GtkWindow yet.
-         */
-        g_object_set_data( G_OBJECT( data ), "ooo:tooltip-accessible", obj );
+
+            /* We need the wrapper object for the top-level XAccessible to be
+             * in the wrapper registry when atk traverses the hierachy up on
+             * focus events
+             */
+            if( WINDOW_BORDERWINDOW == pWindow->GetType() )
+            {
+                ooo_wrapper_registry_add( xAccessible, obj );
+                g_object_set_data( G_OBJECT(obj), "ooo:atk-wrapper-key", xAccessible.get() );
+            }
+            else
+            {
+                AtkObject *child = atk_object_wrapper_new( xAccessible, obj );
+                child->role = ATK_ROLE_FILLER;
+                if( (ATK_ROLE_DIALOG == obj->role) || (ATK_ROLE_ALERT == obj->role) )
+                    child->role = ATK_ROLE_OPTION_PANE;
+                ooo_wrapper_registry_add( xAccessible, child );
+            }
+        }
     }

     g_signal_connect_after( GTK_WIDGET( data ), "focus-out-event",
@@ -105,32 +179,10 @@

 /*****************************************************************************/

-static G_CONST_RETURN gchar*
-ooo_window_wrapper_real_get_name(AtkObject *accessible)
-{
-    G_CONST_RETURN gchar* name = NULL;
-
-    if( accessible->role == ATK_ROLE_TOOL_TIP )
-    {
-        AtkObject *child = atk_object_ref_accessible_child(accessible, 0);
-        if( child )
-        {
-            name = atk_object_get_name(child);
-            g_object_unref(child);
-        }
-
-        return name;
-    }
-
-    return window_real_get_name(accessible);
-}
-
-/*****************************************************************************/
-
 static void
 ooo_window_wrapper_real_finalize (GObject *obj)
 {
-    ooo_wrapper_registry_remove( (XAccessible *) g_object_get_data( obj, "ooo:registry-key" ));
+    ooo_wrapper_registry_remove( (XAccessible *) g_object_get_data( obj, "ooo:atk-wrapper-key" ));
     window_real_finalize( obj );
 }

@@ -153,9 +205,6 @@

     window_real_initialize = atk_class->initialize;
     atk_class->initialize = ooo_window_wrapper_real_initialize;
-
-    window_real_get_name = atk_class->get_name;
-    atk_class->get_name = ooo_window_wrapper_real_get_name;

     gobject_class = G_OBJECT_CLASS (data);


From Jannik Heller, fix typo of OSG_COMPILE_CONTEXTS.

git-svn-id: aa838dfc23441284dd616281de4245daec5d2135@15176 16af8721-9629-0410-8352-f15c8da7e697

--- src/osg/DisplaySettings.cpp
+++ src/osg/DisplaySettings.cpp
@@ -515,7 +515,7 @@
         _maxNumOfGraphicsContexts = atoi(ptr);
     }

-    if( (ptr = getenv("OSG_COMPIlE_CONTEXTS")) != 0)
+    if( (ptr = getenv("OSG_COMPILE_CONTEXTS")) != 0)
     {
         if (strcmp(ptr,"OFF")==0)
         {


#102098# dont include useless svunix.h, which breaks build on Solaris 9

--- vcl/unx/source/app/saldata.cxx
+++ vcl/unx/source/app/saldata.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: saldata.cxx,v $
  *
- *  $Revision: 1.15 $
- *
- *  last change: $Author: cp $ $Date: 2002-05-31 14:45:00 $
+ *  $Revision: 1.16 $
+ *
+ *  last change: $Author: cp $ $Date: 2002-08-06 14:27:57 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -84,7 +84,6 @@
 #include <vos/mutex.hxx>
 #endif

-#include <svunx.h>
 #include <prex.h>
 #include <X11/Xproto.h>
 #include <postx.h>


Fixed to DatabasePager::getRequestsInProgress(), merged from:

svn merge -r 9734:9735 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.8

--- src/osgDB/DatabasePager.cpp
+++ src/osgDB/DatabasePager.cpp
@@ -1217,7 +1217,7 @@
     if (getDataToMergeListSize()>0) return true;

     for(DatabaseThreadList::const_iterator itr = _databaseThreads.begin();
-        itr != _databaseThreads.begin();
+        itr != _databaseThreads.end();
         ++itr)
     {
         if ((*itr)->getActive()) return true;


INTEGRATION: CWS warnings01 (1.67.66); FILE MERGED 2006/04/07 18:55:05 sb 1.67.66.5: RESYNC: (1.71-1.72); FILE MERGED 2006/01/25 19:30:16 sb 1.67.66.4: RESYNC: (1.68-1.71); FILE MERGED 2005/11/11 14:31:24 pl 1.67.66.3: #i55991# removed warnings 2005/11/04 10:54:32 pl 1.67.66.2: RESYNC: (1.67-1.68); FILE MERGED 2005/10/24 14:27:18 pl 1.67.66.1: #i55991# removed warnings for linux platform

--- vcl/unx/source/app/saldisp.cxx
+++ vcl/unx/source/app/saldisp.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: saldisp.cxx,v $
  *
- *  $Revision: 1.73 $
+ *  $Revision: 1.74 $
  *
- *  last change: $Author: hr $ $Date: 2006-06-09 12:20:52 $
+ *  last change: $Author: hr $ $Date: 2006-06-19 19:51:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -144,7 +144,6 @@
 #endif

 #include <osl/socket.h>
-#include <rtl/ustring>

 using namespace rtl;
 using namespace vcl_sal;
@@ -697,7 +696,11 @@
         pSalData->SetSalDisplay( NULL );
 }

-static int DisplayHasEvent( int fd, SalX11Display *pDisplay  )
+static int DisplayHasEvent( int
+#ifdef DBG_UTIL
+fd
+#endif
+, SalX11Display *pDisplay  )
 {
   DBG_ASSERT( ConnectionNumber( pDisplay->GetDisplay() ) == fd,
               "wrong fd in DisplayHasEvent" );
@@ -709,7 +712,11 @@
   ::vos::OGuard aGuard( *pSalInstYieldMutex );
   return pDisplay->IsEvent();
 }
-static int DisplayQueue( int fd, SalX11Display *pDisplay )
+static int DisplayQueue( int
+#ifdef DBG_UTIL
+fd
+#endif
+, SalX11Display *pDisplay )
 {
   DBG_ASSERT( ConnectionNumber( pDisplay->GetDisplay() ) == fd,
               "wrong fd in DisplayHasEvent" )
@@ -719,14 +726,18 @@
   return XEventsQueued( pDisplay->GetDisplay(),
                         QueuedAfterReading );
 }
-static int DisplayYield( int fd, SalX11Display *pDisplay )
+static int DisplayYield( int
+#ifdef DBG_UTIL
+fd
+#endif
+, SalX11Display *pDisplay )
 {
   DBG_ASSERT( ConnectionNumber( pDisplay->GetDisplay() ) == fd,
               "wrong fd in DisplayHasEvent" );
   vos::IMutex* pSalInstYieldMutex   =
       GetSalData()->pInstance_->GetYieldMutex();
   ::vos::OGuard aGuard( *pSalInstYieldMutex );
-  pDisplay->Yield( TRUE );
+  pDisplay->Yield();
   return TRUE;
 }

@@ -756,7 +767,11 @@
 }

 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void SalDisplay::Init( Colormap hXColmap, Visual *pVisual, bool bHandleStartupNotification )
+void SalDisplay::Init( Colormap hXColmap, Visual *pVisual, bool
+#ifdef HAVE_LIBSN
+bHandleStartupNotification
+#endif
+)
 {
     XVisualInfo aXVI;

@@ -821,9 +836,9 @@
         Visual *pRootVisual = DefaultVisual( pDisp_, nScreen_ );
         if( pRootVisual->visualid != pVisual_->GetVisualId() )
         {
-            XVisualInfo aXVI;
-            sal_GetVisualInfo( pDisp_, pRootVisual->visualid, aXVI );
-            pRootVisual_ = new SalVisual( &aXVI );
+            XVisualInfo aXVInfo;
+            sal_GetVisualInfo( pDisp_, pRootVisual->visualid, aXVInfo );
+            pRootVisual_ = new SalVisual( &aXVInfo );
         }
         else
             pRootVisual_ = pVisual_;
@@ -977,18 +992,6 @@
                                             invert50_width,
                                             invert50_height );

-        // - - - - - - - - - - Fonts - - - - - - - - - - - - - - - -
-
-#ifndef USE_BUILTIN_RASTERIZER
-        const char *pFontPath = getenv( "SAL_FONTPATH" );
-        if( pFontPath )
-            AddFontPath( ByteString( pFontPath ) );
-
-        pFontPath = getenv( "SAL_FONTPATH_PRIVATE" );
-        if( pFontPath )
-            AddFontPath( ByteString( pFontPath ) );
-#endif // USE_BUILTIN_RASTERIZER
-
         // - - - - - - - - - - Keyboardmapping - - - - - - - - - - -

         ModifierMapping();
@@ -2296,84 +2299,6 @@
     return 1;
 }

-// Fonts
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#ifndef USE_BUILTIN_RASTERIZER
-static BOOL
-sal_IsValidFontpath( const ByteString &rFontPath,
-                     const srv_vendor_t eServerVendor )
-{
-    // filter fontpath with ':unscaled' attribute for server other
-    // than xfree (e.g.: /opt/Office51/fonts/75dpi:unscaled)
-
-    const char   aAttr[]  = ":unscaled";
-    const USHORT nAttrLen = sizeof( aAttr ) - 1;
-    USHORT       nAttrPos;
-
-    nAttrPos = rFontPath.Search( aAttr, 0 );
-    if ( nAttrPos == (rFontPath.Len() - nAttrLen) )
-        return (eServerVendor == vendor_xfree);
-
-    return TRUE;
-}
-#endif
-
-void SalDisplay::AddFontPath( const ByteString &rPath ) const
-{
-#ifndef USE_BUILTIN_RASTERIZER
-    const char cSeparator = ';' ;
-
-    if( rPath.Len()
-        && (GetServerVendor() != vendor_excursion)
-        && (GetServerVendor() != vendor_hummingbird) )
-    {
-        USHORT nCount = rPath.GetTokenCount( cSeparator );
-        int     i;
-        int     nPaths          = 0;
-        char  **pOldFontPath    = XGetFontPath( pDisp_, &nPaths );
-        int     nOriginalPaths  = nPaths;
-        char  **pNewFontPath    = (char**)alloca(sizeof(char*)*(nPaths+nCount));
-        BOOL    bOld            = pXLib_->GetIgnoreXErrors();
-
-        for( i = 0; i < nPaths; i++ )
-            pNewFontPath[i] = pOldFontPath[i];
-
-        for( USHORT nNew = 0; nNew < nCount; nNew++ )
-        {
-            ByteString aPathName = rPath.GetToken( nNew, cSeparator );
-
-            if( aPathName.Len() )
-            {
-                for( i = 0; i < nPaths; i++ )
-                    if( !strcmp( pNewFontPath[i], aPathName.GetBuffer() ) )
-                        break;
-
-                if (   (i == nPaths)
-                    && sal_IsValidFontpath(aPathName, GetServerVendor()) )
-                {
-                    pNewFontPath[nPaths++] = strdup( aPathName.GetBuffer() );
-                    pXLib_->SetIgnoreXErrors( TRUE ); // reset WasXError
-
-                    XSetFontPath( pDisp_, pNewFontPath, nPaths );
-                    XSync( pDisp_, False );
-                    if( pXLib_->WasXError() )
-                        free( pNewFontPath[--nPaths] );
-                }
-            }
-        }
-
-        while( nPaths-- > nOriginalPaths )
-            free( pNewFontPath[ nPaths ] );
-
-        XFreeFontPath( pOldFontPath );
-
-
-        pXLib_->SetIgnoreXErrors( bOld );
-    }
-#endif
-}
-
 // Events
 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

@@ -2465,7 +2390,7 @@

 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-void SalX11Display::Yield( BOOL bWait )
+void SalX11Display::Yield()
 {
     if( DispatchInternalEvent() )
         return;
@@ -2569,7 +2494,7 @@
         default:

             if (   GetKbdExtension()->UseExtension()
-                && GetKbdExtension()->GetEventBase() == sal_uInt32(pEvent->type) )
+                && GetKbdExtension()->GetEventBase() == pEvent->type )
             {
                 GetKbdExtension()->Dispatch( pEvent );
                 return 1;
@@ -3026,7 +2951,6 @@
     {
         case other:
             return FALSE;
-            break;
         case SALCOLOR:
             break;
         case SALCOLORREVERSE:
@@ -3035,7 +2959,6 @@
         case GBR:
         case GRB:
             return Convert( n0, n1, n2 );
-            break;
         case RGBA:
             n  = n0;
             n0 = n1;
@@ -3051,7 +2974,6 @@
         default:
             fprintf( stderr, "SalVisual::Convert %d\n", GetMode() );
             abort();
-            break;
     }
     return TRUE;
 }
@@ -3064,7 +2986,6 @@
     {
         case other:
             return FALSE;
-            break;
         case SALCOLOR:
             break;
         case RBG:
@@ -3097,7 +3018,6 @@
         default:
             fprintf( stderr, "SalVisual::Convert %d\n", GetMode() );
             abort();
-            break;
     }
     return TRUE;
 }


#100608# fonts for PDF export

#100608# fonts for PDF export

--- vcl/unx/source/gdi/salgdi3.cxx
+++ vcl/unx/source/gdi/salgdi3.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: salgdi3.cxx,v $
  *
- *  $Revision: 1.82 $
+ *  $Revision: 1.83 $
  *
- *  last change: $Author: hdu $ $Date: 2002-07-19 17:26:17 $
+ *  last change: $Author: pl $ $Date: 2002-07-20 16:00:27 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -68,6 +68,11 @@
 #include <stdlib.h>
 #include <math.h>
 #include <assert.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #if !( defined(FREEBSD) || defined(NETBSD) )
 #include <alloca.h>
 #endif
@@ -1483,9 +1488,9 @@
             long nXOffset = 0;
             for( int j = 0; j < nGlyphs; j++ )
             {
-                nXOffset += aWidthAry[ i ];
+                nXOffset += aWidthAry[ j ];
                 aIdxAry[ j ] = nXOffset / nUnitsPerPixel;
-                aUnicodes[i] = bIsTruetype ? 0 : aGlyphAry[i];
+                aUnicodes[j] = bIsTruetype ? 0 : aGlyphAry[j];
             }

             maGraphicsData.m_pPrinterGfx->DrawGlyphs( aPos, (unsigned long*)aGlyphAry, aUnicodes, nGlyphs, aIdxAry );
@@ -2475,4 +2480,135 @@
 }
 #endif // ENABLE_CTL

+//--------------------------------------------------------------------------
+
+BOOL SalGraphics::CreateFontSubset(
+                                   const rtl::OUString& rToFile,
+                                   ImplFontData* pFont,
+                                   long* pGlyphIDs,
+                                   sal_uInt8* pEncoding,
+                                   sal_Int32* pWidths,
+                                   int nGlyphs,
+                                   FontSubsetInfo& rInfo
+                                   )
+{
+#ifndef _USE_PRINT_EXTENSION_
+    // in this context the sysdata member of pFont should
+    // contain a fontID as the X fonts should be filtered
+    // out of the font list available to PDF export (for
+    // which this method was created). The correct way would
+    // be to have the GlyphCache search for the ImplFontData pFont
+    psp::fontID aFont = (psp::fontID)pFont->mpSysData;
+    psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
+
+    psp::PrintFontInfo aFontInfo;
+    if( ! rMgr.getFontInfo( aFont, aFontInfo ) )
+        return FALSE;
+
+    // fill in font info
+    switch( aFontInfo.m_eType )
+    {
+        case psp::fonttype::TrueType: rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TRUETYPE;break;
+        case psp::fonttype::Type1: rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TYPE1;break;
+        default:
+            return FALSE;
+    }
+    rInfo.m_nAscent     = aFontInfo.m_nAscend;
+    rInfo.m_nDescent    = aFontInfo.m_nDescend;
+    rInfo.m_aPSName     = rMgr.getPSName( aFont );
+
+    int xMin, yMin, xMax, yMax;
+    rMgr.getFontBoundingBox( aFont, xMin, yMin, xMax, yMax );
+
+    if( ! rMgr.createFontSubset( aFont,
+                                 rToFile,
+                                 pGlyphIDs,
+                                 pEncoding,
+                                 pWidths,
+                                 nGlyphs
+                                 ) )
+        return FALSE;
+
+    rInfo.m_aFontBBox   = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) );
+    rInfo.m_nCapHeight  = yMax; // Well ...
+
+    return TRUE;
+#else
+    return FALSE;
+#endif
+}
+
+//--------------------------------------------------------------------------
+
+const void* SalGraphics::GetEmbedFontData( ImplFontData* pFont, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen )
+{
+#ifndef _USE_PRINT_EXTENSION_
+    // in this context the sysdata member of pFont should
+    // contain a fontID as the X fonts should be filtered
+    // out of the font list available to PDF export (for
+    // which this method was created). The correct way would
+    // be to have the GlyphCache search for the ImplFontData pFont
+    psp::fontID aFont = (psp::fontID)pFont->mpSysData;
+    psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
+
+    psp::PrintFontInfo aFontInfo;
+    if( ! rMgr.getFontInfo( aFont, aFontInfo ) )
+        return NULL;
+
+    // fill in font info
+    switch( aFontInfo.m_eType )
+    {
+        case psp::fonttype::TrueType: rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TRUETYPE;break;
+        case psp::fonttype::Type1: rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TYPE1;break;
+        default:
+            return NULL;
+    }
+    rInfo.m_nAscent     = aFontInfo.m_nAscend;
+    rInfo.m_nDescent    = aFontInfo.m_nDescend;
+    rInfo.m_aPSName     = rMgr.getPSName( aFont );
+
+    int xMin, yMin, xMax, yMax;
+    rMgr.getFontBoundingBox( aFont, xMin, yMin, xMax, yMax );
+
+    psp::CharacterMetric aMetrics[256];
+    sal_Unicode nFirstChar = 0;
+    sal_Unicode nLastChar = 255;
+    if( aFontInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL && aFontInfo.m_eType == psp::fonttype::Type1 )
+    {
+        nFirstChar = 0xf000;
+        nLastChar = 0xf0ff;
+    }
+    if( ! rMgr.getMetrics( aFont, nFirstChar, nLastChar, aMetrics ) )
+        return NULL;
+
+    OString aSysPath = rMgr.getFontFileSysPath( aFont );
+    struct stat aStat;
+    if( stat( aSysPath.getStr(), &aStat ) )
+        return NULL;
+    int fd = open( aSysPath.getStr(), O_RDONLY );
+    if( fd < 0 )
+        return NULL;
+    void* pFile = mmap( NULL, aStat.st_size, PROT_READ, MAP_SHARED, fd, 0 );
+    close( fd );
+    if( pFile == MAP_FAILED )
+        return NULL;
+
+    *pDataLen = aStat.st_size;
+
+    rInfo.m_aFontBBox   = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) );
+    rInfo.m_nCapHeight  = yMax; // Well ...
+
+    for( int i = 0; i < 256; i++ )
+        pWidths[i] = (aMetrics[i].width > 0 ? aMetrics[i].width : 0);
+
+    return pFile;
+#else
+    return NULL;
+#endif
+}
+
+void SalGraphics::FreeEmbedFontData( const void* pData, long nLen )
+{
+    munmap( (char*)pData, nLen );
+}
 // ===========================================================================


From David Fries, Reset only the RenderLeaf objects used in the last
frame as given by the _currentReuseRenderLeafIndex instead of
resetting all leaves which can be very time consuming.

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@5178 16af8721-9629-0410-8352-f15c8da7e697

--- src/osgUtil/CullVisitor.cpp
+++ src/osgUtil/CullVisitor.cpp
@@ -129,18 +129,18 @@

     _bbCornerNear = (~_bbCornerFar)&7;

+    // Only reset the RenderLeaf objects used last frame.
+    for(RenderLeafList::iterator itr=_reuseRenderLeafList.begin(),
+        iter_end=_reuseRenderLeafList.begin()+_currentReuseRenderLeafIndex;
+        itr!=iter_end;
+        ++itr)
+    {
+        (*itr)->reset();
+    }
+
     // reset the resuse lists.
     _currentReuseMatrixIndex = 0;
     _currentReuseRenderLeafIndex = 0;
-
-    for(RenderLeafList::iterator itr=_reuseRenderLeafList.begin();
-        itr!=_reuseRenderLeafList.end();
-        ++itr)
-    {
-        (*itr)->reset();
-    }
-
-

     _nearPlaneCandidateMap.clear();
 }


#92759 xp detection

#92759 xp detection

--- vcl/win/source/app/salinst.cxx
+++ vcl/win/source/app/salinst.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: salinst.cxx,v $
  *
- *  $Revision: 1.8 $
- *
- *  last change: $Author: th $ $Date: 2001-08-07 12:50:13 $
+ *  $Revision: 1.9 $
+ *
+ *  last change: $Author: ssa $ $Date: 2001-11-06 10:07:23 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -447,6 +447,9 @@
     SalData* pSalData = GetSalData();

     // determine the windows version
+    aSalShlData.mbW40 = 0;
+    aSalShlData.mbWNT = 0;
+    aSalShlData.mbWXP = 0;
     WORD nVer = (WORD)GetVersion();
     aSalShlData.mnVersion = (((WORD)LOBYTE(nVer)) * 100) + HIBYTE(nVer);
     if ( aSalShlData.mnVersion >= W95_VERSION )
@@ -456,7 +459,12 @@
     if ( GetVersionEx( &aVerInfo ) )
     {
         if ( aVerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
+        {
             aSalShlData.mbWNT = 1;
+            // Windows XP ?
+            if ( aVerInfo.dwMajorVersion == 5 && aVerInfo.dwMinorVersion == 1 )
+                aSalShlData.mbWXP = 1;
+        }
     }

     pSalData->mnAppThreadId = GetCurrentThreadId();


INTEGRATION: CWS vgbugs07 (1.89.74); FILE MERGED 2007/06/04 13:30:03 vg 1.89.74.1: #i76605# Remove -I .../inc/module hack introduced by hedaburemove01

--- vcl/win/source/gdi/salgdi3.cxx
+++ vcl/win/source/gdi/salgdi3.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: salgdi3.cxx,v $
  *
- *  $Revision: 1.89 $
+ *  $Revision: 1.90 $
  *
- *  last change: $Author: rt $ $Date: 2007-04-04 08:08:21 $
+ *  last change: $Author: hr $ $Date: 2007-06-27 20:57:32 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -61,7 +61,7 @@
 #endif

 #ifndef _SV_SVAPP_HXX
-#include <svapp.hxx>
+#include <vcl/svapp.hxx>
 #endif
 #ifndef _SV_WINCOMP_HXX
 #include <wincomp.hxx>
@@ -73,13 +73,13 @@
 #include <salgdi.h>
 #endif
 #ifndef _SV_OUTFONT_HXX
-#include <outfont.hxx>
+#include <vcl/outfont.hxx>
 #endif
 #ifndef _SV_FONT_HXX
-#include <font.hxx>
+#include <vcl/font.hxx>
 #endif
 #ifndef _SV_SALLAYOUT_HXX
-#include <sallayout.hxx>
+#include <vcl/sallayout.hxx>
 #endif

 #ifndef _TL_POLY_HXX


parser: Fix unlikely race condition during start/stop

Although it does happen sometimes when running tests, if starting &
stopping fast enough :)

--- src/parser/ParserWorker.cpp
+++ src/parser/ParserWorker.cpp
@@ -97,20 +97,19 @@
     // not idle
     setIdle( false );

-    if ( m_threads.size() == 0 )
-    {
-        // Since the thread isn't started, no need to lock the mutex before pushing the task
+    // Even if no threads appear to be started, we need to lock this in case
+    // we're currently doing a stop/start
+    {
+        std::lock_guard<compat::Mutex> lock( m_lock );
+        if ( m_threads.size() == 0 )
+        {
+            m_tasks.push( std::move( t ) );
+            start();
+            return;
+        }
         m_tasks.push( std::move( t ) );
-        start();
-    }
-    else
-    {
-        {
-            std::lock_guard<compat::Mutex> lock( m_lock );
-            m_tasks.push( std::move( t ) );
-        }
-        m_cond.notify_all();
-    }
+    }
+    m_cond.notify_all();
 }

 bool Worker::initialize( MediaLibrary* ml, IParserCb* parserCb,


swap devices names with mount points to be consistent with other
platforms.

Task-number: MOBILITY-804

--- src/systeminfo/qsysteminfo_linux_common.cpp
+++ src/systeminfo/qsysteminfo_linux_common.cpp
@@ -987,7 +987,7 @@
     }
     mountEntries();
     struct statfs fs;
-    if(statfs(mountEntriesMap[driveVolume].toLatin1(), &fs ) == 0 ) {
+    if(statfs(driveVolume.toLatin1(), &fs ) == 0 ) {
                 long blockSize = fs.f_bsize;
                 long availBlocks = fs.f_bavail;
                 return (double)availBlocks * blockSize;
@@ -1002,7 +1002,7 @@
     }
     mountEntries();
     struct statfs fs;
-    if(statfs(mountEntriesMap[driveVolume].toLatin1(), &fs ) == 0 ) {
+    if(statfs(driveVolume.toLatin1(), &fs ) == 0 ) {
         const long blockSize = fs.f_bsize;
         const long totalBlocks = fs.f_blocks;
         return (double)totalBlocks * blockSize;
@@ -1114,8 +1114,8 @@
         } else {
             ok = true;
         }
-        if(ok && !mountEntriesMap.keys().contains(me->mnt_dir)) {
-            mountEntriesMap[me->mnt_fsname] = me->mnt_dir;
+        if(ok && !mountEntriesMap.keys().contains(me->mnt_fsname)) {
+            mountEntriesMap[me->mnt_dir] = me->mnt_fsname;
         }

         me = getmntent(mntfp);


not all machines have a wireless dir under proc in net.

Task-number: MOBILITY-1444

--- src/systeminfo/qsysteminfo_linux_common.cpp
+++ src/systeminfo/qsysteminfo_linux_common.cpp
@@ -452,7 +452,7 @@
             const QStringList dirs = wDir.entryList(QStringList() << "*", QDir::AllDirs | QDir::NoDotAndDotDot);
             foreach(const QString dir, dirs) {
                 const QString devFile = baseSysDir + dir;
-                const QFileInfo wiFi(devFile + "/wireless");
+                const QFileInfo wiFi(devFile + "/phy80211");
                 const QFileInfo fi("/proc/net/route");
                 if(wiFi.exists() && fi.exists()) {
                     QFile rx(fi.absoluteFilePath());
@@ -583,7 +583,6 @@
     switch(mode) {
         case QSystemNetworkInfo::WlanMode:
         {
-            qDebug() << Q_FUNC_INFO;
             QString result;
             const QString baseSysDir = "/sys/class/net/";
             const QDir wDir(baseSysDir);


:retab!

:retab!

--- vexcl/backend/cuda/context.hpp
+++ vexcl/backend/cuda/context.hpp
@@ -83,7 +83,7 @@

     template <class Handle>
     void operator()(Handle handle) const {
-	if (ctx) cuda_check( cuCtxSetCurrent(ctx) );
+        if (ctx) cuda_check( cuCtxSetCurrent(ctx) );
         deleter_impl<Handle>::dispose(handle);
     }

@@ -95,9 +95,9 @@
 /// Wrapper around CUdevice.
 class device {
     public:
-	/// Empty constructor.
-	device() {}
-
+        /// Empty constructor.
+        device() {}
+
         /// Constructor.
         device(CUdevice d) : d(d) {}

@@ -204,9 +204,9 @@
 /** With the CUDA backend, this is a wrapper around CUstream. */
 class command_queue {
     public:
-	/// Empty constructor.
-	command_queue() {}
-
+        /// Empty constructor.
+        command_queue() {}
+
         /// Create command queue for the given context and device.
         command_queue(const vex::backend::context &ctx, vex::backend::device dev, unsigned flags)
             : ctx(ctx), dev(dev), s( create(ctx, flags), detail::deleter(ctx.raw()) ), f(flags)


Removed external linkage of operator<< for null_type

--- viennagrid/element/element.hpp
+++ viennagrid/element/element.hpp
@@ -897,7 +897,7 @@

-    std::ostream & operator<<(std::ostream & os, viennagrid::meta::null_type) { return os; }
+    inline std::ostream & operator<<(std::ostream & os, viennagrid::meta::null_type) { return os; }

     /** @brief Overload for the output streaming operator for the vertex type */


Fix a crash when list of devices is NULL (e.g. over VNC/NX sessions).

BUG=none
TEST=none

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

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

--- views/touchui/touch_factory.cc
+++ views/touchui/touch_factory.cc
@@ -210,7 +210,8 @@
       pointer_device_lookup_[devinfo->deviceid] = true;
     }
   }
-  XIFreeDeviceInfo(devices);
+  if (devices)
+    XIFreeDeviceInfo(devices);

   SetupValuator();
 }


MOD: Minor change in CEGuiBaseApplication to retrieve Font directly

--HG--
branch : v0-8

--- samples_framework/src/CEGuiBaseApplication.cpp
+++ samples_framework/src/CEGuiBaseApplication.cpp
@@ -294,7 +294,7 @@
         {
             d_FPSValue = d_FPSFrames;

-            CEGUI::Font* fnt = CEGUI::System::getSingleton().getDefaultGUIContext().getDefaultFont();
+            CEGUI::Font* fnt = &CEGUI::FontManager::getSingleton().get("DejaVuSans-12");
             if (!fnt)
                 return;


everything is STILL FUCKED

everything is STILL FUCKED

--- sap-flux/sapflux-v20/src/sap_flux/sap_flux.cpp
+++ sap-flux/sapflux-v20/src/sap_flux/sap_flux.cpp
@@ -60,7 +60,7 @@
 bool HANDSHAKE_SENT;
 /*==============|| MEMORY ||==============*/
 SPIFlash_Marzogh flash(8);
-uint32_t FLASH_ADDR = 0;
+uint32_t FLASH_ADDR = 100;
 uint16_t EEPROM_ADDR = 0;
 /*==============|| THERMOCOUPLE ||==============*/
 Adafruit_MAX31856 tc1 = Adafruit_MAX31856(TC1_CS);
@@ -72,8 +72,8 @@
 uint8_t sentMeasurement = 0;
 /*==============|| INTERVAL ||==============*/
 const uint8_t REC_MIN = 1; //record interval in minutes
-const uint16_t REC_MS = 60000;
-const uint16_t REC_INTERVAL = (60000*REC_MIN)/1000; //record interval in seconds
+const uint16_t REC_MS = 30000;
+const uint16_t REC_INTERVAL = (30000*REC_MIN)/1000; //record interval in seconds
 /*==============|| DATA ||==============*/
 //Data structure for transmitting the Timestamp from datalogger to sensor (4 bytes)
 struct TimeStamp {
@@ -149,7 +149,10 @@
 	uint32_t capacity = flash.getCapacity();
 	DEBUG("W25X"); DEBUG(_name); DEBUG("**  ");
 	DEBUG("capacity: "); DEBUG(capacity); DEBUGln(" bytes");
-	DEBUGln("Erasing Chip!"); flash.eraseChip();
+	DEBUGln("Erasing Chip!");
+	while(!flash.eraseChip()) {
+		DEBUGln("Erasing Chip!");
+	}
   tc1.begin(); tc2.begin(); tc3.begin();
   tc1.setThermocoupleType(MAX31856_TCTYPE_E);
   tc2.setThermocoupleType(MAX31856_TCTYPE_E);
@@ -179,12 +182,12 @@
 		if(stop_saved_time + stop_time > current_time) {
 			if (h_saved_time + h_interval < current_time){
 				if(h_status == 0) { //if it is off, turn it on
-					// digitalWrite(HEATER_EN, HIGH);
+					digitalWrite(HEATER_EN, HIGH);
 					h_interval = h_pulse_on; //wait for ON time
 					h_status = 1;
 					DEBUG("Heater - On for "); DEBUG(h_interval/1000); DEBUGln("s");
 				} else if(h_status == 1) {//if heat is on....turn it off
-						// digitalWrite(HEATER_EN, LOW);
+						digitalWrite(HEATER_EN, LOW);
 						h_interval = h_pulse_off; //wait for OFF time
 						h_status = 0;
 					DEBUG("Heater - Off for "); DEBUG(h_interval/1000); DEBUGln("s");
@@ -192,16 +195,16 @@
 				h_saved_time = current_time;
 			}
 			if(log_saved_time + log_interval < current_time) {
-				Measurement thisMeasurement;
-				thisMeasurement.time = 2500;
-				thisMeasurement.tc1 = 15;
-				thisMeasurement.tc2 = 72;
-				thisMeasurement.tc3 = 345;
+				// Measurement thisMeasurement;
+				// thisMeasurement.time = 2500;
+				// thisMeasurement.tc1 = 15;
+				// thisMeasurement.tc2 = 72;
+				// thisMeasurement.tc3 = 345;
 				delay(500);
-				if(flash.writeAnything(FLASH_ADDR, thisMeasurement)) {
+				if(flash.writeAnything(FLASH_ADDR, FLASH_ADDR)) {
 					DEBUGln("--> Data Written");
 				}
-				FLASH_ADDR += sizeof(thisMeasurement);
+				FLASH_ADDR += sizeof(FLASH_ADDR);
 				DEBUGln(FLASH_ADDR);
 				log_saved_time = current_time;
 			}


fixed a defect where fixtures from the same entity were colliding when the entity ID is 0 because groupIndex cannot be 0 when pass over is desired

--- src/engine/physics.hh
+++ src/engine/physics.hh
@@ -144,6 +144,8 @@
     }
 }

+static constexpr std::uint16_t group_index_offset = 1U;
+
 } // anonyous namespace

 template <class contact_category_t>
@@ -158,7 +160,8 @@
     result.filter.maskBits = contact.to_uint();
     if (contact.get_from_same_entity_config() == contact_result::pass_over)
     {
-	result.filter.groupIndex = entity_id * -1;
+        // to achieve pass over the groupIndex cannot be 0
+	result.filter.groupIndex = (entity_id + group_index_offset) * -1;
     }
     set_fixture_data(result, entity_id, fixture_id);
     return result;


applied patch from HARMONY-1678
[DRLVM] junit test o.a.h.crypto.tests.javax.crypto.EncryptedPrivateKeyInfoTest fails

svn path=/incubator/harmony/enhanced/drlvm/trunk/; revision=462758

--- vm/jitrino/src/jet/cg_regs.cpp
+++ vm/jitrino/src/jet/cg_regs.cpp
@@ -580,7 +580,7 @@
 void Compiler::gen_bb_leave(unsigned to)
 {
     if (is_set(DBG_TRACE_CG)) { dbg(";;>bb_leave to %d\n", to); }
-    unsigned ref_count;
+    bool targetIsMultiRef = false;
     bool to_eh;
     if (to == NOTHING || m_pc == 0 || g_jvmtiMode) {
         // leaving JSR block - act as if were leaving to multiref block
@@ -588,19 +588,32 @@
         // and gen_prolog().
         // The same for JVMTI mode - do not allow a thing to be transferred
         // on a temporary register between basic blocks
-        ref_count = 2;
+        targetIsMultiRef = true;
         to_eh = false;
     }
     else {
-        ref_count = m_insts[to].ref_count;
         const BBInfo& bbto = m_bbs[to];
         // Must be BB
         assert(m_bbs.find(to) != m_bbs.end());
         // Jumps to ehandler ?
         to_eh = bbto.ehandler;
-    }
-    // Must be reachable
-    assert(ref_count != 0);
+         // Now, check where the control flow may be transferred from the
+         // current instruction. If *any* of the targets is multi-ref, then
+         // perform a full sync.
+         const JInst& jinst = *m_curr_inst;
+         for (unsigned i=0; i<jinst.get_num_targets(); i++) {
+             unsigned targetPC = jinst.get_target(i);
+             targetIsMultiRef = targetIsMultiRef || (m_insts[targetPC].ref_count > 1);
+         }
+         if (jinst.is_switch()) {
+             unsigned targetPC = jinst.get_def_target();
+             targetIsMultiRef = targetIsMultiRef || (m_insts[targetPC].ref_count > 1);
+         }
+         if (!jinst.is_set(OPF_DEAD_END)) {
+             unsigned targetPC  = jinst.next;
+             targetIsMultiRef = targetIsMultiRef || (m_insts[targetPC].ref_count > 1);
+         }
+    }

     if (to_eh) {
         // we're generating a 'goto/fall through/if_' to a basic block
@@ -614,7 +627,7 @@
         assert(m_jframe->dip(0).is_reg() && m_jframe->dip(0).reg() == gr_ret);
     }

-    if (ref_count == 1 && !to_eh) {
+    if (!targetIsMultiRef && !to_eh) {
         // nothing to do anymore
         if (is_set(DBG_TRACE_CG)) { dbg(";;>~bb_leave\n"); }
         return;


Fixes initialization order in Element constructor

--- drake/systems/plants/collision/Element.cpp
+++ drake/systems/plants/collision/Element.cpp
@@ -20,7 +20,7 @@
 Element::Element(const Element& other)
     : DrakeShapes::Element(other),
       id(reinterpret_cast<ElementId>(this)),
-      body_(other.body_), is_static_(other.is_static_) {}
+      is_static_(other.is_static_), body_(other.body_) {}

 Element* Element::clone() const { return new Element(*this); }


Stop debug time full barriers preventing layout transitions in Vulkan RD

--- drivers/vulkan/rendering_device_vulkan.cpp
+++ drivers/vulkan/rendering_device_vulkan.cpp
@@ -7933,10 +7933,6 @@
 	//  * Some buffer is copied
 	//  * Another render pass happens (since we may be done)

-#ifdef FORCE_FULL_BARRIER
-	_full_barrier(true);
-#else
-
 	VkMemoryBarrier mem_barrier;
 	mem_barrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
 	mem_barrier.pNext = nullptr;
@@ -7947,6 +7943,8 @@
 		vkCmdPipelineBarrier(frames[frame].draw_command_buffer, src_stage, barrier_flags, 0, 1, &mem_barrier, 0, nullptr, image_barrier_count, image_barriers);
 	}

+#ifdef FORCE_FULL_BARRIER
+	_full_barrier(true);
 #endif
 }

@@ -8417,9 +8415,6 @@
 		}
 	}

-#ifdef FORCE_FULL_BARRIER
-	_full_barrier(true);
-#else
 	VkMemoryBarrier mem_barrier;
 	mem_barrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
 	mem_barrier.pNext = nullptr;
@@ -8430,6 +8425,8 @@
 		vkCmdPipelineBarrier(compute_list->command_buffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, barrier_flags, 0, 1, &mem_barrier, 0, nullptr, image_barrier_count, image_barriers);
 	}

+#ifdef FORCE_FULL_BARRIER
+	_full_barrier(true);
 #endif

 	memdelete(compute_list);


Sync fix for clear texture

Sync fix for clear texture

Make pre and post barriers non-conditional on format, as there are cases
where pending operations in the GENERAL layout hazarding with clear.

--- drivers/vulkan/rendering_device_vulkan.cpp
+++ drivers/vulkan/rendering_device_vulkan.cpp
@@ -2932,16 +2932,22 @@

 	VkCommandBuffer command_buffer = p_sync_with_draw ? frames[frame].draw_command_buffer : frames[frame].setup_command_buffer;

-	VkImageLayout layout = src_tex->layout;
-
-	if (src_tex->layout != VK_IMAGE_LAYOUT_GENERAL) { //storage may be in general state
+	VkImageLayout clear_layout = (src_tex->layout == VK_IMAGE_LAYOUT_GENERAL) ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
+
+	// NOTE: Perhaps the valid stages/accesses for a given onwner should be a property of the owner. (Here and places like _get_buffer_from_owner)
+	const VkPipelineStageFlags valid_texture_stages = VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
+	constexpr VkAccessFlags read_access = VK_ACCESS_SHADER_READ_BIT;
+	constexpr VkAccessFlags read_write_access = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
+	const VkAccessFlags valid_texture_access = (src_tex->usage_flags & TEXTURE_USAGE_STORAGE_BIT) ? read_write_access : read_access;
+
+	{ // Barrier from previous access with optional layout change (see clear_layout logic above)
 		VkImageMemoryBarrier image_memory_barrier;
 		image_memory_barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
 		image_memory_barrier.pNext = nullptr;
-		image_memory_barrier.srcAccessMask = 0;
+		image_memory_barrier.srcAccessMask = valid_texture_access;
 		image_memory_barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
 		image_memory_barrier.oldLayout = src_tex->layout;
-		image_memory_barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
+		image_memory_barrier.oldLayout = clear_layout;

 		image_memory_barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
 		image_memory_barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
@@ -2952,8 +2958,7 @@
 		image_memory_barrier.subresourceRange.baseArrayLayer = src_tex->base_layer + p_base_layer;
 		image_memory_barrier.subresourceRange.layerCount = p_layers;

-		layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
-		vkCmdPipelineBarrier(command_buffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, nullptr, 0, nullptr, 1, &image_memory_barrier);
+		vkCmdPipelineBarrier(command_buffer, valid_texture_stages, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, nullptr, 0, nullptr, 1, &image_memory_barrier);
 	}

 	VkClearColorValue clear_color;
@@ -2969,16 +2974,15 @@
 	range.baseMipLevel = src_tex->base_mipmap + p_base_mipmap;
 	range.levelCount = p_mipmaps;

-	vkCmdClearColorImage(command_buffer, src_tex->image, layout, &clear_color, 1, &range);
-
-	if (src_tex->layout != VK_IMAGE_LAYOUT_GENERAL) { //storage may be in general state
-
+	vkCmdClearColorImage(command_buffer, src_tex->image, clear_layout, &clear_color, 1, &range);
+
+	{ // Barrier to post clear accesses (changing back the layout if needed)
 		VkImageMemoryBarrier image_memory_barrier;
 		image_memory_barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
 		image_memory_barrier.pNext = nullptr;
 		image_memory_barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
-		image_memory_barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
-		image_memory_barrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
+		image_memory_barrier.dstAccessMask = valid_texture_access;
+		image_memory_barrier.oldLayout = clear_layout;
 		image_memory_barrier.newLayout = src_tex->layout;

 		image_memory_barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
@@ -2990,7 +2994,7 @@
 		image_memory_barrier.subresourceRange.baseArrayLayer = src_tex->base_layer + p_base_layer;
 		image_memory_barrier.subresourceRange.layerCount = p_layers;

-		vkCmdPipelineBarrier(command_buffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, 0, nullptr, 1, &image_memory_barrier);
+		vkCmdPipelineBarrier(command_buffer, VK_PIPELINE_STAGE_TRANSFER_BIT, valid_texture_stages, 0, 0, nullptr, 0, nullptr, 1, &image_memory_barrier);
 	}

 	return OK;


Ignore detector cache and thickness in escape calculation.

--- src/fisx_detector.cpp
+++ src/fisx_detector.cpp
@@ -143,7 +143,7 @@
                                                                      this->escapePeakIntensityThreshold, \
                                                                      this->escapePeakNThreshold, \
                                                                      this->escapePeakAlphaIn,
-                                                                     this->getThickness());
+                                                                     0);
         }
         return this->escapePeakCache[label];
     }
@@ -155,7 +155,7 @@
                                          this->escapePeakIntensityThreshold, \
                                          this->escapePeakNThreshold, \
                                          this->escapePeakAlphaIn,
-                                         this->getThickness());
+                                         0);
     }
 }


glsl/cs: Fix local_size_y and local_size_z

flags.q.local_size has 3 bits. One each for x, y and z.

Fixes piglit's:
* spec/ARB_compute_shader/linker/mismatched_local_work_sizes
* spec/ARB_compute_shader/compiler/default_local_size.comp
* spec/ARB_compute_shader/compiler/work_group_size_too_large
* spec/ARB_compute_shader/compiler/gl_WorkGroupSize_matches_layout.comp

This was regressed in 738c9c3c.

Signed-off-by: Jordan Justen <a79006884ba9cf5f4f7fcbb92a15b208780d8c97@intel.com>
Reviewed-by: Chris Forbes <5dcac483e7a6e31a5cbe89f38cc69dff8ee93dac@ijw.co.nz>

--- src/glsl/ast_type.cpp
+++ src/glsl/ast_type.cpp
@@ -247,7 +247,7 @@
          q.flags.q.local_size != 0 &&
          state->in_qualifier->flags.q.local_size == 0;

-      valid_in_mask.flags.q.local_size = 1;
+      valid_in_mask.flags.q.local_size = 7;
       break;
    default:
       _mesa_glsl_error(loc, state,


Remove unnecessary ptr derefs int r7411 (deref result is not used).

--- src/gpu/GrContext.cpp
+++ src/gpu/GrContext.cpp
@@ -1409,7 +1409,7 @@
                 GrDrawTarget::AutoStateRestore asr(fGpu, GrDrawTarget::kReset_ASRInit);
                 GrDrawState* drawState = fGpu->drawState();
                 GrAssert(effect);
-                *drawState->setEffect(0, effect);
+                drawState->setEffect(0, effect);

                 drawState->setRenderTarget(texture->asRenderTarget());
                 GrRect rect = GrRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
@@ -1627,7 +1627,7 @@
     GrDrawTarget::AutoStateRestore  asr(fGpu, GrDrawTarget::kReset_ASRInit);
     GrDrawState* drawState = fGpu->drawState();
     GrAssert(effect);
-    *drawState->setEffect(0, effect);
+    drawState->setEffect(0, effect);

     SkMatrix matrix;
     matrix.setTranslate(SkIntToScalar(left), SkIntToScalar(top));


Remove unused vars

Remove unused vars

--- src/gpu/GrContext.cpp
+++ src/gpu/GrContext.cpp
@@ -441,8 +441,6 @@
     GrResource* resource = NULL;
     int origWidth = desc.fWidth;
     int origHeight = desc.fHeight;
-    bool doubledW = false;
-    bool doubledH = false;

     do {
         GrResourceKey key = GrTexture::ComputeScratchKey(desc);


On some Linux distros, you need to explicitly #include <limits.h> to get
the definition of PATH_MAX. This patch adds it in the appropriate place.

git-svn-id: 2c9a99be47d0e569b9832cc4192b2d4c0ac487c7@108 861a406c-534a-0410-8894-cb66d6ee9925

--- src/gtest-filepath.cc
+++ src/gtest-filepath.cc
@@ -45,6 +45,7 @@
 #include <sys/syslimits.h>
 #include <unistd.h>
 #else
+#include <limits.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #endif // _WIN32_WCE or _WIN32


Added comments

Added comments

--- src/gui/GuiButton.cpp
+++ src/gui/GuiButton.cpp
@@ -4,7 +4,7 @@

 #include "GuiButton.h"

-GuiButton::GuiButton(double x, double y, double width, double height) {
+GuiButton::GuiButton(double x, double y, double width, double height) { //TODO add some "placement" flag (TOP-RIGHT, MIDDLE-RIGHT, BOTTOM-RIGHT, etc.)
     this->x = x;
     this->y = y;
     this->width = width;


comment todo map draw foreground

comment todo map draw foreground

--- src/gusanos/level.cpp
+++ src/gusanos/level.cpp
@@ -265,6 +265,11 @@
 	if(bmpDrawImage.get())
 		blit(bmpDrawImage.get(), where, x*2, y*2, 0, 0, where->w, where->h);

+	// TODO: Actually, it was correct in viewport.cpp, because it could
+	// potentially shadow objects (that was its whole purpose).
+	// Thus, move out again...
+	// However, the worm HUD (crossair) should not be covered by this
+	// (as earlier).
 	if(bmpForeground.get())
 		blit(bmpForeground.get(), where, x*2, y*2, 0, 0, where->w, where->h);


IO/File: exists doesn't belong on prototype (And this time remove it from the proto not the ctor)

--- src/io/file_class.cpp
+++ src/io/file_class.cpp
@@ -65,6 +65,7 @@

 void file_class::class_info::augment_constructor(object constructor) {
   create_native_function(constructor, "create", &impl::create);
+  create_native_function(constructor, "exists", &impl::exists);
 }

 object file_class::class_info::create_prototype() {
@@ -74,7 +75,6 @@

   create_native_method(proto, "open", 1);
   create_native_method(proto, "close", 0);
-  create_native_method(proto, "exists", 0);

   return proto;
 }


Updating IF_RWR_RRD_MRD_CNS and IF_RWR_RRD_SRD_CNS to encode reg2, rather than reg1, in 3456

--- src/jit/emitxarch.cpp
+++ src/jit/emitxarch.cpp
@@ -12043,7 +12043,6 @@
         case IF_RRD_SRD:
         case IF_RWR_SRD:
         case IF_RRW_SRD:
-        case IF_RWR_RRD_SRD:
             code = insCodeRM(ins);

             // 4-byte AVX instructions are special cased inside emitOutputSV
@@ -12051,39 +12050,6 @@
             if (Is4ByteAVXInstruction(ins))
             {
                 dst = emitOutputSV(dst, id, code);
-            }
-            else
-            {
-                code = AddVexPrefixIfNeeded(ins, code, size);
-
-                if (IsDstDstSrcAVXInstruction(ins))
-                {
-                    regNumber src1 = id->idReg2();
-
-                    if (id->idInsFmt() != IF_RWR_RRD_SRD)
-                    {
-                        src1 = id->idReg1();
-                    }
-
-                    // encode source operand reg in 'vvvv' bits in 1's compliement form
-                    code = insEncodeReg3456(ins, src1, size, code);
-                }
-
-                regcode = (insEncodeReg345(ins, id->idReg1(), size, &code) << 8);
-                dst     = emitOutputSV(dst, id, code | regcode);
-            }
-            break;
-
-        case IF_RWR_RRD_SRD_CNS:
-        {
-            emitGetInsCns(id, &cnsVal);
-            code = insCodeRM(ins);
-
-            // 4-byte AVX instructions are special cased inside emitOutputSV
-            // since they do not have space to encode ModRM byte.
-            if (Is4ByteAVXInstruction(ins))
-            {
-                dst = emitOutputSV(dst, id, code, &cnsVal);
             }
             else
             {
@@ -12094,6 +12060,58 @@
                     // encode source operand reg in 'vvvv' bits in 1's compliement form
                     code = insEncodeReg3456(ins, id->idReg1(), size, code);
                 }
+
+                regcode = (insEncodeReg345(ins, id->idReg1(), size, &code) << 8);
+                dst     = emitOutputSV(dst, id, code | regcode);
+            }
+            break;
+
+        case IF_RWR_RRD_SRD:
+        {
+            // This should only be called on AVX instructions
+            assert(IsAVXInstruction(ins));
+
+            code = insCodeRM(ins);
+
+            // 4-byte AVX instructions are special cased inside emitOutputSV
+            // since they do not have space to encode ModRM byte.
+            if (Is4ByteAVXInstruction(ins))
+            {
+                dst = emitOutputSV(dst, id, code);
+            }
+            else
+            {
+                code = AddVexPrefixIfNeeded(ins, code, size);
+
+                // encode source operand reg in 'vvvv' bits in 1's compliement form
+                code = insEncodeReg3456(ins, id->idReg2(), size, code);
+
+                regcode = (insEncodeReg345(ins, id->idReg1(), size, &code) << 8);
+                dst     = emitOutputSV(dst, id, code | regcode);
+            }
+            break;
+        }
+
+        case IF_RWR_RRD_SRD_CNS:
+        {
+            // This should only be called on AVX instructions
+            assert(IsAVXInstruction(ins));
+
+            emitGetInsCns(id, &cnsVal);
+            code = insCodeRM(ins);
+
+            // 4-byte AVX instructions are special cased inside emitOutputSV
+            // since they do not have space to encode ModRM byte.
+            if (Is4ByteAVXInstruction(ins))
+            {
+                dst = emitOutputSV(dst, id, code, &cnsVal);
+            }
+            else
+            {
+                code = AddVexPrefixIfNeeded(ins, code, size);
+
+                // encode source operand reg in 'vvvv' bits in 1's compliement form
+                code = insEncodeReg3456(ins, id->idReg2(), size, code);

                 regcode = (insEncodeReg345(ins, id->idReg1(), size, &code) << 8);
                 dst     = emitOutputSV(dst, id, code | regcode, &cnsVal);
@@ -12188,45 +12206,11 @@
         case IF_RRD_MRD:
         case IF_RWR_MRD:
         case IF_RRW_MRD:
-        case IF_RWR_RRD_MRD:
             code = insCodeRM(ins);
             // Special case 4-byte AVX instructions
             if (Is4ByteAVXInstruction(ins))
             {
                 dst = emitOutputCV(dst, id, code);
-            }
-            else
-            {
-                code = AddVexPrefixIfNeeded(ins, code, size);
-
-                if (IsDstDstSrcAVXInstruction(ins))
-                {
-                    regNumber src1 = id->idReg2();
-
-                    if (id->idInsFmt() != IF_RWR_RRD_MRD)
-                    {
-                        src1 = id->idReg1();
-                    }
-
-                    // encode source operand reg in 'vvvv' bits in 1's compliement form
-                    code = insEncodeReg3456(ins, src1, size, code);
-                }
-
-                regcode = (insEncodeReg345(ins, id->idReg1(), size, &code) << 8);
-                dst     = emitOutputCV(dst, id, code | regcode | 0x0500);
-            }
-            sz = emitSizeOfInsDsc(id);
-            break;
-
-        case IF_RWR_RRD_MRD_CNS:
-        {
-            emitGetInsCns(id, &cnsVal);
-            code = insCodeRM(ins);
-
-            // Special case 4-byte AVX instructions
-            if (Is4ByteAVXInstruction(ins))
-            {
-                dst = emitOutputCV(dst, id, code, &cnsVal);
             }
             else
             {
@@ -12237,6 +12221,58 @@
                     // encode source operand reg in 'vvvv' bits in 1's compliement form
                     code = insEncodeReg3456(ins, id->idReg1(), size, code);
                 }
+
+                regcode = (insEncodeReg345(ins, id->idReg1(), size, &code) << 8);
+                dst     = emitOutputCV(dst, id, code | regcode | 0x0500);
+            }
+            sz = emitSizeOfInsDsc(id);
+            break;
+
+        case IF_RWR_RRD_MRD:
+        {
+            // This should only be called on AVX instructions
+            assert(IsAVXInstruction(ins));
+
+            code = insCodeRM(ins);
+
+            // Special case 4-byte AVX instructions
+            if (Is4ByteAVXInstruction(ins))
+            {
+                dst = emitOutputCV(dst, id, code);
+            }
+            else
+            {
+                code = AddVexPrefixIfNeeded(ins, code, size);
+
+                // encode source operand reg in 'vvvv' bits in 1's compliement form
+                code = insEncodeReg3456(ins, id->idReg2(), size, code);
+
+                regcode = (insEncodeReg345(ins, id->idReg1(), size, &code) << 8);
+                dst     = emitOutputCV(dst, id, code | regcode | 0x0500);
+            }
+            sz = emitSizeOfInsDsc(id);
+            break;
+        }
+
+        case IF_RWR_RRD_MRD_CNS:
+        {
+            // This should only be called on AVX instructions
+            assert(IsAVXInstruction(ins));
+
+            emitGetInsCns(id, &cnsVal);
+            code = insCodeRM(ins);
+
+            // Special case 4-byte AVX instructions
+            if (Is4ByteAVXInstruction(ins))
+            {
+                dst = emitOutputCV(dst, id, code, &cnsVal);
+            }
+            else
+            {
+                code = AddVexPrefixIfNeeded(ins, code, size);
+
+                // encode source operand reg in 'vvvv' bits in 1's compliement form
+                code = insEncodeReg3456(ins, id->idReg2(), size, code);

                 regcode = (insEncodeReg345(ins, id->idReg1(), size, &code) << 8);
                 dst     = emitOutputCV(dst, id, code | regcode | 0x0500, &cnsVal);