fix client/server event opcodes

fix client/server event opcodes

--- src/common/Network/PacketDef/Ipcs.h
+++ src/common/Network/PacketDef/Ipcs.h
@@ -151,7 +151,7 @@
     SilentSetClassJob = 0x018E, // updated 5.0 - seems to be the case, not sure if it's actually used for anything
     PlayerSetup = 0x018F, // updated 5.0
     PlayerStats = 0x0190, // updated 5.0
-    ActorOwner = 0x0191, // updated 5.0
+    ActorOwner = 0x0192, // updated 5.0
     PlayerStateFlags = 0x0193, // updated 5.0
     PlayerClassInfo = 0x0194, // updated 5.0

@@ -177,8 +177,8 @@
     DirectorPlayScene = 0x01B9, // updated 5.0
     EventOpenGilShop = 0x01BC, // updated 5.0

-    EventStart = 0x01B4, // updated 4.5
-    EventFinish = 0x01B5, // updated 4.5
+    EventStart = 0x01BE, // updated 5.0
+    EventFinish = 0x01BF, // updated 5.0

     EventLinkshell = 0x1169,

@@ -201,9 +201,9 @@

     CFAvailableContents = 0xF1FD, // updated 4.2

-    WeatherChange = 0x0205, // updated 4.5
-    PlayerTitleList = 0x0206, // updated 4.5?
-    Discovery = 0x0207, // updated 4.5?
+    WeatherChange = 0x0210, // updated 5.0
+    PlayerTitleList = 0x0211, // updated 5.0
+    Discovery = 0x0212, // updated 5.0

     EorzeaTimeOffset = 0x0209, // updated 4.5

@@ -328,34 +328,34 @@
     UpdatePositionHandler = 0x0141, // updated 5.0
     UpdatePositionInstance = 0x0183, // updated 4.3

-    InventoryModifyHandler = 0x0146, // updated 4.5 ( +4 )
-
-    ReqPlaceHousingItem = 0x149, // updated 4.5
-
-    BuildPresetHandler = 0x014E, // updated 4.5
-    TalkEventHandler = 0x014F, // updated 4.5
-    EmoteEventHandler = 0x0150, // updated 4.5
-    WithinRangeEventHandler = 0x0151, // updated 4.5
-    OutOfRangeEventHandler = 0x0152, // updated 4.5
-    EnterTeriEventHandler = 0x0153, // updated 4.5
-
-    ShopEventHandler = 0x0155, // updated 4.5
-
-    ReturnEventHandler = 0x0158, // updated 4.5
-    TradeReturnEventHandler = 0x0159, // updated 4.5
+    InventoryModifyHandler = 0x0148, // updated 5.0
+
+    ReqPlaceHousingItem = 0x014B, // updated 5.0
+    BuildPresetHandler = 0x014F, // updated 5.0
+
+    TalkEventHandler = 0x0151, // updated 5.0
+    EmoteEventHandler = 0x0152, // updated 5.0
+    WithinRangeEventHandler = 0x0153, // updated 5.0
+    OutOfRangeEventHandler = 0x0154, // updated 5.0
+    EnterTeriEventHandler = 0x0155, // updated 5.0
+    ShopEventHandler = 0x0156, // updated 5.0
+
+    ReturnEventHandler = 0x015A, // updated 5.0?
+    TradeReturnEventHandler = 0x015B, // updated 5.0?

     LinkshellEventHandler = 0x016B, // updated 4.5
     LinkshellEventHandler1 = 0x016C, // updated 4.5

-    LandRenameHandler = 0x0175, // updated 4.5
-    HousingUpdateHouseGreeting = 0x0176, // updated 4.5
-    HousingUpdateObjectPosition = 0x0177, // updated 4.5
-
-    SetSharedEstateSettings = 0x017B, // updated 4.5
+    ReqEquipDisplayFlagsChange = 0x0175, // updated 5.0
+
+    LandRenameHandler = 0x0177, // updated 5.0
+    HousingUpdateHouseGreeting = 0x0178, // updated 5.0
+    HousingUpdateObjectPosition = 0x0179, // updated 5.0
+
+    SetSharedEstateSettings = 0x017B, // updated 5.0

     PerformNoteHandler = 0x029B, // updated 4.3

-    ReqEquipDisplayFlagsChange = 0x0173, // updated 4.5

   };


Preset the *error to NULL so the child doesn't have to do it

--- gst-libs/gst/farsight/fs-session.c
+++ gst-libs/gst/farsight/fs-session.c
@@ -403,6 +403,8 @@
   g_return_val_if_fail (g_type_is_a (G_OBJECT_TYPE (session),
               FS_TYPE_SESSION), NULL);

+  *error = NULL;
+
   if (klass->new_stream) {
     new_stream = klass->new_stream (session, participant, direction,
         error);
@@ -507,6 +509,8 @@
 {
   FsSessionClass *klass = FS_SESSION_GET_CLASS (session);

+  *error = NULL;
+
   if (klass->set_send_codec) {
     return klass->set_send_codec (session, send_codec, error);
   } else {


Added ORB

Added ORB

--- src/OpenCvSharpExtern/features2d.h
+++ src/OpenCvSharpExtern/features2d.h
@@ -85,7 +85,6 @@
 {
 	(*obj)(*image, entity(mask), *keypoints);
 }
-
 CVAPI(void) features2d_BRISK_run2(cv::BRISK *obj, cv::_InputArray *image, cv::_InputArray *mask,
 	std::vector<cv::KeyPoint> *keypoints, cv::_OutputArray *descriptors, int useProvidedKeypoints)
 {
@@ -109,6 +108,45 @@
 		std::vector<int> &numberList, float dMax = 5.85f, float dMin = 8.2f,
 		std::vector<int> indexChange = std::vector<int>());
 */
+#pragma endregion
+
+#pragma region ORB
+
+CVAPI(cv::ORB*) features2d_ORB_new(int nFeatures, float scaleFactor, int nlevels, int edgeThreshold,
+	int firstLevel, int wtaK, int scoreType, int patchSize)
+{
+	return new cv::ORB(nFeatures, scaleFactor, nlevels, edgeThreshold,
+		firstLevel, wtaK, scoreType, patchSize);
+}
+CVAPI(void) features2d_ORB_delete(cv::ORB *obj)
+{
+	delete obj;
+}
+
+CVAPI(int) features2d_ORB_descriptorSize(cv::ORB *obj)
+{
+	return obj->descriptorSize();
+}
+CVAPI(int) features2d_ORB_descriptorType(cv::ORB *obj)
+{
+	return obj->descriptorType();
+}
+
+CVAPI(void) features2d_ORB_run1(cv::ORB *obj, cv::_InputArray *image, cv::_InputArray *mask,
+	std::vector<cv::KeyPoint> *keypoints)
+{
+	(*obj)(*image, entity(mask), *keypoints);
+}
+CVAPI(void) features2d_ORB_run2(cv::ORB *obj, cv::_InputArray *image, cv::_InputArray *mask,
+	std::vector<cv::KeyPoint> *keypoints, cv::_OutputArray *descriptors, int useProvidedKeypoints)
+{
+	(*obj)(*image, entity(mask), *keypoints, *descriptors, useProvidedKeypoints != 0);
+}
+
+CVAPI(cv::AlgorithmInfo*) features2d_ORB_info(cv::ORB *obj)
+{
+	return obj->info();
+}
 #pragma endregion

 #pragma region MSER


Fixed compile errors on GPU

Fixed compile errors on GPU

--- cnn/tensor.h
+++ cnn/tensor.h
@@ -152,13 +152,14 @@
   template<class Archive>
   void save(Archive& ar, const unsigned int ver) const {
     ar & d;
-    ar & ((device == default_device) ? (int)-1 : device->device_id);
+    int dev_id = ((device == default_device) ? (int)-1 : device->device_id);
+    ar & dev_id;
     ar & mem_pool;
 #ifdef HAVE_CUDA
     if(device->type == DeviceType::GPU) {
       float* vc = static_cast<float*>(std::malloc(d.size() * sizeof(float)));
       CUDA_CHECK(cudaMemcpyAsync(vc, v, d.size() * sizeof(float), cudaMemcpyDeviceToHost));
-      ar & boost::serialization::make_array(vc, mem.size());
+      ar & boost::serialization::make_array(vc, d.size());
       free(vc);
     } else {
       ar & boost::serialization::make_array(v, d.size());


Drop references when destroying the cache.

--- xcodec/xcodec_cache.h
+++ xcodec/xcodec_cache.h
@@ -52,7 +52,15 @@
 	{ }

 	~XCodecCache()
-	{ }
+	{
+		segment_hash_map_t::iterator it;
+		while ((it = segment_hash_map_.begin()) != segment_hash_map_.end()) {
+			BufferSegment *seg = it->second;
+
+			seg->unref();
+			segment_hash_map_.erase(it);
+		}
+	}

 	void enter(const uint64_t& hash, BufferSegment *seg)
 	{


[stdlib] Linux definition of pthread_key_t

--- stdlib/public/SwiftShims/LibcShims.h
+++ stdlib/public/SwiftShims/LibcShims.h
@@ -113,8 +113,11 @@

 // TLS - thread local storage

-// FIXME: multi-platform
+#if defined(__linux__)
+typedef unsigned int __swift_pthread_key_t;
+#else
 typedef unsigned long __swift_pthread_key_t;
+#endif

 SWIFT_RUNTIME_STDLIB_INTERFACE
 int _swift_stdlib_pthread_key_create(


Allow frequency band-specific overrides

Allow frequency band-specific overrides

--- cpu/cc26xx-cc13xx/rf-core/smartrf-settings.c
+++ cpu/cc26xx-cc13xx/rf-core/smartrf-settings.c
@@ -30,6 +30,7 @@
 /*---------------------------------------------------------------------------*/
 #include "contiki-conf.h"

+#include "rf-core/dot-15-4g.h"
 #include "driverlib/rf_mailbox.h"
 #include "driverlib/rf_common_cmd.h"
 #include "driverlib/rf_prop_cmd.h"
@@ -40,6 +41,12 @@
 #define SMARTRF_SETTINGS_BOARD_OVERRIDES SMARTRF_SETTINGS_CONF_BOARD_OVERRIDES
 #else
 #define SMARTRF_SETTINGS_BOARD_OVERRIDES
+#endif
+/*---------------------------------------------------------------------------*/
+#ifdef SMARTRF_SETTINGS_CONF_BAND_OVERRIDES
+#define SMARTRF_SETTINGS_BAND_OVERRIDES SMARTRF_SETTINGS_CONF_BAND_OVERRIDES
+#else
+#define SMARTRF_SETTINGS_BAND_OVERRIDES
 #endif
 /*---------------------------------------------------------------------------*/
 #ifdef SMARTRF_SETTINGS_CONF_OVERRIDE_RSSI_OFFSET
@@ -132,6 +139,9 @@

   /* Board-specific overrides, if any */
   SMARTRF_SETTINGS_BOARD_OVERRIDES
+
+  /* Band-specific overrides, if any */
+  SMARTRF_SETTINGS_BAND_OVERRIDES

   (uint32_t)0xFFFFFFFF,
 };


fix to verify

fix to verify

--- tutorials/verify/rtcore_helpers.h
+++ tutorials/verify/rtcore_helpers.h
@@ -569,7 +569,7 @@

   inline std::string to_string(RTCAccelFlags accel_flags)
   {
-    if      (accel_flags == (RTCAccelFlags) 0) return "DefaultAccel";
+    if      (accel_flags == RTC_ACCEL_FAST) return "FastAccel";
     else if (accel_flags == RTC_ACCEL_COMPACT) return "CompactAccel";
     else if (accel_flags == RTC_ACCEL_ROBUST ) return "RobustAccel";
     else if (accel_flags == (RTCAccelFlags)(RTC_ACCEL_COMPACT | RTC_ACCEL_ROBUST)) return "CompactRobust";


move to sleep not nanosleep..

move to sleep not nanosleep..

--- APPS/tcl_tester/sctp_tcl_test_app.c
+++ APPS/tcl_tester/sctp_tcl_test_app.c
@@ -90,7 +90,7 @@
 {
 	printf("Usage: %s [ options ]\n", who);
 	printf("Current options:\n");
-	printf("-D time         - Delay time in ms between new sockets at assoc failures (def = 100ms)\n");
+	printf("-D time         - Delay time in seconds between new sockets at assoc failures/terms (def = 1s)\n");
 	printf("-m myport       - Set my port to bind to (defaults to 2222)\n");
 	printf("-B ip-address   - Bind the specified address (else bindall)\n");
 	printf("-s size         - send data at start of an assoc size is data write size (def none)\n");
@@ -127,7 +127,7 @@
 uint32_t sends_out = 0;
 uint32_t sends_ping_resp = 0;

-struct timespec mydelay;
+unsigned int mydelay;
 struct sctp_sndrcvinfo sinfo_in, sinfo_out;

 /* Max message sizes */
@@ -535,8 +535,7 @@
 	remote_port = local_port = htons(2222);
 	memset(&addr, 0, sizeof(addr));
 	memset(&bindto, 0, sizeof(bindto));
-	memset(&mydelay, 0, sizeof(mydelay));
-	mydelay.tv_nsec = 100 * 1000000;
+	mydelay = 1;

 	bindto.sa.sa_family = AF_INET6;
 	bindto.sa.sa_len = sizeof(struct sockaddr_in6);
@@ -545,14 +544,10 @@
 	while((i= getopt(argc, argv,"lSLs:c:46m:p:vB:h:D?")) != EOF) {
 		switch(i) {
 		case 'D':
-			timeof = strtol(optarg, NULL, 0);
-			mydelay.tv_sec = 0;
-
-			while(timeof > 1000000) {
-				mydelay.tv_sec++;
-				timeof -= 1000000;
-			}
-			mydelay.tv_nsec = timeof * 1000000;
+			mydelay = strtoul(optarg, NULL, 0);
+			if (mydelay == 0) {
+				printf("Warning, test app may not function/fail without some delay\n");
+			}
 			break;
 		case 'l':
 			listen_only = 1;
@@ -686,8 +681,8 @@
 		} else {
 			printf("I will NOT send any data at association startup\n");
 		}
-		printf("I will mydelay %d.%6.6d between any assoc failure to restart attempt\n",
-		       mydelay.tv_sec, (mydelay.tv_nsec/1000000));
+		printf("I will mydelay %d. seconds between any assoc failure to restart attempt\n",
+		       mydelay);
 	}
 	if ((listen_only == 0) && ((dest_addr_set == 0)  || (dest_port_set == 0))) {
 		printf("You must set -h and -p if you do not use -l\n");
@@ -748,9 +743,6 @@
 			} else {
 				if(sctp_connectx(sd, &addr.sa, 1, &sinfo_out.sinfo_assoc_id) < 0) {
 					printf("Connect fails error:%d - next loop\n", errno);
-					mydelay.tv_sec++;
-					nanosleep(&mydelay, NULL);
-					mydelay.tv_sec--;
 					goto next_loop;
 				}
 				printf("Associd:0x%x - Attempt to connect to:", sinfo_out.sinfo_assoc_id);
@@ -772,7 +764,8 @@
 		}
 	next_loop:
 		close(sd);
-		nanosleep(&mydelay, NULL);
+		if(mydelay)
+			sleep(mydelay);
 		notDone = 1;
 		msg_in_cnt = msg_in_cnt_weor = notify_in_cnt = sends_out = sends_ping_resp = 0;
 	}


Added #include "integer.h".

Added #include "integer.h".

--- src/compiler/parsetree/parsenodes.h
+++ src/compiler/parsetree/parsenodes.h
@@ -33,6 +33,7 @@
 #include "store/api/item.h"

 #include "zorbatypes/decimal.h"
+#include "zorbatypes/integer.h"
 #include "zorbatypes/floatimpl.h"
 #include "zorbatypes/rchandle.h"
 #include "zorbatypes/schema_types.h"


AsyncFunction: fix creation of async function with retval and external execution tester

--- stingraykit/function/AsyncFunction.h
+++ stingraykit/function/AsyncFunction.h
@@ -63,18 +63,22 @@
 		protected:
 			ITaskExecutorPtr		_executor;
 			FunctorType				_func;
-			TaskLifeToken			_token;
+			FutureExecutionTester	_tester;

 		protected:
 			AsyncFunctionBase(const ITaskExecutorPtr& executor, const FunctorType& func)
-				: _executor(STINGRAYKIT_REQUIRE_NOT_NULL(executor)), _func(func)
+				: _executor(STINGRAYKIT_REQUIRE_NOT_NULL(executor)), _func(func), _tester(null)
+			{ }
+
+			AsyncFunctionBase(const ITaskExecutorPtr& executor, const FunctorType& func, const FutureExecutionTester& tester)
+				: _executor(STINGRAYKIT_REQUIRE_NOT_NULL(executor)), _func(func), _tester(tester)
 			{ }

 			template < typename BoundFunctor >
 			RetType DoAddTask(const BoundFunctor& func) const
 			{
 				const PromiseTypePtr promise = make_shared_ptr<PromiseType>();
-				_executor->AddTask(Bind(&AsyncFunctionBase::FuncWrapper<BoundFunctor>, func, promise), _token.GetExecutionTester());
+				_executor->AddTask(Bind(&AsyncFunctionBase::FuncWrapper<BoundFunctor>, func, promise), _tester);
 				return promise->get_future();
 			}


fix reference handling error in _n_reap()

--- noun/nock.c
+++ noun/nock.c
@@ -2457,23 +2457,27 @@
 static void
 _n_reap(u3_noun kev)
 {
-  u3_noun fol = u3h(kev);
-  u3_noun got = u3t(kev);
-  u3_noun lof = u3a_take(fol);
-  u3_noun tog;
-  u3_weak con = u3h_get(u3R->byc.har_p, lof);
-  u3n_prog* pog_u = u3to(u3n_prog, got);
-
-  if ( u3_none == con ) {
-    tog = u3a_outa(_n_prog_take(pog_u));
-    u3h_put(u3R->byc.har_p, lof, tog);
+  u3_post   val;
+  u3n_prog* pog_u = u3to(u3n_prog, u3t(kev));
+
+  // we must always take
+  u3_noun key = u3a_take(u3h(kev));
+  // because u3h_git will gain the key
+  u3_weak got = u3h_git(u3R->byc.har_p, key);
+
+  if ( u3_none == got ) {
+    val = u3a_outa(_n_prog_take(pog_u));
   }
   else {
-    u3n_prog* sep_u = u3to(u3n_prog, con);
+    u3n_prog* sep_u = u3to(u3n_prog, got);
     _n_prog_take_dat(sep_u, pog_u, c3y);
-    tog = u3a_outa(sep_u);
-  }
-  u3z(lof);
+    val = u3a_outa(sep_u);
+  }
+  // we must always put, because we have taken.
+  // we must always keep what we have taken,
+  // or we can break relocation pointers.
+  u3h_put(u3R->byc.har_p, key, val);
+  u3z(key);
 }

 /* u3n_reap(): promote bytecode state.


Add generic UndoCommand implementation that accepts Lambdas like a real man.

error: pathspec 'src/Qumulus/Gui/Core/UndoCommand.h' did not match any file(s) known to git

--- src/Qumulus/Gui/Core/UndoCommand.h
+++ src/Qumulus/Gui/Core/UndoCommand.h
@@ -0,0 +1,32 @@
+/*
+ * Qumulus UML editor
+ * Author: Randy Thiemann
+ *
+ */
+
+#ifndef GUI_CORE_UNDOCOMMAND_H_
+#define GUI_CORE_UNDOCOMMAND_H_
+
+#include "internal_base.h"
+#include <QtWidgets/QUndoCommand>
+#include <functional>
+
+QUML_BEGIN_NAMESPACE_GC
+
+class UndoCommand : public QUndoCommand {
+public:
+    UndoCommand(const QString& text,
+            std::function<void()> undo, std::function<void()> redo) :
+        QUndoCommand(text), mUndo(undo), mRedo(redo) {}
+    void undo() override { mUndo(); }
+    void redo() override { mRedo(); }
+
+private:
+    std::function<void()> mUndo;
+    std::function<void()> mRedo;
+};
+
+QUML_END_NAMESPACE_GC
+
+#endif /* GUI_CORE_UNDOCOMMAND_H_ */
+


Don't update meta flash if content is the same.

--- uCOS-III-Ex4/uC-Exosite/exosite.c
+++ uCOS-III-Ex4/uC-Exosite/exosite.c
@@ -146,7 +146,11 @@
 void Exosite_SetCIK(CPU_CHAR * pCIK)
 {
     rdk_meta *meta_info = (rdk_meta *)RDK_META_LOCATION;
-    rdk_meta_write(pCIK, CIK_LENGTH, meta_info->cik);
+
+    if (0 != Str_Cmp_N((CPU_CHAR*)meta_info->cik, pCIK, CIK_LENGTH))
+    {
+        rdk_meta_write(pCIK, CIK_LENGTH, meta_info->cik);
+    }
     Str_Copy_N(CIK, pCIK, CIK_LENGTH);
 }

@@ -640,15 +644,19 @@
             if (6 == i)
             {
                 rdk_meta *meta_info = (rdk_meta *)RDK_META_LOCATION;
-                rdk_meta_write(server_ip, 6, meta_info->server);
-
-                // Convert stored copy to something usable
-                IP   =  server_ip[0] * 16777216
-                      + server_ip[1] * 65536
-                      + server_ip[2] * 256
-                      + server_ip[3] * 1;
-                PORT =  server_ip[4] * 256
-                      + server_ip[5] * 1;
+
+                if (0 != Str_Cmp_N((CPU_CHAR*)meta_info->server, server_ip, 6))
+                {
+                    rdk_meta_write(server_ip, 6, meta_info->server);
+
+                    // Convert stored copy to something usable
+                    IP   =  server_ip[0] * 16777216
+                          + server_ip[1] * 65536
+                          + server_ip[2] * 256
+                          + server_ip[3] * 1;
+                    PORT =  server_ip[4] * 256
+                          + server_ip[5] * 1;
+                }
             }
         }
     }


Cleanup

Cleanup

--- Eigen/src/Core/GenericPacketMath.h
+++ Eigen/src/Core/GenericPacketMath.h
@@ -437,15 +437,15 @@

 /** \internal \returns the ln(|gamma(\a a)|) (coeff-wise) */
 template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
-Packet plgamma(const Packet& a) { return numext::lgamma(a); }
+Packet plgamma(const Packet& a) { using numext::lgamma; return lgamma(a); }

 /** \internal \returns the erf(\a a) (coeff-wise) */
 template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
-Packet perf(const Packet& a) { return numext::erf(a); }
+Packet perf(const Packet& a) { using numext::erf; return erf(a); }

 /** \internal \returns the erfc(\a a) (coeff-wise) */
 template<typename Packet> EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
-Packet perfc(const Packet& a) { return numext::erfc(a); }
+Packet perfc(const Packet& a) { using numext::erfc; return erfc(a); }

 /***************************************************************************
 * The following functions might not have to be overwritten for vectorized types


Follow up r1206: don't register clean_conn as child_cleanup.
In the case an application using serf execs a child process,
this causes the child close socket(s) still used/needed by
the parent.

This fixes subversion issue #3424.

* outgoing.c
  (serf_connection_create): don't register a child-exec cleanup
   handler for connections.

git-svn-id: 683495cb1553624b05a54e2ba9533425f69cf277@1274 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845

--- outgoing.c
+++ outgoing.c
@@ -932,7 +932,7 @@
     apr_pool_create(&conn->skt_pool, conn->pool);

     /* register a cleanup */
-    apr_pool_cleanup_register(conn->pool, conn, clean_conn, clean_conn);
+    apr_pool_cleanup_register(conn->pool, conn, clean_conn, apr_pool_cleanup_null);

     /* Add the connection to the context. */
     *(serf_connection_t **)apr_array_push(ctx->conns) = conn;


Add missing specialization of evaluator of sub-sparse-matrices that can be seen as a SparseCompressedBase. This changeset enable faster iterator for such expressions.

--- Eigen/src/SparseCore/SparseBlock.h
+++ Eigen/src/SparseCore/SparseBlock.h
@@ -535,6 +535,24 @@
   inline operator bool() const { return m_outerPos < m_end; }
 };

+template<typename _Scalar, int _Options, typename _StorageIndex, int BlockRows, int BlockCols>
+struct unary_evaluator<Block<SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true>, IteratorBased>
+  : evaluator<SparseCompressedBase<Block<SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true> > >
+{
+  typedef Block<SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true> XprType;
+  typedef evaluator<SparseCompressedBase<XprType> > Base;
+  explicit unary_evaluator(const XprType &xpr) : Base(xpr) {}
+};
+
+template<typename _Scalar, int _Options, typename _StorageIndex, int BlockRows, int BlockCols>
+struct unary_evaluator<Block<const SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true>, IteratorBased>
+  : evaluator<SparseCompressedBase<Block<const SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true> > >
+{
+  typedef Block<const SparseMatrix<_Scalar, _Options, _StorageIndex>,BlockRows,BlockCols,true> XprType;
+  typedef evaluator<SparseCompressedBase<XprType> > Base;
+  explicit unary_evaluator(const XprType &xpr) : Base(xpr) {}
+};
+
 } // end namespace internal


On Windows, a socket error can result in ECONNABORTED. This should be treated
identically to ECONNRESET.

* outgoing.c
  (write_to_connection, read_from_connection): where we read from or write to
    a socket, handle both ECONNRESET and ECONNABORTED gracefully so that serf
	can continue sending requests on a new socket.

--- outgoing.c
+++ outgoing.c
@@ -653,7 +653,9 @@
              */
             if (APR_STATUS_IS_EAGAIN(status))
                 return APR_SUCCESS;
-            if (APR_STATUS_IS_EPIPE(status))
+            if (APR_STATUS_IS_EPIPE(status) ||
+                APR_STATUS_IS_ECONNRESET(status) ||
+                APR_STATUS_IS_ECONNABORTED(status))
                 return no_more_writes(conn, request);
             if (status)
                 return status;
@@ -748,7 +750,8 @@
                 return APR_SUCCESS;
             if (APR_STATUS_IS_EPIPE(status))
                 return no_more_writes(conn, request);
-            if (APR_STATUS_IS_ECONNRESET(status)) {
+            if (APR_STATUS_IS_ECONNRESET(status) ||
+                APR_STATUS_IS_ECONNABORTED(status)) {
                 return no_more_writes(conn, request);
             }
             if (status)
@@ -957,9 +960,10 @@
         status = handle_response(request, tmppool);

         /* Some systems will not generate a HUP poll event so we have to
-         * handle the ECONNRESET issue here.
+         * handle the ECONNRESET issue and ECONNABORT here.
          */
         if (APR_STATUS_IS_ECONNRESET(status) ||
+            APR_STATUS_IS_ECONNABORTED(status) ||
             status == SERF_ERROR_REQUEST_LOST) {
             reset_connection(conn, 1);
             status = APR_SUCCESS;


Update platformer.h

Update platformer.h


Cleanup.

Cleanup.

--- Source/saves/Icon.h
+++ Source/saves/Icon.h
@@ -1,5 +1,4 @@
-#ifndef _ICON_H_
-#define _ICON_H_
+#pragma once

 #include "Types.h"
 #include "Stream.h"
@@ -67,6 +66,5 @@
 	uint16*			m_pTexture;
 };

-typedef std::tr1::shared_ptr<CIcon> IconPtr;
+typedef std::shared_ptr<CIcon> IconPtr;

-#endif


Remove Vector reallocation code.

Remove Vector reallocation code.

Replace the only usage with a simpler, faster optimization.
(The optimization isn't huge, it only triggers 5 times during NTP load.)

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

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

--- Source/wtf/Vector.h
+++ Source/wtf/Vector.h
@@ -258,25 +258,14 @@
         {
             ASSERT(newCapacity);
             RELEASE_ASSERT(newCapacity <= QuantizedAllocation::kMaxUnquantizedAllocation / sizeof(T));
-            size_t originalSizeToAllocate = newCapacity * sizeof(T);
-            size_t sizeToAllocate = QuantizedAllocation::quantizedSize(originalSizeToAllocate);
+            size_t sizeToAllocate = allocationSize(newCapacity);
             m_capacity = sizeToAllocate / sizeof(T);
             m_buffer = static_cast<T*>(fastMalloc(sizeToAllocate));
         }

-        bool shouldReallocateBuffer(size_t newCapacity) const
-        {
-            return VectorTraits<T>::canMoveWithMemcpy && m_capacity && newCapacity;
-        }
-
-        void reallocateBuffer(size_t newCapacity)
-        {
-            ASSERT(shouldReallocateBuffer(newCapacity));
-            RELEASE_ASSERT(newCapacity <= QuantizedAllocation::kMaxUnquantizedAllocation / sizeof(T));
-            size_t originalSizeToAllocate = newCapacity * sizeof(T);
-            size_t sizeToAllocate = QuantizedAllocation::quantizedSize(originalSizeToAllocate);
-            m_capacity = sizeToAllocate / sizeof(T);
-            m_buffer = static_cast<T*>(fastRealloc(m_buffer, sizeToAllocate));
+        size_t allocationSize(size_t capacity) const
+        {
+            return QuantizedAllocation::quantizedSize(capacity * sizeof(T));
         }

         T* buffer() { return m_buffer; }
@@ -353,8 +342,7 @@
         }

         using Base::allocateBuffer;
-        using Base::shouldReallocateBuffer;
-        using Base::reallocateBuffer;
+        using Base::allocationSize;

         using Base::buffer;
         using Base::capacity;
@@ -417,16 +405,11 @@
                 resetBufferPointer();
         }

-        bool shouldReallocateBuffer(size_t newCapacity) const
-        {
-            // We cannot reallocate the inline buffer.
-            return Base::shouldReallocateBuffer(newCapacity) && std::min(static_cast<size_t>(m_capacity), newCapacity) > inlineCapacity;
-        }
-
-        void reallocateBuffer(size_t newCapacity)
-        {
-            ASSERT(shouldReallocateBuffer(newCapacity));
-            Base::reallocateBuffer(newCapacity);
+        size_t allocationSize(size_t capacity) const
+        {
+            if (capacity <= inlineCapacity)
+                return m_inlineBufferSize;
+            return Base::allocationSize(capacity);
         }

         void swap(VectorBuffer<T, inlineCapacity>& other)
@@ -623,8 +606,7 @@
         using Base::capacity;
         using Base::swap;
         using Base::allocateBuffer;
-        using Base::shouldReallocateBuffer;
-        using Base::reallocateBuffer;
+        using Base::allocationSize;
     };

     template<typename T, size_t inlineCapacity>
@@ -884,10 +866,9 @@

         T* oldBuffer = begin();
         if (newCapacity > 0) {
-            if (Base::shouldReallocateBuffer(newCapacity)) {
-                Base::reallocateBuffer(newCapacity);
+            // Optimization: if we're downsizing inside the same allocator bucket, we can exit with no additional work.
+            if (Base::allocationSize(capacity()) == Base::allocationSize(newCapacity))
                 return;
-            }

             T* oldEnd = end();
             Base::allocateBuffer(newCapacity);


refactoring

refactoring

--- ext/bossan/bossan_ext.c
+++ ext/bossan/bossan_ext.c
@@ -61,7 +61,7 @@

 #define SERVER "bossan/0.1"

-VALUE server; // Bossan::Server
+VALUE server; // Bossan

 static VALUE version_key;
 static VALUE version_val;
@@ -114,8 +114,8 @@

 static char *log_path = NULL; //access log path
 static int log_fd = -1; //access log
-static char *error_log_path = NULL; //error log path
-static int err_log_fd = -1; //error log
+/* static char *error_log_path = NULL; //error log path */
+/* static int err_log_fd = -1; //error log */

 static int is_keep_alive = 0; //keep alive support
 int max_content_length = 1024 * 1024 * 16; //max_content_length


SpawnException should support non-HTML error page as well

--- ext/common/Exceptions.h
+++ ext/common/Exceptions.h
@@ -204,16 +204,20 @@
 private:
 	string msg;
 	bool m_hasErrorPage;
+	bool m_isHTML;
 	string m_errorPage;
 public:
 	SpawnException(const string &message)
 		: msg(message) {
 		m_hasErrorPage = false;
-	}
-
-	SpawnException(const string &message, const string &errorPage)
-		: msg(message), m_errorPage(errorPage) {
+		m_isHTML = false;
+	}
+
+	SpawnException(const string &message, const string &errorPage, bool isHTML = true)
+		: msg(message), m_errorPage(errorPage)
+	{
 		m_hasErrorPage = true;
+		m_isHTML = isHTML;
 	}

 	virtual ~SpawnException() throw() {}
@@ -234,6 +238,15 @@
 	const string getErrorPage() const {
 		return m_errorPage;
 	}
+
+	/**
+	 * Whether the error page content is HTML.
+	 *
+	 * @pre hasErrorPage()
+	 */
+	bool isHTML() const {
+		return m_isHTML;
+	}
 };

 /**


update from facil.io

update from facil.io

--- ext/iodine/websockets.c
+++ ext/iodine/websockets.c
@@ -9,6 +9,7 @@
 #include "fio_llist.h"
 #include "fiobj.h"

+#include "evio.h"
 #include "fio_base64.h"
 #include "fio_sha1.h"
 #include "http.h"
@@ -286,10 +287,13 @@
   if (ws->on_open)
     ws->on_open(ws);
   ws->protocol.on_data = on_data;
-
-  if (ws->length)
+  ws->protocol.on_ready = on_ready;
+
+  if (ws->length) {
     ws->length = websocket_consume(ws->buffer.data, ws->length, ws,
                                    (~(ws->is_client) & 1));
+  }
+  evio_add_write(sock_uuid2fd(sockfd), (void *)sockfd);

   facil_force_event(sockfd, FIO_EVENT_ON_DATA);
 }
@@ -310,7 +314,7 @@
       .protocol.ping = ws_ping,
       .protocol.on_data = on_data_first,
       .protocol.on_close = on_close,
-      .protocol.on_ready = on_ready,
+      .protocol.on_ready = NULL /* filled in after `on_open` */,
       .protocol.on_shutdown = on_shutdown,
       .subscriptions = FIO_LS_INIT(ws->subscriptions),
       .is_client = 0,


Implement virInterfaceFree.

Implement virInterfaceFree.

Signed-off-by: Chris Lalancette <60b62644009db6b194cc0445b64e9b27bb26433a@redhat.com>

--- ext/libvirt/interface.c
+++ ext/libvirt/interface.c
@@ -231,6 +231,16 @@
                     NUM2UINT(flags));
 }

+/*
+ * call-seq:
+ *   interface.free -> nil
+ *
+ * Call +virInterfaceFree+[http://www.libvirt.org/html/libvirt-libvirt.html#virInterfaceFree]
+ * to free this interface.  The object will no longer be valid after this call.
+ */
+static VALUE libvirt_interface_free(VALUE s) {
+    gen_call_free(Interface, s);
+}
 #endif

 /*
@@ -269,6 +279,7 @@
     rb_define_method(c_interface, "undefine", libvirt_interface_undefine, 0);
     rb_define_method(c_interface, "create", libvirt_interface_create, -1);
     rb_define_method(c_interface, "destroy", libvirt_interface_destroy, -1);
+    rb_define_method(c_interface, "free", libvirt_interface_free, 0);
 #if HAVE_VIRINTERFACEISACTIVE
     rb_define_method(c_interface, "active?", libvirt_interface_active_p, 0);
 #endif


mvc/model/manager.c: fix warnings produced by scan-build

--- ext/mvc/model/manager.c
+++ ext/mvc/model/manager.c
@@ -1906,6 +1906,7 @@
 	HashTable *ah0, *ah1, *ah2;
 	HashPosition hp0, hp1, hp2;
 	zval **hd;
+	int flag_reusable;

 	PHALCON_MM_GROW();

@@ -2224,7 +2225,8 @@
 	 */
 	PHALCON_INIT_VAR(reusable);
 	phalcon_call_method(reusable, relation, "isreusable");
-	if (zend_is_true(reusable)) {
+	flag_reusable = zend_is_true(reusable) ? 1 : 0;
+	if (flag_reusable) {

 		PHALCON_INIT_VAR(unique_key);
 		phalcon_unique_key(unique_key, referenced_model, arguments TSRMLS_CC);
@@ -2256,7 +2258,7 @@
 	/**
 	 * Store the result in the cache if it's reusable
 	 */
-	if (zend_is_true(reusable)) {
+	if (flag_reusable) {
 		phalcon_call_method_p3_noret(this_ptr, "setreusablerecords", referenced_model, unique_key, records);
 	}


asfdemux: make sure to avoid arithmetic with _NONE timestamp

--- gst/asfdemux/asfpacket.c
+++ gst/asfdemux/asfpacket.c
@@ -147,7 +147,8 @@
   }

   /* make timestamps start from 0 */
-  if (G_LIKELY (demux->first_ts < payload->ts))
+  if (G_LIKELY (GST_CLOCK_TIME_IS_VALID (demux->first_ts) &&
+          demux->first_ts < payload->ts))
     payload->ts -= demux->first_ts;
   else
     payload->ts = 0;


make sure the query string is converted to the connection's encoding before it's handed to libmysql

--- ext/mysql2/mysql2_ext.c
+++ ext/mysql2/mysql2_ext.c
@@ -221,6 +221,12 @@
     }
   }

+#ifdef HAVE_RUBY_ENCODING_H
+    rb_encoding *conn_enc = rb_to_encoding(rb_iv_get(self, "@encoding"));
+    // ensure the string is in the encoding the connection is expecting
+    args.sql = rb_str_export_to_enc(args.sql, conn_enc);
+#endif
+
   Check_Type(args.sql, T_STRING);
   Data_Get_Struct(self, MYSQL, client);


filtercube: fix for gles2 compilation

filtercube: fix for gles2 compilation

--- gst/gl/gstglfiltercube.c
+++ gst/gl/gstglfiltercube.c
@@ -426,7 +426,9 @@
 static void
 _callback_gles2 (gint width, gint height, guint texture, gpointer stuff)
 {
-  GstGLFilterCube *cube_filter = GST_GL_FILTER_CUBE (stuff);
+  GstGLFilter *filter = GST_GL_FILTER (stuff);
+  GstGLFilterCube *cube_filter = GST_GL_FILTER_CUBE (filter);
+  GstGLFuncs *gl = filter->display->gl_vtable;

   static GLfloat xrot = 0;
   static GLfloat yrot = 0;


grab ptr

grab ptr

--- ext/simpler_tiles/map.c
+++ ext/simpler_tiles/map.c
@@ -17,7 +17,7 @@
   simplet_map_t *map = get_map(self);
   if(!Check_Type(VALUE srs, T_STRING))
     return Qnil;
-  simplet_map_set_srs(map, RSTRING(srs)->ptr);
+  simplet_map_set_srs(map, RSTRING_PTR(srs));
   return Qnil;
 }

@@ -47,7 +47,7 @@
   simplet_map_t *map = get_map(self);
   if(!Check_Type(VALUE srs, T_STRING))
     return Qnil;
-  simplet_map_add_layer(map, RSTRING(srs)->ptr);
+  simplet_map_add_layer(map, RSTRING_PTR(srs));
   return Qnil;
 }

@@ -56,7 +56,7 @@
   simplet_map_t *map = get_map(self);
   if(!Check_Type(VALUE srs, T_STRING))
     return Qnil;
-  simplet_map_add_rule(map, RSTRING(srs)->ptr);
+  simplet_map_add_rule(map, RSTRING_PTR(srs));
   return Qnil;
 }

@@ -67,7 +67,7 @@
     return Qfalse;
   if(!Check_Type(VALUE srs, T_STRING))
     return Qfalse;
-  simplet_map_add_rule(map, RSTRING(srs)->ptr);
+  simplet_map_add_rule(map, RSTRING_PTR(srs));
   return Qtrue;
 }


Minor code cleanups in mfxvpp module

Minor code cleanups in mfxvpp module

--- gst/mfx/gstmfxpostproc.c
+++ gst/mfx/gstmfxpostproc.c
@@ -286,7 +286,6 @@
     }
   } else {
     g_warning ("got an unknown channel %s", channel->label);
-    return;
   }
 }

@@ -488,7 +487,6 @@
     *caps_changed_ptr = TRUE;
     *info = vi;
   }
-
   return TRUE;
 }

@@ -498,10 +496,7 @@
 {
   GST_INFO_OBJECT (vpp, "new sink caps = %" GST_PTR_FORMAT, caps);

-  if (!video_info_update (caps, &vpp->sinkpad_info, caps_changed_ptr))
-    return FALSE;
-
-  return TRUE;
+  return video_info_update (caps, &vpp->sinkpad_info, caps_changed_ptr);
 }

 static GstBuffer *
@@ -686,13 +681,9 @@
 gst_mfxpostproc_propose_allocation (GstBaseTransform * trans,
     GstQuery * decide_query, GstQuery * query)
 {
-  GstMfxPluginBase *const plugin = GST_MFX_PLUGIN_BASE (trans);
-
-  if (!gst_mfx_plugin_base_propose_allocation (plugin, query))
-    return FALSE;
-  return TRUE;
-}
-
+  return gst_mfx_plugin_base_propose_allocation (GST_MFX_PLUGIN_BASE (trans),
+      query);
+}

 static gboolean
 gst_mfxpostproc_decide_allocation (GstBaseTransform * trans, GstQuery * query)


rtpsbcdepay: Fix potential NULL pointer dereference

CID 1418864

--- gst/rtp/gstrtpsbcdepay.c
+++ gst/rtp/gstrtpsbcdepay.c
@@ -366,7 +366,7 @@
     }
   }

-  if (depay->ignore_timestamps) {
+  if (depay->ignore_timestamps && data) {
     GstClockTime duration;

     gst_audio_stream_align_process (depay->stream_align,


vaapisink: improve check for raw YUV format mode.

Improve check for raw YUV format modes by avoiding checks against strings
("video/x-raw-yuv") for each new GstBuffer allocation. In the usual case,
GstBaseSink::set_caps() is called first and if VA surface format mode is
used, then GstBaseSink::buffer_alloc() is not called. If the latter is
called before set_caps(), then we just make a full check. This one is
pretty rare though, e.g. it usually happens once for custom pipelines.

--- gst/vaapi/gstvaapisink.c
+++ gst/vaapi/gstvaapisink.c
@@ -610,7 +610,6 @@
 gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
 {
     GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
-    GstStructure * const structure = gst_caps_get_structure(caps, 0);
     GstVideoInfo vi;
     guint win_width, win_height;

@@ -621,15 +620,13 @@

     if (!gst_video_info_from_caps(&vi, caps))
         return FALSE;
-    sink->video_width  = GST_VIDEO_INFO_WIDTH(&vi);
-    sink->video_height = GST_VIDEO_INFO_HEIGHT(&vi);
-    sink->video_par_n  = GST_VIDEO_INFO_PAR_N(&vi);
-    sink->video_par_d  = GST_VIDEO_INFO_PAR_D(&vi);
+    sink->use_video_raw = GST_VIDEO_INFO_IS_YUV(&vi);
+    sink->video_width   = GST_VIDEO_INFO_WIDTH(&vi);
+    sink->video_height  = GST_VIDEO_INFO_HEIGHT(&vi);
+    sink->video_par_n   = GST_VIDEO_INFO_PAR_N(&vi);
+    sink->video_par_d   = GST_VIDEO_INFO_PAR_D(&vi);
     GST_DEBUG("video pixel-aspect-ratio %d/%d",
               sink->video_par_n, sink->video_par_d);
-
-    if (gst_structure_has_name(structure, "video/x-raw-yuv"))
-        sink->use_video_raw = TRUE;

     gst_caps_replace(&sink->caps, caps);

@@ -934,14 +931,21 @@
 )
 {
     GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
-    GstStructure *structure;
+    GstVideoInfo vi;
     GstBuffer *buf;

     *pbuf = NULL;

-    structure = gst_caps_get_structure(caps, 0);
-    if (!gst_structure_has_name(structure, "video/x-raw-yuv"))
-        return GST_FLOW_OK;
+    if (!sink->use_video_raw) {
+        /* Note: this code path is rarely used but for raw YUV formats
+           from custom pipeline. Otherwise, GstBaseSink::set_caps() is
+           called first, and GstBaseSink::buffer_alloc() is not called
+           in VA surface format mode */
+        if (!gst_video_info_from_caps(&vi, caps))
+            return GST_FLOW_NOT_SUPPORTED;
+        if (!GST_VIDEO_INFO_IS_YUV(&vi))
+            return GST_FLOW_OK;
+    }

     if (!gst_vaapi_uploader_ensure_display(sink->uploader, sink->display))
         return GST_FLOW_NOT_SUPPORTED;


why is this not a link

why is this not a link

--- python-code/ksp_display_defines.h
+++ python-code/ksp_display_defines.h
@@ -58,7 +58,7 @@
 #define INFO_PERCENTAGE_RCS 113
 #define INFO_PERCENTAGE_BATTERY 114
 #define INFO_PERCENTAGE_OXYGEN 115
-#define BUTTON_NEXT_LEFT_LCD_MODE 36
+#define BUTTON_NEXT_LEFT_LCD_MODE 36 // no extra button, currently the TEST button

 #define CMD_GET_UPDATES 109
 #define CMD_UPDATE_CONSOLE 110


Better document the compare function.

Better document the compare function.

--- large-u-int.h
+++ large-u-int.h
@@ -74,6 +74,9 @@
 // Compares two large unsigned integers, returning 0 if they are equal, 1 if
 // the second is greater than the first, and -1 if the first is greater than
 // the second.
+// this == that --> 0
+// this < that  --> 1
+// this > that  --> -1
 int LargeUIntCompare(const LargeUInt* this, const LargeUInt* that);

 // Copies the value from the first argument into the second argument.


Don't steal the pointer grab from the context menu of the entry. (#148686,

Mon Aug  2 02:07:43 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkentrycompletion.c (_gtk_entry_completion_popdown):
	Don't steal the pointer grab from the context menu of the
	entry.  (#148686, Christian Persch)

--- gtk/gtkentrycompletion.c
+++ gtk/gtkentrycompletion.c
@@ -1386,6 +1386,9 @@
 void
 _gtk_entry_completion_popdown (GtkEntryCompletion *completion)
 {
+  if (!GTK_WIDGET_MAPPED (completion->priv->popup_window))
+    return;
+
   completion->priv->ignore_enter = FALSE;

   gdk_pointer_ungrab (GDK_CURRENT_TIME);


Correcting for disappearance of kPI

Correcting for disappearance of kPI

--- HBTAN/AliHBTParticle.h
+++ HBTAN/AliHBTParticle.h
@@ -9,6 +9,8 @@
 #include <TLorentzVector.h>
 #include <TMath.h>
 #include <TDatabasePDG.h>
+
+#include "AliConst.h"

 class TParticle;


Gestures: Properly handle weak references

Every call to g_object_add_weak_pointer must be matched with
a g_object_remove_weak_pointer call, or we will get invalid
writes inside GObject.

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

--- gtk/gtkeventcontroller.c
+++ gtk/gtkeventcontroller.c
@@ -131,7 +131,11 @@

   priv = gtk_event_controller_get_instance_private (controller);
   if (priv->widget)
-    _gtk_widget_remove_controller (priv->widget, controller);
+    {
+      _gtk_widget_remove_controller (priv->widget, controller);
+      g_object_remove_weak_pointer (G_OBJECT (priv->widget), (gpointer *) &priv->widget);
+      priv->widget = NULL;
+    }

   G_OBJECT_CLASS (gtk_event_controller_parent_class)->dispose (object);
 }


GtkTreeModelFilterPrivate: Improve struct packing

--- gtk/gtktreemodelfilter.c
+++ gtk/gtktreemodelfilter.c
@@ -110,31 +110,30 @@

 struct _GtkTreeModelFilterPrivate
 {
+  GtkTreeModel *child_model;
   gpointer root;
+  GtkTreePath *virtual_root;
+
   gint stamp;
   guint child_flags;
-  GtkTreeModel *child_model;
   gint zero_ref_count;
-
-  GtkTreePath *virtual_root;
+  gint visible_column;

   GtkTreeModelFilterVisibleFunc visible_func;
   gpointer visible_data;
   GDestroyNotify visible_destroy;

-  gint modify_n_columns;
   GType *modify_types;
   GtkTreeModelFilterModifyFunc modify_func;
   gpointer modify_data;
   GDestroyNotify modify_destroy;
-
-  gint visible_column;
-
-  gboolean visible_method_set;
-  gboolean modify_func_set;
-
-  gboolean in_row_deleted;
-  gboolean virtual_root_deleted;
+  gint modify_n_columns;
+
+  guint visible_method_set   : 1;
+  guint modify_func_set      : 1;
+
+  guint in_row_deleted       : 1;
+  guint virtual_root_deleted : 1;

   /* signal ids */
   gulong changed_id;


Fix region leak in gtk2 compat defines

Fix region leak in gtk2 compat defines

https://bugs.freedesktop.org/show_bug.cgi?id=54277

--- gtk/spice-widget-cairo.c
+++ gtk/spice-widget-cairo.c
@@ -78,7 +78,7 @@
 #define cairo_rectangle_int_t GdkRectangle
 #define cairo_region_t GdkRegion
 #define cairo_region_create_rectangle gdk_region_rectangle
-#define cairo_region_subtract_rectangle(_dest,_rect) { GdkRegion *_region = gdk_region_rectangle (_rect); gdk_region_subtract (_dest, _region); }
+#define cairo_region_subtract_rectangle(_dest,_rect) { GdkRegion *_region = gdk_region_rectangle (_rect); gdk_region_subtract (_dest, _region); gdk_region_destroy (_region); }
 #define cairo_region_destroy gdk_region_destroy
 #endif


Correctly name header guard

Correctly name header guard

--- Ext/PipelineStatistics/Collector.h
+++ Ext/PipelineStatistics/Collector.h
@@ -8,8 +8,8 @@
 */
 #ifdef MINSG_EXT_PIPELINESTATISTICS

-#ifndef MINSG_PIPELINESTATISTICS_RENDERER_H_
-#define MINSG_PIPELINESTATISTICS_RENDERER_H_
+#ifndef MINSG_PIPELINESTATISTICS_COLLECTOR_H_
+#define MINSG_PIPELINESTATISTICS_COLLECTOR_H_

 #include "../../Core/States/State.h"
 #include <Util/TypeNameMacro.h>
@@ -49,6 +49,6 @@
 }
 }

-#endif /* MINSG_PIPELINESTATISTICS_RENDERER_H_ */
+#endif /* MINSG_PIPELINESTATISTICS_COLLECTOR_H_ */

 #endif /* MINSG_EXT_PIPELINESTATISTICS */


No more lazy combinator type.

No more lazy combinator type.

--- Hammer/HMRCombinator.h
+++ Hammer/HMRCombinator.h
@@ -1,6 +1,6 @@
 //  Copyright (c) 2014 Rob Rix. All rights reserved.

-#import <Hammer/HMRLaziness.h>
+#import <Hammer/HMRDelay.h>

 @protocol HMRCombinator <NSObject, NSCopying>

@@ -20,8 +20,6 @@
 @end

-typedef id<HMRCombinator> (^HMRLazyCombinator)();
-
 id<HMRCombinator> HMRAlternate(id<HMRCombinator> left, id<HMRCombinator> right);
 id<HMRCombinator> HMRConcatenate(id<HMRCombinator> first, id<HMRCombinator> second);


Added Official Working Program

Added Official Working Program

Includes custom tabbing function, calculates max velocity, gives distance in km, mi, m, ft

error: pathspec 'Haversine_Calculator.c' did not match any file(s) known to git

--- Haversine_Calculator.c
+++ Haversine_Calculator.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define R 6371 //radius of the Earth
+#define TO_RAD (3.1415926536 / 180) //radians
+
+void tab(double tabs){
+	for(int i = 0; i < tabs; i++){
+		printf("");
+	}
+}
+double newtonSecondLaw (double force, double massGram){
+	//F = (m1v1 - m0V0)/(t1-t0)
+	double mass = massGram / 1000;
+	double acceleration = force / mass;
+	double totalTime = 5; //seconds
+	double V1 = totalTime * acceleration;
+	return V1;
+}
+
+double dist(double th1, double ph1, double th2, double ph2)
+{
+	double dx, dy, dz;
+	ph1 -= ph2;
+	ph1 *= TO_RAD, th1 *= TO_RAD, th2 *= TO_RAD;
+
+	dz = sin(th1) - sin(th2);
+	dx = cos(ph1) * cos(th1) - cos(th2);
+	dy = sin(ph1) * cos(th1);
+	return asin(sqrt(dx * dx + dy * dy + dz * dz) / 2) * 2 * R;
+}
+float launchTH = 35.4897;
+float launchPH = -85.9594;
+
+float touchDownTH = 35.484;
+float touchDownPH = -85.975;
+int main()
+{
+	tab(1);
+	double a = newtonSecondLaw(128, 453.592); //calculates acceleration based on force and mass
+	printf("The rocket's max velocity will be %.3f V1 m/s\n", a);
+	tab(1);
+	double d = dist(launchTH, launchPH, touchDownTH, touchDownPH);
+	/* Americans don't know kilometers */
+	printf("dist: %.3f km (%.3f mi.) %.2f m %.2f ft\n", d, d / 1.609344, d*1000, d*1000*3.2808);
+	return 0;
+}


more fix

more fix


Fix formatting issues with Bridge helpers

--- Frameworks/include/BridgeHelpers.h
+++ Frameworks/include/BridgeHelpers.h
@@ -132,7 +132,7 @@

 // Helper macro for implementing allocWithZone
 #define ALLOC_PROTOTYPE_SUBCLASS_WITH_ZONE(NSBridgedType, NSBridgedPrototypeType)                            \
-    (NSObject*) allocWithZone : (NSZone*)zone {                                                              \
+    (NSObject*)allocWithZone : (NSZone*)zone {                                                               \
         if (self == [NSBridgedType class]) {                                                                 \
             static StrongId<NSBridgedPrototypeType> prototype = [NSBridgedPrototypeType allocWithZone:zone]; \
             return prototype;                                                                                \


Remove FoundationExport, which isn't needed in here

--- Frameworks/include/ErrorHandling.h
+++ Frameworks/include/ErrorHandling.h
@@ -17,7 +17,6 @@
 #ifndef __ERRORHANDLING_H
 #define __ERRORHANDLING_H

-#include <Foundation/FoundationExport.h>
 #include <winerror.h>

 #ifdef __OBJC__


ASTMatchersMacros.h: Appease msvc.

ASTMatchersMacros.h: Appease msvc.

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

--- include/clang/ASTMatchers/ASTMatchersMacros.h
+++ include/clang/ASTMatchers/ASTMatchersMacros.h
@@ -230,13 +230,14 @@
       MatcherName, NodeType, FunctionName)                                     \
   inline internal::Matcher<NodeType> hasPrefix(                                \
       const internal::Matcher<NodeType> &InnerMatcher) {                       \
-    return makeMatcher(new internal::TraverseMatcher<NodeType>(                \
+    return internal::makeMatcher(new internal::TraverseMatcher<NodeType>(      \
       InnerMatcher, &NodeType::getPrefix));                                    \
   }                                                                            \
   inline internal::Matcher<NodeType##Loc> hasPrefix(                           \
       const internal::Matcher<NodeType##Loc> &InnerMatcher) {                  \
-    return makeMatcher(new internal::LocTraverseMatcher<NodeType##Loc>(        \
-      InnerMatcher, &NodeType##Loc::getPrefix));                               \
+    return internal::makeMatcher(                                              \
+      new internal::LocTraverseMatcher<NodeType##Loc>(                         \
+        InnerMatcher, &NodeType##Loc::getPrefix));                             \
   }

 #endif // LLVM_CLANG_AST_MATCHERS_AST_MATCHERS_MACROS_H


Remove DoneEvaluating field (unused since r90296)

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

--- include/clang/Checker/PathSensitive/Checker.h
+++ include/clang/Checker/PathSensitive/Checker.h
@@ -36,7 +36,6 @@
   const GRState *ST;
   const Stmt *statement;
   const unsigned size;
-  bool DoneEvaluating; // FIXME: This is not a permanent API change.
 public:
   bool *respondsToCallback;
 public:


meta-porter: add a stanza_handler_new to stop duplicating code

Signed-off-by: Jonny Lamb <3d1fb3642aaab2ff70e3392a5ab916bf99eed6a3@collabora.co.uk>

--- wocky/wocky-meta-porter.c
+++ wocky/wocky-meta-porter.c
@@ -1101,6 +1101,21 @@
   g_list_free (handlers);
 }

+static StanzaHandler *
+stanza_handler_new (WockyMetaPorter *self,
+    WockyLLContact *contact)
+{
+  StanzaHandler *out = g_slice_new0 (StanzaHandler);
+
+  out->self = self;
+  out->porters = g_hash_table_new (NULL, NULL);
+
+  if (contact != NULL)
+    out->contact = g_object_ref (contact);
+
+  return out;
+}
+
 static guint
 wocky_meta_porter_register_handler_from_by_stanza (WockyPorter *porter,
     WockyStanzaType type,
@@ -1125,10 +1140,7 @@

   g_return_val_if_fail (WOCKY_IS_LL_CONTACT (from), 0);

-  handler = g_slice_new0 (StanzaHandler);
-  handler->self = self;
-  handler->contact = g_object_ref (from);
-  handler->porters = g_hash_table_new (g_direct_hash, g_direct_equal);
+  handler = stanza_handler_new (self, from);

   handler->type = type;
   handler->sub_type = sub_type;
@@ -1164,9 +1176,7 @@
   StanzaHandler *handler;
   GList *porters, *l;

-  handler = g_slice_new0 (StanzaHandler);
-  handler->self = self;
-  handler->porters = g_hash_table_new (g_direct_hash, g_direct_equal);
+  handler = stanza_handler_new (self, NULL);

   handler->type = type;
   handler->sub_type = sub_type;


Clarify compression algorithm enum order

--- include/grpc/impl/codegen/compression_types.h
+++ include/grpc/impl/codegen/compression_types.h
@@ -52,7 +52,8 @@
   "grpc.compression_enabled_algorithms_bitset"
 /** \} */

-/** The various compression algorithms supported by gRPC */
+/** The various compression algorithms supported by gRPC (not sorted by
+ * compression level) */
 typedef enum {
   GRPC_COMPRESS_NONE = 0,
   GRPC_COMPRESS_DEFLATE,


Fix typo

Fix typo

--- wocky/wocky-xmpp-writer.c
+++ wocky/wocky-xmpp-writer.c
@@ -94,7 +94,7 @@
   object_class->set_property = wocky_xmpp_write_set_property;
   object_class->get_property = wocky_xmpp_write_get_property;

-  param_spec = g_param_spec_boolean ("streamimg-mode", "streaming-mode",
+  param_spec = g_param_spec_boolean ("streaming-mode", "streaming-mode",
     "Whether the xml to be written is one big stream or seperate documents",
     TRUE,
     G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);


[Orc] Remove the FPRPCChannel class from RPCChannel.h - it requires unistd.h,
which was removed in r257306.

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

--- include/llvm/ExecutionEngine/Orc/RPCChannel.h
+++ include/llvm/ExecutionEngine/Orc/RPCChannel.h
@@ -26,33 +26,6 @@

   /// Flush the stream if possible.
   virtual std::error_code send() = 0;
-};
-
-/// RPC channel that reads from and writes from file descriptors.
-class FDRPCChannel : public RPCChannel {
-public:
-  FDRPCChannel(int InFD, int OutFD) : InFD(InFD), OutFD(OutFD) {}
-
-  std::error_code readBytes(char *Dst, unsigned Size) override {
-    assert(Dst && "Attempt to read into null.");
-    ssize_t ReadResult = ::read(InFD, Dst, Size);
-    if (ReadResult != Size)
-      return std::error_code(errno, std::generic_category());
-    return std::error_code();
-  }
-
-  std::error_code appendBytes(const char *Src, unsigned Size) override {
-    assert(Src && "Attempt to append from null.");
-    ssize_t WriteResult = ::write(OutFD, Src, Size);
-    if (WriteResult != Size)
-      std::error_code(errno, std::generic_category());
-    return std::error_code();
-  }
-
-  std::error_code send() override { return std::error_code(); }
-
-private:
-  int InFD, OutFD;
 };

 /// RPC channel serialization for a variadic list of arguments.


update include

update include

--- include/scanner/constructs/SourceConditions.h
+++ include/scanner/constructs/SourceConditions.h
@@ -17,6 +17,7 @@

 #include <thread>
 #include <mutex>
+#include <atomic>
 #include <condition_variable>
 namespace scanners {
 /**


fix: sjson-cpp now properly handles NaN/Inf

--- includes/acl/compression/stream/write_stats.h
+++ includes/acl/compression/stream/write_stats.h
@@ -178,17 +178,7 @@
 		writer["compressed_size"] = compressed_size;
 		writer["compression_ratio"] = compression_ratio;
 		writer["compression_time"] = compression_time.get_elapsed_seconds();
-
-		// todo sjson-cpp properly handle infinity values
-		//writer["duration"] = clip.get_duration();
-		const float duration = clip.get_duration();
-		if (std::isnan(duration))
-			writer["duration"] = "nan";
-		else if (std::isfinite(duration))
-			writer["duration"] = duration;
-		else
-			writer["duration"] = duration >= 0.0F ? "+inf" : "-inf";
-
+		writer["duration"] = clip.get_duration();
 		writer["num_samples"] = clip.get_num_samples();
 		writer["num_bones"] = clip.get_num_bones();
 		writer["rotation_format"] = get_rotation_format_name(settings.rotation_format);


feat(database): expose version query function in database context

--- includes/acl/database/impl/database_context.h
+++ includes/acl/database/impl/database_context.h
@@ -58,7 +58,7 @@
 			//////////////////////////////////////////////////////////////////////////

 			const compressed_database* get_compressed_database() const { return db; }
-			//compressed_tracks_version16 get_version() const { return db->get_version(); }
+			compressed_database_version16 get_version() const { return db->get_version(); }
 			bool is_initialized() const { return db != nullptr; }
 			void reset() { db = nullptr; }
 		};


git-svn-id: https://www.imagemagick.org/subversion/ImageMagick/trunk@4698 aa41f4f7-0bf4-0310-aa73-e5a19afd5a74

--- coders/dps.c
+++ coders/dps.c
@@ -54,6 +54,7 @@
 #include "MagickCore/memory_.h"
 #include "MagickCore/monitor.h"
 #include "MagickCore/monitor-private.h"
+#include "MagickCore/pixel-accessor.h"
 #include "MagickCore/quantum-private.h"
 #include "MagickCore/static.h"
 #include "MagickCore/string_.h"


Corrected to put in final '\n'.

Corrected to put in final '\n'.

--- roa-lib/roa_general.c
+++ roa-lib/roa_general.c
@@ -521,20 +521,16 @@
       struct ROAIPAddress *ipaddressp = (struct ROAIPAddress *)
         member_casn(&famp->addresses.self, numaddr);
       char *tmpbuf = convertAddr(famtyp[1], ipaddressp);
-      int lth = strlen(tmpbuf) + 1;
+      int lth = strlen(tmpbuf);
       if (!replysiz)
         {
-        replyp = (char *)calloc(1, lth);
+        replyp = (char *)calloc(1, lth + 1);
         strcpy(replyp, tmpbuf);
-        replysiz = lth - 1;
+        replysiz = lth;  // size without null
         }
       else
         {
         replyp = (char *)realloc(replyp, replysiz + lth + 1);
-        char *rpendp = &replyp[replysiz];
-        *rpendp++ = '\n';
-        strcpy(rpendp, tmpbuf);
-        replysiz += lth;
         }
       free(tmpbuf);
       }


Passing all regression tests now.

Passing all regression tests now.

--- coders/png.c
+++ coders/png.c
@@ -2503,6 +2503,15 @@
                     found_transparent_pixel = MagickTrue;
                     break;
                   }
+                if ((ping_color_type == PNG_COLOR_TYPE_RGB ||
+                    ping_color_type == PNG_COLOR_TYPE_GRAY) &&
+                    (q->red == transparent_color.red &&
+                    q->green == transparent_color.green &&
+                    q->blue == transparent_color.blue))
+                  {
+                    found_transparent_pixel = MagickTrue;
+                    break;
+                  }
                 q++;
               }
             }
@@ -2854,13 +2863,17 @@

             for (x=(ssize_t) image->columns-1; x >= 0; x--)
             {
-              if (ScaleQuantumToShort(q->red) == transparent_color.red &&
-                  ScaleQuantumToShort(q->green) == transparent_color.green &&
-                  ScaleQuantumToShort(q->blue) == transparent_color.blue)
+              if (ScaleQuantumToChar(q->red) == transparent_color.red &&
+                  ScaleQuantumToChar(q->green) == transparent_color.green &&
+                  ScaleQuantumToChar(q->blue) == transparent_color.blue)
+                {
                   q->opacity=(Quantum) TransparentOpacity;
+                }

               else
-                 q->opacity=(Quantum) OpaqueOpacity;
+                {
+                  q->opacity=(Quantum) OpaqueOpacity;
+                }

               q++;
             }
@@ -7145,22 +7158,33 @@
           for (i=0; i<number_opaque; i++)
              colormap[n++] = opaque[i];

-          /* Add the background color to the palette, if it
-           * isn't already there.
-           */
-          for (i=0; i<number_opaque; i++)
-          {
-             if (IsColorEqual(opaque+i,
-                &image->background_color))
-             break;
-          }
-
-          if (number_opaque < 257 && i == number_opaque)
-          {
-             opaque[i]=image->background_color;
-             opaque[i].opacity = OpaqueOpacity;
-             number_opaque++;
-          }
+          if (ping_exclude_bKGD == MagickFalse)
+            {
+              /* Add the background color to the palette, if it
+               * isn't already there.
+               */
+              for (i=0; i<number_opaque; i++)
+              {
+                 if (IsColorEqual(opaque+i,
+                    &image->background_color))
+                 break;
+              }
+
+              if (number_opaque < 257 && i == number_opaque)
+              {
+                 opaque[i]=image->background_color;
+                 opaque[i].opacity = OpaqueOpacity;
+                 number_opaque++;
+              }
+            }
+
+          if (number_transparent == 1)
+            {
+              ping_trans_color.red= (unsigned short)(transparent[0].red);
+              ping_trans_color.green= (unsigned short) (transparent[0].green);
+              ping_trans_color.blue= (unsigned short) (transparent[0].blue);
+              ping_trans_color.gray= (unsigned short) (transparent[0].blue);
+            }

           if (logging != MagickFalse)
             {
@@ -7271,12 +7295,6 @@
     }
 #endif /* PNG_BUILD_PALETTE */

-#if 0 /* causes some test cases to fail and doesn't allow user
-       * to force color_type 4 or 6 */
-  if (number_transparent == 0 && number_semitransparent == 0)
-    image->matte=MagickFalse;
-#endif
-
   if (mng_info->ping_exclude_tRNS != MagickFalse &&
      (number_transparent != 0 || number_semitransparent != 0))
     {
@@ -7555,14 +7573,17 @@
              ping_have_tRNS=MagickTrue;
       }

-      /*
-       * Identify which colormap entry is the background color.
-       */
-      for (i=0; i < (ssize_t) MagickMax(1L*number_colors-1L,1L); i++)
-        if (IsPNGColorEqual(ping_background,image->colormap[i]))
-          break;
-
-      ping_background.index=(png_byte) i;
+    if (ping_exclude_bKGD == MagickFalse)
+      {
+        /*
+         * Identify which colormap entry is the background color.
+         */
+        for (i=0; i < (ssize_t) MagickMax(1L*number_colors-1L,1L); i++)
+          if (IsPNGColorEqual(ping_background,image->colormap[i]))
+            break;
+
+        ping_background.index=(png_byte) i;
+      }
     } /* end of write_png8 */

   else if (mng_info->write_png24)
@@ -7714,96 +7735,109 @@
         "    ping_bit_depth: %.20g",(double) ping_bit_depth);
     }

-  if (matte && (mng_info->IsPalette))
-    {
-
-      ping_color_type=PNG_COLOR_TYPE_GRAY_ALPHA;
-
-      if (ping_have_color != MagickFalse)
-         ping_color_type=PNG_COLOR_TYPE_RGBA;
-
-      /*
-       * Determine if there is any transparent color.
-      */
-      if (number_transparent + number_semitransparent == 0)
+  if (matte)
+    {
+      if (mng_info->IsPalette)
         {
+
+          ping_color_type=PNG_COLOR_TYPE_GRAY_ALPHA;
+
+          if (ping_have_color != MagickFalse)
+             ping_color_type=PNG_COLOR_TYPE_RGBA;
+
           /*
-            No transparent pixels are present.  Change 4 or 6 to 0 or 2.
+           * Determine if there is any transparent color.
           */
-          image_matte=MagickFalse;
-          ping_color_type&=0x03;
+          if (number_transparent + number_semitransparent == 0)
+            {
+              /*
+                No transparent pixels are present.  Change 4 or 6 to 0 or 2.
+              */
+              image_matte=MagickFalse;
+              ping_color_type&=0x03;
+            }
+
+          else
+            {
+              unsigned int
+                mask;
+
+              mask=0xffff;
+
+              if (ping_bit_depth == 8)
+                 mask=0x00ff;
+
+              if (ping_bit_depth == 4)
+                 mask=0x000f;
+
+              if (ping_bit_depth == 2)
+                 mask=0x0003;
+
+              if (ping_bit_depth == 1)
+                 mask=0x0001;
+
+              ping_trans_color.red=(png_uint_16)
+                (ScaleQuantumToShort(image->colormap[0].red) & mask);
+
+              ping_trans_color.green=(png_uint_16)
+                (ScaleQuantumToShort(image->colormap[0].green) & mask);
+
+              ping_trans_color.blue=(png_uint_16)
+                (ScaleQuantumToShort(image->colormap[0].blue) & mask);
+
+              ping_trans_color.gray=(png_uint_16)
+                (ScaleQuantumToShort(PixelIntensityToQuantum(
+                   image->colormap)) & mask);
+
+              ping_trans_color.index=(png_byte) 0;
+
+              ping_have_tRNS=MagickTrue;
+            }
+
+          if (ping_have_tRNS != MagickFalse)
+            {
+              /*
+                Determine if there is one and only one transparent color
+                and if so if it is fully transparent.
+              */
+              if (logging != MagickFalse)
+                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                    "  Is there a single fully transparent color?");
+
+              if (number_transparent > 1 || number_semitransparent > 0)
+              {
+                ping_have_tRNS = MagickFalse;
+                if (logging != MagickFalse)
+                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                    "  ... No.");
+              }
+              else
+              {
+                if (logging != MagickFalse)
+                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                    "  ... Yes: (%d,%d,%d), (gray: %d)",
+                    (int) ping_trans_color.red,
+                    (int) ping_trans_color.green,
+                    (int) ping_trans_color.blue,
+                    (int) ping_trans_color.gray);
+              }
+            }
+
+          if (ping_have_tRNS != MagickFalse)
+            {
+              ping_color_type &= 0x03;  /* changes 4 or 6 to 0 or 2 */
+
+              if (image_depth == 8)
+                {
+                  ping_trans_color.red&=0xff;
+                  ping_trans_color.green&=0xff;
+                  ping_trans_color.blue&=0xff;
+                  ping_trans_color.gray&=0xff;
+                }
+            }
         }
-
       else
         {
-          unsigned int
-            mask;
-
-          mask=0xffff;
-
-          if (ping_bit_depth == 8)
-             mask=0x00ff;
-
-          if (ping_bit_depth == 4)
-             mask=0x000f;
-
-          if (ping_bit_depth == 2)
-             mask=0x0003;
-
-          if (ping_bit_depth == 1)
-             mask=0x0001;
-
-          ping_trans_color.red=(png_uint_16)
-            (ScaleQuantumToShort(image->colormap[0].red) & mask);
-
-          ping_trans_color.green=(png_uint_16)
-            (ScaleQuantumToShort(image->colormap[0].green) & mask);
-
-          ping_trans_color.blue=(png_uint_16)
-            (ScaleQuantumToShort(image->colormap[0].blue) & mask);
-
-          ping_trans_color.gray=(png_uint_16)
-            (ScaleQuantumToShort(PixelIntensityToQuantum(
-               image->colormap)) & mask);
-
-          ping_trans_color.index=(png_byte) 0;
-
-          ping_have_tRNS=MagickTrue;
-        }
-
-      if (ping_have_tRNS != MagickFalse)
-        {
-          /*
-            Determine if there is one and only one transparent color
-            and if so if it is fully transparent.
-          */
-          if (logging != MagickFalse)
-             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "  Is there a single fully transparent color?");
-
-          if (number_transparent > 1 || number_semitransparent > 0)
-          {
-            ping_have_tRNS = MagickFalse;
-            if (logging != MagickFalse)
-             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "  ... No.");
-          }
-          else
-          {
-            if (logging != MagickFalse)
-             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "  ... Yes: (%d,%d,%d), (gray: %d)",
-                (int) ping_trans_color.red,
-                (int) ping_trans_color.green,
-                (int) ping_trans_color.blue,
-                (int) ping_trans_color.gray);
-          }
-        }
-
-      if (ping_have_tRNS != MagickFalse)
-        {
-          ping_color_type &= 0x03;  /* changes 4 or 6 to 0 or 2 */
-
           if (image_depth == 8)
             {
               ping_trans_color.red&=0xff;
@@ -7831,8 +7865,16 @@
         else
           {
             ping_color_type=PNG_COLOR_TYPE_GRAY;
+
             if (save_image_depth == 16 && image_depth == 8)
-              ping_trans_color.gray*=0x0101;
+              {
+                if (logging != MagickFalse)
+                  {
+                    (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                        "  Scaling ping_trans_color (0)");
+                  }
+                    ping_trans_color.gray*=0x0101;
+              }
           }

         if (image_depth > MAGICKCORE_QUANTUM_DEPTH)
@@ -7989,21 +8031,34 @@

     else
       {
-        if (logging != MagickFalse)
-          {
-            (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "    Scaling ping_trans_color (2)");
-          }

         if (image_depth < 8)
           image_depth=8;

         if ((save_image_depth == 16) && (image_depth == 8))
           {
+            if (logging != MagickFalse)
+              {
+                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                  "    Scaling ping_trans_color from (%d,%d,%d)",
+                  (int) ping_trans_color.red,
+                  (int) ping_trans_color.green,
+                  (int) ping_trans_color.blue);
+              }
+
             ping_trans_color.red*=0x0101;
             ping_trans_color.green*=0x0101;
             ping_trans_color.blue*=0x0101;
             ping_trans_color.gray*=0x0101;
+
+            if (logging != MagickFalse)
+              {
+                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+                  "    to (%d,%d,%d)",
+                  (int) ping_trans_color.red,
+                  (int) ping_trans_color.green,
+                  (int) ping_trans_color.blue);
+              }
           }
       }

@@ -8024,7 +8079,7 @@

          maxval=(png_uint_16) ((one << ping_bit_depth)-1);

-         if (ping_exclude_bKGD == MagickTrue)
+         if (ping_exclude_bKGD == MagickFalse)
          {

          ping_background.gray=(png_uint_16)
@@ -8443,7 +8498,7 @@
     }

 #if defined(PNG_oFFs_SUPPORTED)
-  if (ping_exclude_pHYs == MagickFalse)
+  if (ping_exclude_oFFs == MagickFalse)
     {
       if (image->page.x || image->page.y)
         {
@@ -8501,7 +8556,8 @@

   if (ping_exclude_vpAg == MagickFalse)
     {
-      if (image->page.width || image->page.height)
+      if ((image->page.width != 0 && image->page.width != image->columns) ||
+          (image->page.height != 0 && image->page.height != image->rows))
         {
           unsigned char
             chunk[14];
@@ -8909,16 +8965,17 @@
           text[0].text_length=strlen(value);

           if (ping_exclude_tEXt != MagickFalse)
-             text[0].compression=0;
+             text[0].compression=PNG_TEXT_COMPRESSION_zTXt;

           else if (ping_exclude_zTXt != MagickFalse)
-             text[0].compression=-1;
+             text[0].compression=PNG_TEXT_COMPRESSION_NONE;

           else
           {
-                text[0].compression=image_info->compression == NoCompression ||
-                  (image_info->compression == UndefinedCompression &&
-                  text[0].text_length < 128) ? -1 : 0;
+             text[0].compression=image_info->compression == NoCompression ||
+               (image_info->compression == UndefinedCompression &&
+               text[0].text_length < 128) ? PNG_TEXT_COMPRESSION_NONE :
+               PNG_TEXT_COMPRESSION_zTXt ;
           }

           if (logging != MagickFalse)


Got execing the specified number of processes working, signal hadling for them and cleaning them up, don't have parsing round robin implemented yet (need sleep before messing this part up)

--- homework3/uniqify.c
+++ homework3/uniqify.c
@@ -9,45 +9,95 @@
 #include <signal.h>
 #include <sys/types.h>
 #include <wait.h>
+#include <malloc.h>

 struct sigaction act;
-pid_t pid;
+//int *pid, num_proc; /* This is a global variable for usage with the signal handler */
+pid_t *pids;
+long num_proc;

 int parser(FILE *input, FILE *output);
 static char *to_lower(char *str);
 void signalHandler(int signum, siginfo_t *info, void *ptr);
+void display_error(void);
+

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

-	int num_proc;
-	int pipefdout[2], pipefdin[2];
-	FILE *output, *input;
-
-	if (pipe(pipefdout) != 0) {
-		perror("pipe");
-		exit(EXIT_FAILURE);
-	}
-
-	if (pipe(pipefdin) != 0) {
-		perror("pipe");
-		exit(EXIT_FAILURE);
-	}
+	int i; /* The number of processes to run */
+	int **pipefdin; /* array of file descriptors for input from sorter */
+	int **pipefdout; /* array of file descriptors for output to sorter */
+	//int pipefdout[2], pipefdin[2];
+	//FILE *output, *input;
+	FILE **output;
+	FILE **input;
+	char mem_err[] = "Memory allocation failure";
+	char stream_err[] = "Stream allocation failure";

 	/* check if correct number of arguments passed */
 	if (argc < 2) {
-		printf("\n Usage: uniqify -[number_of_processes]\n");
+		display_error();
 		exit(EXIT_FAILURE);
 	}

 	/* read in number of processes desired */
-	sscanf(argv[1] + 1, "%d", &num_proc); /* sneaky hack to remove - */
+	sscanf(argv[1]+1, "%ld", &num_proc); /* sneaky hack to remove - */
 	if (num_proc == 0) {
-		printf("\n Usage: uniqify -[number_of_processes (greater than zero)]\n");
-		exit(EXIT_FAILURE);
-	}
-	printf("\nNumber of commands: %d, Number of processes: %d\n", argc,
-	                num_proc);
+		display_error();
+		exit(EXIT_FAILURE);
+	}
+
+	/* Check to see if number of desired processes is greater than the system
+	 * allows.
+	 */
+	if(num_proc > sysconf(_SC_CHILD_MAX)){
+		fprintf(stderr, "Sorry, %ld is too large for this system\n", num_proc);
+		exit(EXIT_FAILURE);
+	}
+
+	/* Allocating array to hold pipe file descriptors */
+	pipefdin = (int**)calloc(num_proc, sizeof(int*));
+	if(pipefdin == NULL){
+		fprintf(stderr, "%s\n", mem_err);
+		exit(EXIT_FAILURE);
+	}
+
+	pipefdout = (int**) calloc(num_proc, sizeof(int*));
+	if (pipefdout == NULL ) {
+		fprintf(stderr, "%s\n", mem_err);
+		exit(EXIT_FAILURE);
+	}
+
+	/* Allocate stream */
+	input = (FILE**)calloc(num_proc, sizeof(FILE*));
+	if(input == NULL){
+		fprintf(stderr, "%s\n", stream_err);
+		exit(EXIT_FAILURE);
+	}
+	output = (FILE**) calloc(num_proc, sizeof(FILE*));
+	if (output == NULL ) {
+		fprintf(stderr, "%s\n", stream_err);
+		exit(EXIT_FAILURE);
+	}
+
+	/* Allocate space for pipe file descriptors to store */
+	for(i = 0; i < num_proc; i++){
+		pipefdout[i] = (int*)calloc(2, sizeof(int));
+		if(pipefdout[i] == NULL){
+			fprintf(stderr, "%s\n", mem_err);
+			exit(EXIT_FAILURE);
+		}
+		pipefdin[i] = (int*)calloc(2, sizeof(int));
+		if(pipefdin[i] == NULL){
+			fprintf(stderr, "%s\n", mem_err);
+			exit(EXIT_FAILURE);
+		}
+	}
+
+	/* Allocate array of pids */
+	pids = (pid_t*)calloc(num_proc, sizeof(pid_t));
+

 	/* Setting up signal handling */
 	memset(&act, 0, sizeof(act));
@@ -57,44 +107,80 @@
 	sigaction(SIGQUIT, &act, NULL );
 	sigaction(SIGHUP, &act, NULL );

-	switch(pid = fork()){
-	case -1:
-		perror("process creation");
-		exit(EXIT_FAILURE);
-	case 0:
-		//child
-		close(pipefdout[1]);
-		close(pipefdin[0]);
-		dup2(pipefdout[0], STDIN_FILENO);
-		dup2(pipefdin[1], STDOUT_FILENO);
-		close(pipefdout[0]);
-		close(pipefdin[1]);
-		execlp("sort", "sort", "-u", (char *)NULL);
-
-		break;
-	default:
-		output = fdopen(pipefdout[1], "w");
-		input = fdopen(pipefdin[0], "r");
-
-		close(pipefdout[0]);
-		close(pipefdin[1]);
-		while(parser(stdin, output) > 0);
-		fclose(output);
-		while(parser(input, stdout) > 0);
-		fclose(input);
-		break;
-	}
-
+	/* Begin piping and forking processes */
+	for (i = 0; i < num_proc; i++) {
+		if (pipe(pipefdin[i]) == -1) {
+			perror("pipes");
+			exit(EXIT_FAILURE);
+		}
+		if (pipe(pipefdout[i]) == -1) {
+			perror("pipes");
+			exit(EXIT_FAILURE);
+		}
+		switch (pids[i] = fork()) {
+		case -1:
+			perror("process not created");
+			free(pipefdin);
+			free(pipefdout);
+			free(input);
+			free(output);
+			break;
+
+		case 0:
+			/* child */
+			close(pipefdout[i][1]); /* close sort write fd */
+			close(pipefdin[i][0]); /* close sort out's read fd */
+			dup2(pipefdout[i][0], STDIN_FILENO); /* set sort in as parent out */
+			dup2(pipefdin[i][1], STDOUT_FILENO);/* set sort out as output */
+			close(pipefdout[i][0]); /* close it's remapped fd */
+			close(pipefdin[i][1]); /* close it's remapped fd */
+			execlp("sort", "sort", (char *) NULL );
+			break;
+
+		default:
+			/* parent */
+			output[i] = fdopen(pipefdout[i][1], "w");
+			input[i] = fdopen(pipefdin[i][0], "r");
+
+			close(pipefdout[i][0]);
+			close(pipefdin[i][1]);
+			break;
+		}
+	}
+
+	//sleep(50);
+
+	/* parse */
+	//while (parser(stdin, output[0]) > 0);
+	//fclose(output[0]);
+	//while (parser(input[0], stdout) > 0);
+	//fclose(input[0]);
+
+	/* cleanup the arrays */
+	free(pipefdin);
+	free(pipefdout);
+	free(input);
+	free(output);

 	exit(EXIT_SUCCESS);
 }

+void display_error(void)
+{
+	char error[] = "Usage: uniqify -[number_of_processes (greater than zero)]";
+	fprintf(stderr, "\n %s\n\n\n", error);
+}
+
 void signalHandler(int signum, siginfo_t *info, void *ptr)
 {
-	int status;
+	int status, i;
 	//printf("\nSignal: %d\n", signum);
-	kill(pid, signum);
-	wait(&status);
+	//kill(pids[0], signum);
+	//wait(&status);
+	for(i = 0; i < num_proc; i++){
+		kill(pids[i], signum);
+		wait(&status);
+	}
 	exit(EXIT_FAILURE);
 }


removed xrdp/xrdp_interface.c

removed xrdp/xrdp_interface.c

--- xrdp/xrdp_interface.c
+++ xrdp/xrdp_interface.c
@@ -1,446 +0,0 @@
-/*
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-   xrdp: A Remote Desktop Protocol server.
-   Copyright (C) Jay Sorg 2004-2007
-
-   interface
-
-*/
-
-#include "xrdp.h"
-
-/*****************************************************************************/
-/* this is the log windows nofity function */
-int DEFAULT_CC
-xrdp_wm_log_wnd_notify(struct xrdp_bitmap* wnd,
-                       struct xrdp_bitmap* sender,
-                       int msg, long param1, long param2)
-{
-  struct xrdp_painter* painter;
-  struct xrdp_wm* wm;
-  struct xrdp_rect rect;
-  int index;
-  char* text;
-
-  if (wnd == 0)
-  {
-    return 0;
-  }
-  if (sender == 0)
-  {
-    return 0;
-  }
-  if (wnd->owner == 0)
-  {
-    return 0;
-  }
-  wm = wnd->wm;
-  if (msg == 1) /* click */
-  {
-    if (sender->id == 1) /* ok button */
-    {
-      /* close the log window */
-      MAKERECT(rect, wnd->left, wnd->top, wnd->width, wnd->height);
-      xrdp_bitmap_delete(wnd);
-      xrdp_bitmap_invalidate(wm->screen, &rect);
-      if (wm->mod_handle == 0)
-      {
-        wm->pro_layer->term = 1; /* kill session */
-      }
-    }
-  }
-  else if (msg == WM_PAINT) /* 3 */
-  {
-    painter = (struct xrdp_painter*)param1;
-    if (painter != 0)
-    {
-      painter->font->color = wnd->wm->black;
-      for (index = 0; index < wnd->wm->log->count; index++)
-      {
-        text = (char*)list_get_item(wnd->wm->log, index);
-        xrdp_painter_draw_text(painter, wnd, 10, 30 + index * 15, text);
-      }
-    }
-  }
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_begin_update(struct xrdp_mod* mod)
-{
-  struct xrdp_wm* wm;
-  struct xrdp_painter* p;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  p = xrdp_painter_create(wm, wm->session);
-  xrdp_painter_begin_update(p);
-  mod->painter = (long)p;
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_end_update(struct xrdp_mod* mod)
-{
-  struct xrdp_painter* p;
-
-  p = (struct xrdp_painter*)mod->painter;
-  xrdp_painter_end_update(p);
-  xrdp_painter_delete(p);
-  mod->painter = 0;
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_fill_rect(struct xrdp_mod* mod, int x, int y, int cx, int cy)
-{
-  struct xrdp_wm* wm;
-  struct xrdp_painter* p;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  p = (struct xrdp_painter*)mod->painter;
-  xrdp_painter_fill_rect(p, wm->screen, x, y, cx, cy);
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_screen_blt(struct xrdp_mod* mod, int x, int y, int cx, int cy,
-                  int srcx, int srcy)
-{
-  struct xrdp_wm* wm;
-  struct xrdp_painter* p;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  p = (struct xrdp_painter*)mod->painter;
-  p->rop = 0xcc;
-  xrdp_painter_copy(p, wm->screen, wm->screen, x, y, cx, cy, srcx, srcy);
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_paint_rect(struct xrdp_mod* mod, int x, int y, int cx, int cy,
-                  char* data, int width, int height, int srcx, int srcy)
-{
-  struct xrdp_wm* wm;
-  struct xrdp_bitmap* b;
-  struct xrdp_painter* p;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  p = (struct xrdp_painter*)mod->painter;
-  b = xrdp_bitmap_create_with_data(width, height, wm->screen->bpp, data, wm);
-  xrdp_painter_copy(p, b, wm->screen, x, y, cx, cy, srcx, srcy);
-  xrdp_bitmap_delete(b);
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_set_pointer(struct xrdp_mod* mod, int x, int y,
-                   char* data, char* mask)
-{
-  struct xrdp_wm* wm;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  xrdp_wm_pointer(wm, data, mask, x, y);
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_palette(struct xrdp_mod* mod, int* palette)
-{
-  struct xrdp_wm* wm;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  if (g_memcmp(wm->palette, palette, 255 * sizeof(int)) != 0)
-  {
-    g_memcpy(wm->palette, palette, 256 * sizeof(int));
-    xrdp_wm_send_palette(wm);
-  }
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_msg(struct xrdp_mod* mod, char* msg, int code)
-{
-  struct xrdp_wm* wm;
-  struct xrdp_bitmap* but;
-
-  if (code == 1)
-  {
-    g_writeln(msg);
-    return 0;
-  }
-  wm = (struct xrdp_wm*)mod->wm;
-  list_add_item(wm->log, (long)g_strdup(msg));
-  if (wm->log_wnd == 0)
-  {
-    /* log window */
-    wm->log_wnd = xrdp_bitmap_create(400, 400, wm->screen->bpp,
-                                     WND_TYPE_WND, wm);
-    list_add_item(wm->screen->child_list, (long)wm->log_wnd);
-    wm->log_wnd->parent = wm->screen;
-    wm->log_wnd->owner = wm->screen;
-    wm->log_wnd->bg_color = wm->grey;
-    wm->log_wnd->left = 10;
-    wm->log_wnd->top = 10;
-    set_string(&wm->log_wnd->caption1, "Connection Log");
-    /* ok button */
-    but = xrdp_bitmap_create(60, 25, wm->screen->bpp, WND_TYPE_BUTTON, wm);
-    list_insert_item(wm->log_wnd->child_list, 0, (long)but);
-    but->parent = wm->log_wnd;
-    but->owner = wm->log_wnd;
-    but->left = (400 - 60) - 10;
-    but->top = (400 - 25) - 10;
-    but->id = 1;
-    but->tab_stop = 1;
-    set_string(&but->caption1, "OK");
-    wm->log_wnd->focused_control = but;
-    /* set notify function */
-    wm->log_wnd->notify = xrdp_wm_log_wnd_notify;
-  }
-  xrdp_bitmap_invalidate(wm->log_wnd, 0);
-  g_sleep(100);
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_is_term(struct xrdp_mod* mod)
-{
-  return g_is_term();
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_set_clip(struct xrdp_mod* mod, int x, int y, int cx, int cy)
-{
-  struct xrdp_painter* p;
-
-  p = (struct xrdp_painter*)mod->painter;
-  return xrdp_painter_set_clip(p, x, y, cx, cy);
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_reset_clip(struct xrdp_mod* mod)
-{
-  struct xrdp_painter* p;
-
-  p = (struct xrdp_painter*)mod->painter;
-  return xrdp_painter_clr_clip(p);
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_set_fgcolor(struct xrdp_mod* mod, int fgcolor)
-{
-  struct xrdp_painter* p;
-
-  p = (struct xrdp_painter*)mod->painter;
-  p->fg_color = fgcolor;
-  p->pen.color = p->fg_color;
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_set_bgcolor(struct xrdp_mod* mod, int bgcolor)
-{
-  struct xrdp_painter* p;
-
-  p = (struct xrdp_painter*)mod->painter;
-  p->bg_color = bgcolor;
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_set_opcode(struct xrdp_mod* mod, int opcode)
-{
-  struct xrdp_painter* p;
-
-  p = (struct xrdp_painter*)mod->painter;
-  p->rop = opcode;
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_set_mixmode(struct xrdp_mod* mod, int mixmode)
-{
-  struct xrdp_painter* p;
-
-  p = (struct xrdp_painter*)mod->painter;
-  p->mix_mode = mixmode;
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_set_brush(struct xrdp_mod* mod, int x_orgin, int y_orgin,
-                 int style, char* pattern)
-{
-  struct xrdp_painter* p;
-
-  p = (struct xrdp_painter*)mod->painter;
-  p->brush.x_orgin = x_orgin;
-  p->brush.y_orgin = y_orgin;
-  p->brush.style = style;
-  g_memcpy(p->brush.pattern, pattern, 8);
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_set_pen(struct xrdp_mod* mod, int style, int width)
-{
-  struct xrdp_painter* p;
-
-  p = (struct xrdp_painter*)mod->painter;
-  p->pen.style = style;
-  p->pen.width = width;
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_draw_line(struct xrdp_mod* mod, int x1, int y1, int x2, int y2)
-{
-  struct xrdp_wm* wm;
-  struct xrdp_painter* p;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  p = (struct xrdp_painter*)mod->painter;
-  return xrdp_painter_line(p, wm->screen, x1, y1, x2, y2);
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_add_char(struct xrdp_mod* mod, int font, int charactor,
-                int offset, int baseline,
-                int width, int height, char* data)
-{
-  struct xrdp_font_char fi;
-
-  fi.offset = offset;
-  fi.baseline = baseline;
-  fi.width = width;
-  fi.height = height;
-  fi.incby = 0;
-  fi.data = data;
-  return libxrdp_orders_send_font(((struct xrdp_wm*)mod->wm)->session,
-                                  &fi, font, charactor);
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_draw_text(struct xrdp_mod* mod, int font,
-                 int flags, int mixmode, int clip_left, int clip_top,
-                 int clip_right, int clip_bottom,
-                 int box_left, int box_top,
-                 int box_right, int box_bottom,
-                 int x, int y, char* data, int data_len)
-{
-  struct xrdp_wm* wm;
-  struct xrdp_painter* p;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  p = (struct xrdp_painter*)mod->painter;
-  return xrdp_painter_draw_text2(p, wm->screen, font, flags,
-                                 mixmode, clip_left, clip_top,
-                                 clip_right, clip_bottom,
-                                 box_left, box_top,
-                                 box_right, box_bottom,
-                                 x, y, data, data_len);
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_reset(struct xrdp_mod* mod, int width, int height, int bpp)
-{
-  struct xrdp_wm* wm;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  if (wm->client_info == 0)
-  {
-    return 1;
-  }
-  /* older client can't resize */
-  if (wm->client_info->build <= 419)
-  {
-    return 0;
-  }
-  /* if same, don't need to do anything */
-  if (wm->client_info->width == width &&
-      wm->client_info->height == height &&
-      wm->client_info->bpp == bpp)
-  {
-    return 0;
-  }
-  /* reset lib, client_info gets updated in libxrdp_reset */
-  if (libxrdp_reset(wm->session, width, height, bpp) != 0)
-  {
-    return 1;
-  }
-  /* reset cache */
-  xrdp_cache_reset(wm->cache, wm->client_info);
-  /* resize the main window */
-  xrdp_bitmap_resize(wm->screen, wm->client_info->width,
-                     wm->client_info->height);
-  /* load some stuff */
-  xrdp_wm_load_static_colors(wm);
-  xrdp_wm_load_static_pointers(wm);
-  return 0;
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_query_channel(struct xrdp_mod* mod, int index, char* channel_name,
-                     int* channel_flags)
-{
-  struct xrdp_wm* wm;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  return libxrdp_query_channel(wm->session, index, channel_name,
-                               channel_flags);
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_get_channel_id(struct xrdp_mod* mod, char* name)
-{
-  struct xrdp_wm* wm;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  return libxrdp_get_channel_id(wm->session, name);
-}
-
-/*****************************************************************************/
-int DEFAULT_CC
-server_send_to_channel(struct xrdp_mod* mod, int channel_id,
-                       char* data, int data_len)
-{
-  struct xrdp_wm* wm;
-
-  wm = (struct xrdp_wm*)mod->wm;
-  return libxrdp_send_to_channel(wm->session, channel_id, data, data_len);
-}


update

update

--- utils/ut_list.c
+++ utils/ut_list.c
@@ -243,6 +243,7 @@
             return NULL;
         }
     }
+    list_release_iterator(iter);
     return copy;
 }


Throw warning if defined png:color-type or png:bit-depth value is invalid.

--- coders/png.c
+++ coders/png.c
@@ -6392,9 +6392,15 @@
             for (j=0; j < number_colors; j++)
             {
               if (ping_plte_map[j] == 0)
-               ping_plte_map[j]=ping_plte_map[i];
+              {
+                ping_plte_map[j]=ping_plte_map[i];
+                opacity[j]=TransparentOpacity;
+              }
               else if (ping_plte_map[j] == ping_plte_map[i])
+              {
                 ping_plte_map[j]=0;
+                opacity[j]=opacity[0];
+              }
             }
             remap_needed=MagickTrue;
             break;
@@ -6422,7 +6428,7 @@
   for (i=0; i<256; i++)
   {
     ping_plte_map[i]=i;
-    opacity[i]=0;
+    opacity[i]=OpaqueOpacity;
   }

   if (OptimizePNGColormap(image, ping_plte_map, opacity) == MagickFalse)
@@ -8278,7 +8284,9 @@
 %    o -define: For more precise control of the PNG output, you can use the
 %               Image options "png:bit-depth" and "png:color-type".  These
 %               can be set from the commandline with "-define" and also
-%               from the application programming interfaces.
+%               from the application programming interfaces.  The options
+%               are case-independent and are converted to lowercase before
+%               being passed to this encoder.
 %
 %               png:color-type can be 0, 2, 3, 4, or 6.
 %
@@ -8307,9 +8315,6 @@
 %
 %  TODO: Enforce the previous paragraph.
 %
-%  TODO: Allow all other PNG subformats to be requested via new
-%        "-define png:bit-depth -define png:color-type" options.
-%
 %  Note that another definition, "png:bit-depth-written" exists, but it
 %  is not intended for external use.  It is only used internally by the
 %  PNG encoder to inform the JNG encoder of the depth of the alpha channel.
@@ -8323,13 +8328,15 @@
 %
 %  where x is a location flag and <file> is a file containing the chunk
 %  name in the first 4 bytes, then a colon (":"), followed by the chunk data.
+%  This encoder will compute the chunk length and CRC, so those must not
+%  be included in the file.
 %
 %  "x" can be "b" (before PLTE), "m" (middle, i.e., between PLTE and IDAT),
 %  or "e" (end, i.e., after IDAT).  If you want to write multiple chunks
 %  of the same type, then add a short unique string after the "x" to prevent
-%  subsequent profiles from overwriting the preceding ones:
-%
-%     -profile PNG-chunk-x01:file01 -profile PNG-chunk-x02:file02
+%  subsequent profiles from overwriting the preceding ones, e.g.,
+%
+%     -profile PNG-chunk-b01:file01 -profile PNG-chunk-b02:file02
 %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 */
@@ -8435,9 +8442,15 @@
         mng_info->write_png_depth = 8;
       else if (LocaleCompare(value,"16") == 0)
         mng_info->write_png_depth = 16;
+      else
+        (void) ThrowMagickException(&image->exception,
+             GetMagickModule(),CoderWarning,
+             "ignoring invalid defined png:bit-depth",
+             "=%s",value);
+
       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "png:bit-depth=%d was defined.\n",mng_info->write_png_depth);
+          "  png:bit-depth=%d was defined.\n",mng_info->write_png_depth);
     }
   value=GetImageOption(image_info,"png:color-type");
   if (value != (char *) NULL)
@@ -8453,9 +8466,15 @@
         mng_info->write_png_colortype = 5;
       else if (LocaleCompare(value,"6") == 0)
         mng_info->write_png_colortype = 7;
+      else
+        (void) ThrowMagickException(&image->exception,
+             GetMagickModule(),CoderWarning,
+             "ignoring invalid defined png:color-type",
+             "=%s",value);
+
       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "png:color-type=%d was defined.\n",mng_info->write_png_colortype-1);
+          "  png:color-type=%d was defined.\n",mng_info->write_png_colortype-1);
     }

   status=WriteOnePNGImage(mng_info,image_info,image);


ENH: Made PrintXML public so that it can be called by users.

--- IO/vtkXMLDataElement.h
+++ IO/vtkXMLDataElement.h
@@ -199,7 +199,11 @@
   // created by this vtkXMLDataParser.
   vtkSetClampMacro(AttributeEncoding,int,VTK_ENCODING_NONE,VTK_ENCODING_UNKNOWN);
   vtkGetMacro(AttributeEncoding, int);
-
+
+  // Description:
+  // Prints element tree as XML.
+  void PrintXML(ostream& os, vtkIndent indent);
+
 protected:
   vtkXMLDataElement();
   ~vtkXMLDataElement();
@@ -238,8 +242,6 @@
   void ReadXMLAttributes(const char** atts, int encoding);
   void SeekInlineDataPosition(vtkXMLDataParser* parser);

-  void PrintXML(ostream& os, vtkIndent indent);
-
   // Internal utility methods.
   vtkXMLDataElement* LookupElementInScope(const char* id);
   vtkXMLDataElement* LookupElementUpScope(const char* id);


don't touch managed memory on CPU first

don't touch managed memory on CPU first

potentially speeds up warm-up

--- hoomd/GlobalArray.h
+++ hoomd/GlobalArray.h
@@ -18,9 +18,8 @@
     back on GPUArray (and whenever it doesn't have an ExecutionConfiguration). This behavior is controlled
     by the result of ExecutionConfiguration::allConcurrentManagedAccess().

-    One difference to GPUArray is that GlobalArray doesn't zero its memory space, so don't forget to initialize
-    the data explicitly. However, if the items are objects that have a constructur, GlobalArray takes
-    care of calling constructors and destructors.
+    One difference to GPUArray is that GlobalArray doesn't zero its memory space, so it is important to
+    explicitly initialize the data.

     Internally, GlobalArray<> uses a smart pointer to comply with RAII semantics.

@@ -131,12 +130,6 @@
                 }
             #endif

-            // we used placement new in the allocation, so call destructors explicitly
-            for (std::size_t i = 0; i < m_N; ++i)
-                {
-                ptr[i].~T();
-                }
-
             #ifdef ENABLE_CUDA
             if (m_use_device)
                 {
@@ -761,9 +754,6 @@
                 }
             #endif

-            // construct objects explicitly using placement new
-            for (std::size_t i = 0; i < m_num_elements; ++i) ::new ((void **) &((T *)ptr)[i]) T;
-
             // store allocation and custom deleter in unique_ptr
             hoomd::detail::managed_deleter<T> deleter(this->m_exec_conf,use_device,
                 m_num_elements, allocation_ptr, allocation_bytes);


--- final_platform_layer.h
+++ final_platform_layer.h
@@ -135,6 +135,8 @@
 	## v0.9.7-beta
 	- New[#105]: [Win32] Added support for creating and using a console in addition to a window
 	- Fixed[#98]: [Win32] Fixed fplThreadYield was not using YieldProcessor()
+
+	- Fixed[#109]: fplS32ToString is not working anymore

 	## v0.9.6-beta
 	### Features
@@ -9179,6 +9181,7 @@
 			*p++ = '-';
 		}
 		p += digitCount;// Go back to the very end, because we are writing the digits back in reverse order
+		char *lastP = p;

 		const char *digits = "0123456789";
 		tmp = value;
@@ -9187,7 +9190,7 @@
 			tmp /= 10;
 		} while(tmp != 0);

-		*p = 0;
+		*lastP = 0;
 	}

 	return (result);


add default CLEAN_INTERVAL of 24 hours

add default CLEAN_INTERVAL of 24 hours

--- src/condor_ckpt_server/constants2.h
+++ src/condor_ckpt_server/constants2.h
@@ -67,6 +67,7 @@
 #define MAX_PATHNAME_LENGTH                 512
 #define DATA_BUFFER_SIZE                    50000
 #define RECLAIM_INTERVAL                    60*5
+#define CLEAN_INTERVAL						60*60*24
 #define MAX_ALLOWED_XFER_TIME               60*60
 #define RECLAIM_BYPASS                      100
 #define STATUS_FILENAME_LENGTH              31


Initial checkin of collection transaction object

error: pathspec 'src/condor_classad.V6/transaction.h' did not match any file(s) known to git

--- src/condor_classad.V6/transaction.h
+++ src/condor_classad.V6/transaction.h
@@ -0,0 +1,44 @@
+#if !defined( XACTION_H )
+#define XACTION_H
+
+#include <hash_map>
+#include <slist>
+#include <string>
+#include "collection_ops.h"
+
+class ClassAd;
+class ClassAdCollectionServer;
+class View;
+
+typedef hash_map<string, ClassAd*>	LocalClassAdTable;
+typedef hash_map<string, View*>		LocalViewRegistry;
+typedef slist<CollectionLogRecord*>	CollectionOpList;
+
+class Transaction {
+public:
+	Transaction( );
+	~Transaction( );
+
+	inline void SetCollectionServer( ClassAdCollectionServer *c ) { server=c; }
+	inline void GetCollectionServer( ClassAdCollectionServer *&c ){ c=server; }
+	inline void SetXactionName( const string &n ) { xactionName = n; }
+	inline void GetXactionName( string &n ) const { n = xactionName; }
+
+	ClassAd	*GetClassAd( const string &key );
+	bool	GetViewInfo( const string &viewName, ClassAd *&viewInfo );
+
+	bool AppendLog( CollectionLogRecord * );
+	bool Log( Sink * );
+	bool Check( ClassAdCollectionServer * );
+	bool Play( ClassAdCollectionServer * );
+	bool Abort( );
+
+private:
+	string					xactionName;
+	ClassAdCollectionServer	*server;
+	CollectionOpList		opList;
+	LocalClassAdTable		classadTable;
+	LocalViewRegistry		viewRegistry;
+};
+
+#endif XACTION_H


[docs] Add full coverage of TwitterTimeline

Document all the public methods of TwitterTimeline.

--- twitter-glib/twitter-timeline.c
+++ twitter-glib/twitter-timeline.c
@@ -146,12 +146,30 @@
   priv->status_list = status_list;
 }

+/**
+ * twitter_timeline_new:
+ *
+ * Creates a new, empty #TwitterTimeline
+ *
+ * Return value: the newly created #TwitterTimeline. Use g_object_unref()
+ *   to free the resources it allocates
+ */
 TwitterTimeline *
 twitter_timeline_new (void)
 {
   return g_object_new (TWITTER_TYPE_TIMELINE, NULL);
 }

+/**
+ * twitter_timeline_new_from_data:
+ * @buffer: a %NULL-terminated string containing the JSON description
+ *   of a timeline
+ *
+ * Creates a new #TwitterTimeline from its JSON representation
+ *
+ * Return value: the newly created #TwitterTimeline. Use g_object_unref()
+ *   to free the resources it allocates
+ */
 TwitterTimeline *
 twitter_timeline_new_from_data (const gchar *buffer)
 {
@@ -180,6 +198,15 @@
   return retval;
 }

+/**
+ * twitter_timeline_load_from_data:
+ * @timeline: a #TwitterTimeline
+ * @buffer: a %NULL-terminated string containing the JSON description
+ *   of a timeline
+ *
+ * Updates @timeline from a JSON representation. All previous
+ * content will be removed and disposed
+ */
 void
 twitter_timeline_load_from_data (TwitterTimeline *timeline,
                                  const gchar     *buffer)
@@ -207,6 +234,14 @@
   g_object_unref (parser);
 }

+/**
+ * twitter_timeline_get_count:
+ * @timeline: a #TwitterTimeline
+ *
+ * Retrieves the number of #TwitterStatus instances inside @timeline
+ *
+ * Return value: the number of statuses
+ */
 guint
 twitter_timeline_get_count (TwitterTimeline *timeline)
 {
@@ -215,6 +250,16 @@
   return g_hash_table_size (timeline->priv->status_by_id);
 }

+/**
+ * twitter_timeline_get_id:
+ * @timeline: a #TwitterTimeline
+ * @id: a status id
+ *
+ * Retrieves the #TwitterStatus with the given @id, if present
+ * inside the timeline
+ *
+ * Return value: a #TwitterStatus or %NULL
+ */
 TwitterStatus *
 twitter_timeline_get_id (TwitterTimeline *timeline,
                          guint            id)
@@ -225,6 +270,15 @@
                               GUINT_TO_POINTER (id));
 }

+/**
+ * twitter_timeline_get_pos:
+ * @timeline: a #TwitterTimeline
+ * @index_: the position in the timeline
+ *
+ * Retrieves the #TwitterStatus at the given @index_
+ *
+ * Return value: a #TwitterStatus
+ */
 TwitterStatus *
 twitter_timeline_get_pos (TwitterTimeline *timeline,
                           gint             index_)
@@ -243,6 +297,17 @@
     }
 }

+/**
+ * twitter_timeline_get_all:
+ * @timeline: a #TwitterTimeline
+ *
+ * Retrieves all the #TwitterStatus instances inside @timeline
+ *
+ * Return value: a copy of the list of statuses. The #TwitterStatus
+ *   instances inside the returned list are owned by the timeline
+ *   and should not be modified or freed. Use g_list_free() to free
+ *   the resources allocated by the list
+ */
 GList *
 twitter_timeline_get_all (TwitterTimeline *timeline)
 {