set_adjacencies() works now

set_adjacencies() works now

--- src/S3ErgodicMoves.h
+++ src/S3ErgodicMoves.h
@@ -35,6 +35,7 @@
 #include <random>
 #include <vector>
 #include <utility>
+#include <algorithm>

 /// Results are converted to a CGAL multi-precision floating point number.
 /// Gmpzf itself is based on GMP (https://gmplib.org), as is MPFR.
@@ -226,6 +227,43 @@
   return movable;
 }  // find_26_movable()

+int find_disjoint_index(Cell_handle const first,
+                        Cell_handle const second) noexcept {
+  std::vector<Vertex_handle> first_vertices;
+  std::vector<Vertex_handle> second_vertices;
+  std::vector<Vertex_handle> disjoint_vector;
+  for (auto i = 0; i < 4; ++i) {
+    first_vertices.emplace_back(first->vertex(i));
+    second_vertices.emplace_back(second->vertex(i));
+  }
+
+  // Sort vectors
+  std::sort(first_vertices.begin(), first_vertices.end());
+  std::sort(second_vertices.begin(), second_vertices.end());
+
+  std::cout << "Cell 1 has the following vertices: " << std::endl;
+  for (auto i : first_vertices) {
+    std::cout << i->point() << std::endl;
+  }
+  std::cout << "Cell 2 has the following vertices: " << std::endl;
+  for (auto i: second_vertices) {
+    std::cout << i->point() << std::endl;
+  }
+  std::set_difference(first_vertices.begin(), first_vertices.end(),
+                      second_vertices.begin(), second_vertices.end(),
+                      std::inserter(disjoint_vector, disjoint_vector.begin()));
+  //CGAL_triangulation_precondition(disjoint_vector.size() == 1);
+  std::cout << "The following vertices are disjoint between cell 1 & 2: "
+            << std::endl;
+  for (auto i : disjoint_vector) {
+    std::cout << i->point() << std::endl;
+  }
+  auto result = disjoint_vector.front();
+  std::cout << "We're going to return the vertex " << result->point()
+            << " with an index of " << first->index(result) << std::endl;
+  return first->index(result);
+}
+
 /// @brief Set pairs of cells to be each others neighbors
 ///
 /// Given a vector of pairs of Cell_handles, find their mutual
@@ -240,27 +278,13 @@
     Cell_handle first = i.first;
     Cell_handle second = i.second;
     // Find the index of the second cell wrt the first cell
-    int neighbor_index;
-    first->has_neighbor(second, neighbor_index);
+    auto neighbor_index = find_disjoint_index(first, second);
     // Find the index of the first cell wrt the second cell
-    int neighbor_mirror_index;
-    second->has_neighbor(first, neighbor_mirror_index);
+    auto neighbor_mirror_index = find_disjoint_index(second, first);
     D3->tds().set_adjacency(first, neighbor_index, second,
                             neighbor_mirror_index);
   }
-
-  // Set adjacency relations for external neighbors of bottom and top
-  // int bottom_neighbor_1_index;
-  // bottom_12->has_neighbor(bottom_neighbor_1, bottom_neighbor_1_index);
-  // std::cout << "bottom_neighbor_1_index is "
-  //           << bottom_neighbor_1_index << std::endl;
-  // int bottom_neighbor_1_mirror_index;
-  // bottom_neighbor_1->has_neighbor(bottom_12, bottom_neighbor_1_mirror_index);
-  // std::cout << "it's mirror vertex is "
-  //           << bottom_neighbor_1_mirror_index << std::endl;
-  // D3->tds().set_adjacency(bottom_12, bottom_neighbor_1_index,
-  //                         bottom_neighbor_1, bottom_neighbor_1_mirror_index);
-}
+}  // set_adjacencies()

 /// @brief Convert (1,3) and (3,1) into 3 (1,3)s and 3 (3,1)s
 ///
@@ -297,6 +321,9 @@
   CGAL_triangulation_precondition(bottom->has_neighbor
                                   (top));
   CGAL_triangulation_expensive_precondition(is_cell(bottom, top));
+
+  // The vector of all cells involved in the move
+  std::vector<Cell_handle> cells;

   int common_face_index;
   // has_neighbor() returns the index of the common face
@@ -402,11 +429,17 @@

   // Get neighbors
   Cell_handle bottom_neighbor_1 = bottom->neighbor(i1);
+  cells.emplace_back(bottom_neighbor_1);
   Cell_handle bottom_neighbor_2 = bottom->neighbor(i2);
+  cells.emplace_back(bottom_neighbor_2);
   Cell_handle bottom_neighbor_3 = bottom->neighbor(i3);
+  cells.emplace_back(bottom_neighbor_3);
   Cell_handle top_neighbor_1 = top->neighbor(in1);
+  cells.emplace_back(top_neighbor_1);
   Cell_handle top_neighbor_2 = top->neighbor(in2);
+  cells.emplace_back(top_neighbor_2);
   Cell_handle top_neighbor_3 = top->neighbor(in3);
+  cells.emplace_back(top_neighbor_3);

   // Delete old cells
   D3->tds().delete_cell(bottom);
@@ -414,11 +447,17 @@

   // Create new ones
   Cell_handle bottom_12 = D3->tds().create_cell(v1, v_center, v2, v_bottom);
+  cells.emplace_back(bottom_12);
   Cell_handle bottom_23 = D3->tds().create_cell(v2, v_center, v3, v_bottom);
+  cells.emplace_back(bottom_23);
   Cell_handle bottom_31 = D3->tds().create_cell(v3, v_center, v1, v_bottom);
+  cells.emplace_back(bottom_31);
   Cell_handle top_12 = D3->tds().create_cell(v1, v_center, v2, v_top);
+  cells.emplace_back(top_12);
   Cell_handle top_23 = D3->tds().create_cell(v2, v_center, v3, v_top);
+  cells.emplace_back(top_23);
   Cell_handle top_31 = D3->tds().create_cell(v3, v_center, v1, v_top);
+  cells.emplace_back(top_31);

   // Set incident cell for v_center which should make it a valid vertex
   v_center->set_cell(bottom_12);


x86 unary operators can operate on memory

--- src/cc1/out/x86_64.c
+++ src/cc1/out/x86_64.c
@@ -981,7 +981,7 @@
 {
 	const char *opc;

-	v_to(vtop, TO_REG | TO_CONST);
+	v_to(vtop, TO_REG | TO_CONST | TO_MEM);

 	switch(op){
 		default:
@@ -1002,7 +1002,9 @@
 			return;
 	}

-	out_asm("%s %s", opc, vstack_str(vtop));
+	out_asm("%s%s %s", opc,
+			x86_suffix(vtop->t),
+			vstack_str(vtop));
 }

 void impl_cast_load(struct vstack *vp, type_ref *small, type_ref *big, int is_signed)


Fix parity check for conditional jumps

Fix parity check for conditional jumps

--- src/cc1/out/x86_64.c
+++ src/cc1/out/x86_64.c
@@ -1606,19 +1606,32 @@
 		case V_FLAG:
 		{
 			char *cmpjmp;
-			int parity_chk, parity_rev;
-
-			parity_chk = x86_need_fp_parity_p(&cond->bits.flag, &parity_rev);
+			int parity_chk, flip_parity_ret;
+
+			parity_chk = x86_need_fp_parity_p(&cond->bits.flag, &flip_parity_ret);

 			if(parity_chk){
-				/* nan means false, unless parity_rev */
+				/* nan means false, unless flip_parity_ret */
+				char *parity_insn, *cmp_insn;
+
+				cmp_insn = ustrprintf(
+						"j%s %s",
+						x86_cmp(&cond->bits.flag),
+						bt->lbl);
+
+				parity_insn = ustrprintf("jp %s",
+						flip_parity_ret ? bt->lbl : bf->lbl);
+
 				cmpjmp = ustrprintf(
-						"j%s %s\n"
-						"\tj%sp %s",
-						x86_cmp(&cond->bits.flag), bt->lbl,
-						parity_rev ? "n" : "", bt->lbl);
+						"%s\n\t%s",
+						parity_insn,
+						cmp_insn);
+
+				free(cmp_insn);
+				free(parity_insn);
 			}else{
 				cmpjmp = ustrprintf("j%s %s", x86_cmp(&cond->bits.flag), bt->lbl);
+				/* fall thru to false block */
 			}

 			blk_terminate_condjmp(octx, cmpjmp, bt, bf);


Guard against undefined shift when processing nonnull attribute

--- src/cc1/parse_attr.c
+++ src/cc1/parse_attr.c
@@ -144,7 +144,8 @@
 				}else{
 					/* implicitly disallow functions with >32 args */
 					/* n-1, since we convert from 1-base to 0-base */
-					l |= 1 << (n - 1);
+					if(n < sizeof(l) * CHAR_BIT)
+						l |= 1 << (n - 1);
 				}
 			}else{
 				EAT(token_integer); /* raise error */


sysinfo: fix less-than-zero comparison of an unsigned value

size_t is an unsigned type, while get_si4_ro_offset() returns int.

Change-Id: I3b216b70fbcc653ced734835ccb2c7f1932d9f0a
Fixes: CID#215888

--- src/common/sysinfo.c
+++ src/common/sysinfo.c
@@ -240,8 +240,8 @@
 void regenerate_si4_restoctets(struct gsm_bts *bts)
 {
 	uint8_t *si4_buf = GSM_BTS_SI(bts, SYSINFO_TYPE_4);
-	size_t si4_size;
 	struct osmo_gsm48_si_ro_info si4ro_tmp;
+	int si4_size;

 	/* If BSC has never set SI4, there's nothing to patch */
 	if (!GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_4))


Update revision

Update revision

git-svn-id: a070b70d2b8c44c266a3870c0cddd9a0ee470458@1178 736b8ea6-26fd-11df-bfd4-992fa37f6226

--- src/common/version.h
+++ src/common/version.h
@@ -1,7 +1,7 @@
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 1166
+#define BUILD_REVISION 1178

 #define STRINGIFY(x) #x
 #define MACRO_STRINGIFY(x) STRINGIFY(x)


compositor-drm: finish frame if initial page-flip fails

If the initial page-flip fails, immediately finish the frame to avoid
being stuck in the given frame. We already do this if we have no fbo
available. Now we do the same if the page-flip fails.

--- src/compositor-drm.c
+++ src/compositor-drm.c
@@ -674,7 +674,7 @@
 	struct drm_compositor *compositor = (struct drm_compositor *)
 		output_base->compositor;
 	uint32_t fb_id;
-
+	uint32_t msec;
 	struct timespec ts;

 	if (output->destroy_pending)
@@ -682,12 +682,7 @@

 	if (!output->current) {
 		/* We can't page flip if there's no mode set */
-		uint32_t msec;
-
-		clock_gettime(compositor->clock, &ts);
-		msec = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
-		weston_output_finish_frame(output_base, msec);
-		return;
+		goto finish_frame;
 	}

 	fb_id = output->current->fb_id;
@@ -695,8 +690,16 @@
 	if (drmModePageFlip(compositor->drm.fd, output->crtc_id, fb_id,
 			    DRM_MODE_PAGE_FLIP_EVENT, output) < 0) {
 		weston_log("queueing pageflip failed: %m\n");
-		return;
-	}
+		goto finish_frame;
+	}
+
+	return;
+
+finish_frame:
+	/* if we cannot page-flip, immediately finish frame */
+	clock_gettime(compositor->clock, &ts);
+	msec = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
+	weston_output_finish_frame(output_base, msec);
 }

 static void


Core/InputHub: Use OneQueue_SetName().

Core/InputHub: Use OneQueue_SetName().

--- src/core/input_hub.c
+++ src/core/input_hub.c
@@ -172,9 +172,13 @@
      if (ret)
           goto error;

+     OneQueue_SetName( hub->method_qid, "InputHub/Method" );
+
      ret = OneQueue_New( ONE_QUEUE_VIRTUAL, ONE_QID_NONE, &hub->notify_qid );
      if (ret)
           goto error;
+
+     OneQueue_SetName( hub->method_qid, "InputHub/Notify" );

      ret = OneThread_Create( "Input Hub", &hub->thread );
      if (ret)
@@ -400,6 +404,8 @@
      if (ret)
           goto error;

+     OneQueue_SetName( client->listen_qid, "InputHub/Listener" );
+
      ret = OneThread_Create( "Input Hub Client", &client->thread );
      if (ret)
           goto error;


Recheck for defined() after macro substitution

--- src/cpp2/directive.c
+++ src/cpp2/directive.c
@@ -342,11 +342,18 @@

 	w = tokens_join(tokens);

-	/* first we need to filter out defined() */
-	w = eval_expand_defined(w);
-
-	/* then macros */
-	w = eval_expand_macros(w);
+	for(;;){
+		/* first we need to filter out defined() */
+		w = eval_expand_defined(w);
+
+		/* then macros */
+		w = eval_expand_macros(w);
+
+		/* then maybe refilter out defined() again */
+		if(word_find(w, DEFINED_STR))
+			continue;
+		break;
+	}

 	/* then parse */
 	e = expr_parse(w);


vm: always pack binary header/sections

vm: always pack binary header/sections

--- src/cshared/stream.h
+++ src/cshared/stream.h
@@ -50,6 +50,7 @@
 };
 #pragma pack(pop)

+#pragma pack(push, 1)
 struct BinSection
 {
     char     name[4];
@@ -59,7 +60,9 @@
     uint64_t pos           = 0;
     uint64_t length        = 0;
 };
+#pragma pack(pop)

+#pragma pack(push, 1)
 struct BinHeader
 {
     char       dab[4];
@@ -70,6 +73,7 @@
     uint64_t   section_count;
     BinSection sections[0];
 };
+#pragma pack(pop)

 struct Stream
 {


Fix Xcode build issue.

Fix Xcode build issue.

git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@11347 6f19259b-4bc3-4df7-8a09-765794883524

--- MdePkg/Include/Arm/ProcessorBind.h
+++ MdePkg/Include/Arm/ProcessorBind.h
@@ -135,8 +135,7 @@
     #define GCC_ASM_EXPORT(func__)  \
              .globl  _CONCATENATE (__USER_LABEL_PREFIX__, func__)    \

-    #define GCC_ASM_IMPORT(name)  \
-             .extern  _CONCATENATE (__USER_LABEL_PREFIX__, name)
+    #define GCC_ASM_IMPORT(name)

   #endif
 #endif


Add setter in AliITSDetTypeRec used to define the SDD raw data format in AMORE monitoring (F. Prino)

--- ITS/AliITSDetTypeRec.h
+++ ITS/AliITSDetTypeRec.h
@@ -61,6 +61,7 @@
     virtual AliITSDDLModuleMapSDD* GetDDLModuleMapSDD() const { return fDDLMapSDD;}
     virtual AliITSresponseSDD* GetResponseSDD() const { return fRespSDD;}
     virtual Bool_t IsHLTmodeC() const {return fIsHLTmodeC;}
+    virtual void SetHLTmodeC(Bool_t ishltc){fIsHLTmodeC=ishltc;}

     virtual void SetDigitClassName(Int_t i,Char_t *digit)
       {fDigClassName[i]=digit;}


ASoC: davinci-mcasp: correct tdm_slots limit

The current check for the number of tdm-slots specified by platform data is
always true (x >= 2 || x <= 32); therefore the else branch that warns of an
incorrect number of slots can never be taken.

Check that the number of tdm slots specified by platform data is between 2
and 32, inclusive.

Signed-off-by: Ben Gardiner <70df8feb3ef5e98f393abcbbb2227739b5f9dc64@nanometrics.ca>
Reviewed-by: James Nuss <005aaaaeb32047f97ff7ff67dbc3e278976eef4e@nanometrics.ca>
Acked-by: Liam Girdwood <a57ef363056e61beffa2efa59c68550d40db03b0@ti.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- sound/soc/davinci/davinci-mcasp.c
+++ sound/soc/davinci/davinci-mcasp.c
@@ -644,7 +644,7 @@
 		mcasp_set_reg(dev->base + DAVINCI_MCASP_TXTDM_REG, mask);
 		mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXORD);

-		if ((dev->tdm_slots >= 2) || (dev->tdm_slots <= 32))
+		if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32))
 			mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG,
 					FSXMOD(dev->tdm_slots), FSXMOD(0x1FF));
 		else
@@ -660,7 +660,7 @@
 				AHCLKRE);
 		mcasp_set_reg(dev->base + DAVINCI_MCASP_RXTDM_REG, mask);

-		if ((dev->tdm_slots >= 2) || (dev->tdm_slots <= 32))
+		if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32))
 			mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG,
 					FSRMOD(dev->tdm_slots), FSRMOD(0x1FF));
 		else


ASoC: Intel: Used lock version to update shim registers

We need hold lock each time updating shirm registers, otherwise,
we may set unexpected values to them when they are set in
different thread at different time sequence.

The notification work will be scheduled in global work queue,
which won't hold this sst->spinlock itself, so here we need
change to use the lock version to update shim registers.

Signed-off-by: Jie Yang <ad2ec63dbc95ba363c35dd8116ca556a9d24614a@intel.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@kernel.org>

--- sound/soc/intel/sst-haswell-ipc.c
+++ sound/soc/intel/sst-haswell-ipc.c
@@ -651,11 +651,11 @@
 	}

 	/* tell DSP that notification has been handled */
-	sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IPCD,
+	sst_dsp_shim_update_bits(hsw->dsp, SST_IPCD,
 		SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE);

 	/* unmask busy interrupt */
-	sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0);
+	sst_dsp_shim_update_bits(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0);
 }

 static struct ipc_message *reply_find_msg(struct sst_hsw *hsw, u32 header)


fix: Use std::numeric_limits for voxel_limits [Image]

--- Modules/Image/include/mirtkVoxel.h
+++ Modules/Image/include/mirtkVoxel.h
@@ -188,8 +188,8 @@
 // -----------------------------------------------------------------------------
 template <> struct voxel_limits<char>
 {
-  static char   min_value() throw() { return static_cast<char  >(0x80); }
-  static char   max_value() throw() { return static_cast<char  >(0x7f); }
+  static char   min_value() throw() { return numeric_limits<char>::lowest(); }
+  static char   max_value() throw() { return numeric_limits<char>::max(); }
   static double min()       throw() { return static_cast<double>(min_value()); }
   static double max()       throw() { return static_cast<double>(max_value()); }
 };
@@ -197,17 +197,17 @@
 // -----------------------------------------------------------------------------
 template <> struct voxel_limits<unsigned char>
 {
-  static unsigned char min_value() throw() { return static_cast<unsigned char>(0u); }
-  static unsigned char max_value() throw() { return static_cast<unsigned char>(0xffu); }
-  static double        min()       throw() { return static_cast<double       >(min_value()); }
-  static double        max()       throw() { return static_cast<double       >(max_value()); }
+  static unsigned char min_value() throw() { return numeric_limits<unsigned char>::lowest(); }
+  static unsigned char max_value() throw() { return numeric_limits<unsigned char>::max(); }
+  static double        min()       throw() { return static_cast<double>(min_value()); }
+  static double        max()       throw() { return static_cast<double>(max_value()); }
 };

 // -----------------------------------------------------------------------------
 template <> struct voxel_limits<short>
 {
-  static short  min_value() throw() { return static_cast<short >(0x8000); }
-  static short  max_value() throw() { return static_cast<short >(0x7fff); }
+  static short  min_value() throw() { return numeric_limits<short>::lowest(); }
+  static short  max_value() throw() { return numeric_limits<short>::max(); }
   static double min()       throw() { return static_cast<double>(min_value()); }
   static double max()       throw() { return static_cast<double>(max_value()); }
 };
@@ -215,16 +215,16 @@
 // -----------------------------------------------------------------------------
 template <> struct voxel_limits<unsigned short>
 {
-  static unsigned short min_value() throw() { return static_cast<unsigned short>(0u); }
-  static unsigned short max_value() throw() { return static_cast<unsigned short>(0xffffu); }
-  static double         min()       throw() { return static_cast<double        >(min_value()); }
-  static double         max()       throw() { return static_cast<double        >(max_value()); }
+  static unsigned short min_value() throw() { return numeric_limits<unsigned short>::lowest(); }
+  static unsigned short max_value() throw() { return numeric_limits<unsigned short>::max(); }
+  static double         min()       throw() { return static_cast<double>(min_value()); }
+  static double         max()       throw() { return static_cast<double>(max_value()); }
 };

 // -----------------------------------------------------------------------------
 template <> struct voxel_limits<int> {
-  static int    min_value() throw() { return static_cast<int   >(~(~0u >> 1)); }
-  static int    max_value() throw() { return static_cast<int   >(  ~0u >> 1);  }
+  static int    min_value() throw() { return numeric_limits<int>::lowest(); }
+  static int    max_value() throw() { return numeric_limits<int>::max();  }
   static double min()       throw() { return static_cast<double>(min_value()); }
   static double max()       throw() { return static_cast<double>(max_value()); }
 };
@@ -232,8 +232,8 @@
 // -----------------------------------------------------------------------------
 template <> struct voxel_limits<unsigned int>
 {
-  static unsigned int min_value() throw() { return static_cast<unsigned int>(0u); }
-  static unsigned int max_value() throw() { return static_cast<unsigned int>( ~0u >> 1); }
+  static unsigned int min_value() throw() { return numeric_limits<unsigned int>::lowest(); }
+  static unsigned int max_value() throw() { return numeric_limits<unsigned int>::max(); }
   static double       min()       throw() { return static_cast<double      >(min_value()); }
   static double       max()       throw() { return static_cast<double      >(max_value()); }
 };
@@ -241,8 +241,8 @@
 // -----------------------------------------------------------------------------
 template <> struct voxel_limits<float>
 {
-  static float  min_value() throw() { return static_cast<float >(-1.0e+38f); }
-  static float  max_value() throw() { return static_cast<float >( 1.0e+38f); }
+  static float  min_value() throw() { return numeric_limits<float>::lowest(); }
+  static float  max_value() throw() { return numeric_limits<float>::max(); }
   static double min()       throw() { return static_cast<double>(min_value()); }
   static double max()       throw() { return static_cast<double>(max_value()); }
 };
@@ -250,8 +250,8 @@
 // -----------------------------------------------------------------------------
 template <> struct voxel_limits<double>
 {
-  static double min_value() throw() { return static_cast<double>(-1.0e+299); }
-  static double max_value() throw() { return static_cast<double>( 1.0e+299); }
+  static double min_value() throw() { return numeric_limits<double>::lowest(); }
+  static double max_value() throw() { return numeric_limits<double>::max(); }
   static double min()       throw() { return static_cast<double>(min_value()); }
   static double max()       throw() { return static_cast<double>(max_value()); }
 };
@@ -343,7 +343,7 @@
   static double3x3 min_value() throw() { return make_double3x3(voxel_limits<double>::min_value()); }
   static double3x3 max_value() throw() { return make_double3x3(voxel_limits<double>::max_value()); }
   static double min() throw() { return voxel_limits<double>::min(); }
-   static double max() throw() { return voxel_limits<double>::max(); }
+  static double max() throw() { return voxel_limits<double>::max(); }
 };

 // -----------------------------------------------------------------------------
@@ -396,10 +396,10 @@
 // interpolators. Treat voxel type as if it was a scalar type here.
 template <> struct voxel_limits<Vector>
 {
-  static Vector min_value() throw() { return Vector(min()); }
-  static Vector max_value() throw() { return Vector(max()); }
-  static double min()       throw() { return static_cast<double>(-1.0e+299); }
-  static double max()       throw() { return static_cast<double>( 1.0e+299); }
+  static Vector min_value() throw() { return Vector(1, min()); }
+  static Vector max_value() throw() { return Vector(1, max()); }
+  static double min()       throw() { return numeric_limits<double>::lowest(); }
+  static double max()       throw() { return numeric_limits<double>::max(); }
 };

 // =============================================================================


forgot to add stepbuffer to motion (so it can be logged)

--- NaoTHSoccer/Source/Motion/Motion.h
+++ NaoTHSoccer/Source/Motion/Motion.h
@@ -49,6 +49,7 @@
 #include "Representations/Modeling/GroundContactModel.h"
 #include "Representations/Motion/CollisionPercept.h"
 #include "Representations/Motion/Walk2018/Walk2018Parameters.h"
+#include "Representations/Motion/Walk2018/StepBuffer.h"

 // debug
 #include <Representations/Debug/Stopwatch.h>
@@ -79,6 +80,7 @@
   PROVIDE(DebugParameterList)
   PROVIDE(DebugModify)

+  REQUIRE(StepBuffer) // hack
   REQUIRE(MotionStatus)
   PROVIDE(OdometryData) // hack
   PROVIDE(InertialModel) // need to overwrite the old filter value by IMUModel
@@ -93,7 +95,7 @@
   PROVIDE(MotorJointData) // TODO: check

   PROVIDE(OffsetJointData)
-
+
   PROVIDE(RobotInfo)
   PROVIDE(KinematicChainSensor)
   PROVIDE(KinematicChainMotor)
@@ -191,7 +193,7 @@
   ModuleCreator<IMUModel>* theIMUModel;
   ModuleCreator<ArmCollisionDetector>* theArmCollisionDetector;
   ModuleCreator<ArmCollisionDetector2018>* theArmCollisionDetector2018;
-
+
   ModuleCreator<CoPProvider>* theCoPProvider;
   ModuleCreator<SensorLogger>* theSensorLogger;


Update Primitives.h

Update Primitives.h

add missing include


Set test sizes and remove testing of cold cache tree

--- LinearHierarchy/Test.h
+++ LinearHierarchy/Test.h
@@ -721,8 +721,8 @@
 #ifdef _DEBUG
 		const SizeType TestRepeatCount = ArrTestRoundNumbers[arrSizeIndex];
 #else
-		//const SizeType TestRepeatCount = ArrTestRoundNumbers[arrSizeIndex];
-		const SizeType TestRepeatCount = 2;
+		const SizeType TestRepeatCount = ArrTestRoundNumbers[arrSizeIndex] > 10 ? 10 : ArrTestRoundNumbers[arrSizeIndex];
+		//const SizeType TestRepeatCount = 2;
 #endif

 		printf("\nTest size: %d\n", TestNodeCount);
@@ -1755,7 +1755,8 @@
 		}

 		// Cold cache
-		if ((TestMask & Flat3) != 0 || (TestMask & Every) != 0)
+		if (false)
+		//if ((TestMask & Flat3) != 0 || (TestMask & Every) != 0)
 		{
 			CurrentTreeType = 2;


--- MagickCore/composite.c
+++ MagickCore/composite.c
@@ -1774,8 +1774,8 @@
             if ((Sca*Da+Dca*Sa) >= Sa*Da)
               pixel=QuantumRange*gamma*(Sa*Da+Sca*(1.0-Da)+Dca*(1.0-Sa));
             else
-              pixel=QuantumRange*gamma*(Dca*Sa*Sa/(Sa-Sca)+Sca*(1.0-Da)+Dca*
-                (1.0-Sa));
+              pixel=QuantumRange*gamma*(Dca*Sa*Sa*PerceptibleReciprocal(Sa-Sca)+
+                Sca*(1.0-Da)+Dca*(1.0-Sa));
             break;
           }
           case ColorizeCompositeOp:
@@ -2312,12 +2312,12 @@
               }
             if ((2.0*Sca) <= Sa)
               {
-                pixel=QuantumRange*gamma*(Sa*(Da+Sa*(Dca-Da)/(2.0*Sca))+Sca*
-                  (1.0-Da)+Dca*(1.0-Sa));
-                break;
-              }
-            pixel=QuantumRange*gamma*(Dca*Sa*Sa/(2.0*(Sa-Sca))+Sca*(1.0-Da)+Dca*
-              (1.0-Sa));
+                pixel=QuantumRange*gamma*(Sa*(Da+Sa*(Dca-Da)*
+                  PerceptibleReciprocal(2.0*Sca))+Sca*(1.0-Da)+Dca*(1.0-Sa));
+                break;
+              }
+            pixel=QuantumRange*gamma*(Dca*Sa*Sa*PerceptibleReciprocal(2.0*
+              (Sa-Sca))+Sca*(1.0-Da)+Dca*(1.0-Sa));
             break;
           }
           case XorCompositeOp:


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

--- MagickWand/operation.c
+++ MagickWand/operation.c
@@ -13,7 +13,7 @@
 %                         MagickWand Module Methods                           %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                              Anthony Thyssen                                %
 %                               September 2011                                %
 %                                                                             %
 %                                                                             %


Issue #16076: fix refleak in pickling of Element.

Thanks to Ezio Melotti and Daniel Shahaf for the patch.

--- Modules/_elementtree.c
+++ Modules/_elementtree.c
@@ -859,8 +859,10 @@
                                      PICKLED_ATTRIB, self->extra->attrib,
                                      PICKLED_TEXT, self->text,
                                      PICKLED_TAIL, self->tail);
-    if (instancedict)
+    if (instancedict) {
+        Py_DECREF(children);
         return instancedict;
+    }
     else {
         for (i = 0; i < PyList_GET_SIZE(children); i++)
             Py_DECREF(PyList_GET_ITEM(children, i));
@@ -884,25 +886,17 @@
         PyErr_SetString(PyExc_TypeError, "tag may not be NULL");
         return NULL;
     }
-    if (!text) {
-        Py_INCREF(Py_None);
-        text = Py_None;
-    }
-    if (!tail) {
-        Py_INCREF(Py_None);
-        tail = Py_None;
-    }

     Py_CLEAR(self->tag);
     self->tag = tag;
     Py_INCREF(self->tag);

     Py_CLEAR(self->text);
-    self->text = text;
+    self->text = text ? text : Py_None;
     Py_INCREF(self->text);

     Py_CLEAR(self->tail);
-    self->tail = tail;
+    self->tail = tail ? tail : Py_None;
     Py_INCREF(self->tail);

     /* Handle ATTRIB and CHILDREN. */


Added function ttob.

Added function ttob.

--- Modules/rgbimgmodule.c
+++ Modules/rgbimgmodule.c
@@ -95,6 +95,8 @@
 #endif

 static object *ImgfileError;
+
+static int reverse_order;

 #ifdef ADD_TAGS
 /*
@@ -339,6 +341,8 @@
   	if(badorder) {
 	    for(z=0; z<zsize; z++) {
 		lptr = base;
+		if (reverse_order)
+		    lptr += (ysize - 1) * xsize * sizeof(unsigned long);
 		for(y=0; y<ysize; y++) {
 		    if(cur != starttab[y+z*ysize]) {
 			fseek(inf,starttab[y+z*ysize],SEEK_SET);
@@ -356,11 +360,16 @@
 		    fread(rledat,lengthtab[y+z*ysize],1,inf);
 		    cur += lengthtab[y+z*ysize];
 		    expandrow(lptr,rledat,3-z);
-		    lptr += xsize * sizeof(unsigned long);
+		    if (reverse_order)
+			lptr -= xsize * sizeof(unsigned long);
+		    else
+			lptr += xsize * sizeof(unsigned long);
 		}
 	    }
 	} else {
 	    lptr = base;
+	    if (reverse_order)
+		lptr += (ysize - 1) * xsize * sizeof(unsigned long);
 	    for(y=0; y<ysize; y++) {
 		for(z=0; z<zsize; z++) {
 		    if(cur != starttab[y+z*ysize]) {
@@ -371,7 +380,10 @@
 		    cur += lengthtab[y+z*ysize];
 		    expandrow(lptr,rledat,3-z);
 		}
-		lptr += xsize * sizeof(unsigned long);
+		if (reverse_order)
+		    lptr -= xsize * sizeof(unsigned long);
+		else
+		    lptr += xsize * sizeof(unsigned long);
 	    }
     	}
 	if(zsize == 3)
@@ -398,10 +410,15 @@
 	fseek(inf,512,SEEK_SET);
 	for(z=0; z<zsize; z++) {
 	    lptr = base;
+	    if (reverse_order)
+		lptr += (ysize - 1) * xsize * sizeof(unsigned long);
 	    for(y=0; y<ysize; y++) {
 		fread(verdat,xsize,1,inf);
 		interleaverow(lptr,verdat,3-z,xsize);
-		lptr += xsize * sizeof(unsigned long);
+		if (reverse_order)
+		    lptr -= xsize * sizeof(unsigned long);
+		else
+		    lptr += xsize * sizeof(unsigned long);
 	    }
 	}
 	if(zsize == 3)
@@ -579,6 +596,8 @@
     goodwrite *= writeheader(outf,&image);
     fseek(outf,512+2*tablen,SEEK_SET);
     pos = 512+2*tablen;
+    if (reverse_order)
+	lptr += (ysize - 1) * xsize * sizeof(unsigned long);
     for(y=0; y<ysize; y++) {
 	for(z=0; z<zsize; z++) {
 	    if(zsize == 1) {
@@ -601,7 +620,10 @@
 	    lengthtab[y+z*ysize] = len;
 	    pos += len;
 	}
-	lptr += xsize * sizeof(unsigned long);
+	if (reverse_order)
+	    lptr -= xsize * sizeof(unsigned long);
+	else
+	    lptr += xsize * sizeof(unsigned long);
     }

     fseek(outf,512,SEEK_SET);
@@ -694,10 +716,25 @@
     return optr - (unsigned char *)rlebuf;
 }

+static object *
+ttob(self, args)
+    object *self;
+    object *args;
+{
+    int order, oldorder;
+
+    if (!getargs(args, "d", &order))
+	return NULL;
+    oldorder = reverse_order;
+    reverse_order = order;
+    return newintobject(oldorder);
+}
+
 static struct methodlist rgbimg_methods[] = {
     {"sizeofimage",	sizeofimage},
     {"longimagedata",	longimagedata},
     {"longstoimage",	longstoimage},
+    {"ttob",		ttob},
     {NULL, NULL}		/* sentinel */
 };


Fix typo in last patch -- the symbol's name is MSG_DONWAIT, not MSG_DONTWAIT.  Reported by Fredrik Lundh.

--- Modules/socketmodule.c
+++ Modules/socketmodule.c
@@ -2527,7 +2527,7 @@
 	insint(d, "MSG_DONTROUTE", MSG_DONTROUTE);
 #endif
 #ifdef	MSG_DONTWAIT
-	insint(d, "MSG_DONWAIT", MSG_DONTWAIT);
+	insint(d, "MSG_DONTWAIT", MSG_DONTWAIT);
 #endif
 #ifdef	MSG_EOR
 	insint(d, "MSG_EOR", MSG_EOR);


small fix

small fix

--- external/Eigen/src/SparseCore/SparseMatrix.h
+++ external/Eigen/src/SparseCore/SparseMatrix.h
@@ -248,7 +248,7 @@
       *
       * \sa resize(Index,Index), data()
       */
-    GISMO_DEPRECATED inline void setZero() // G+Smo
+    EIGEN_DEPRECATED inline void setZero() // G+Smo
     {
       m_data.clear();
       memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(StorageIndex));


genirq: do not execute DEBUG_SHIRQ when irq setup failed

When requesting an IRQ, the DEBUG_SHIRQ code executes a fake IRQ just to make
sure the driver is ready to receive an IRQ immediately.  The problem was that
this fake IRQ was being executed even if interrupt line failed to be allocated
by __setup_irq.

Signed-off-by: Luis Henriques <f59c32834deac78b0d5410e9f6b5d136d75e9fcc@sapo.pt>
LKML-Reference: <a3ffb9e096fee32db7e1c008fb5c67ff68fa3ef1@hades.domain.com>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
[ fixed bug pointed out by a warning reported by Stephen Rothwell ]
Cc: Stephen Rothwell <4bf0fb350827ce8d86875e76c923a478597c3cef@canb.auug.org.au>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- kernel/irq/manage.c
+++ kernel/irq/manage.c
@@ -768,7 +768,7 @@
 		kfree(action);

 #ifdef CONFIG_DEBUG_SHIRQ
-	if (irqflags & IRQF_SHARED) {
+	if (!retval && (irqflags & IRQF_SHARED)) {
 		/*
 		 * It's a shared IRQ -- the driver ought to be prepared for it
 		 * to happen immediately, so let's make sure....


ftrace: disable tracing for hibernation

ftrace: disable tracing for hibernation

In accordance with commit f42ac38c59e0a03d6da0c24a63fb211393f484b0
("ftrace: disable tracing for suspend to ram"), disable tracing
around the suspend code in hibernation code paths.

Signed-off-by: Rafael J. Wysocki <a11f87183a953ab11f50fbafff689c5a7fa3506c@sisk.pl>
Acked-by: Steven Rostedt <9d183ff83abfec5c556edaf86a280a53916a11d8@redhat.com>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- kernel/power/disk.c
+++ kernel/power/disk.c
@@ -21,6 +21,7 @@
 #include <linux/console.h>
 #include <linux/cpu.h>
 #include <linux/freezer.h>
+#include <linux/ftrace.h>

 #include "power.h"

@@ -255,7 +256,7 @@

 int hibernation_snapshot(int platform_mode)
 {
-	int error;
+	int error, ftrace_save;

 	/* Free memory before shutting down devices. */
 	error = swsusp_shrink_memory();
@@ -267,6 +268,7 @@
 		goto Close;

 	suspend_console();
+	ftrace_save = __ftrace_enabled_save();
 	error = device_suspend(PMSG_FREEZE);
 	if (error)
 		goto Recover_platform;
@@ -296,6 +298,7 @@
  Resume_devices:
 	device_resume(in_suspend ?
 		(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
+	__ftrace_enabled_restore(ftrace_save);
 	resume_console();
  Close:
 	platform_end(platform_mode);
@@ -366,10 +369,11 @@

 int hibernation_restore(int platform_mode)
 {
-	int error;
+	int error, ftrace_save;

 	pm_prepare_console();
 	suspend_console();
+	ftrace_save = __ftrace_enabled_save();
 	error = device_suspend(PMSG_QUIESCE);
 	if (error)
 		goto Finish;
@@ -384,6 +388,7 @@
 	platform_restore_cleanup(platform_mode);
 	device_resume(PMSG_RECOVER);
  Finish:
+	__ftrace_enabled_restore(ftrace_save);
 	resume_console();
 	pm_restore_console();
 	return error;
@@ -396,7 +401,7 @@

 int hibernation_platform_enter(void)
 {
-	int error;
+	int error, ftrace_save;

 	if (!hibernation_ops)
 		return -ENOSYS;
@@ -411,6 +416,7 @@
 		goto Close;

 	suspend_console();
+	ftrace_save = __ftrace_enabled_save();
 	error = device_suspend(PMSG_HIBERNATE);
 	if (error) {
 		if (hibernation_ops->recover)
@@ -445,6 +451,7 @@
 	hibernation_ops->finish();
  Resume_devices:
 	device_resume(PMSG_RESTORE);
+	__ftrace_enabled_restore(ftrace_save);
 	resume_console();
  Close:
 	hibernation_ops->end();


sched: Fix select_task_rq_fair() description comments

Brings select_task_rq_fair() description comments up-to-date.

Signed-off-by: Morten Rasmussen <4cb630890d50903d357308bfb549e0e4022cee38@arm.com>
Signed-off-by: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Link: http://lkml.kernel.org/r/1392732864-10927-1-git-send-email-4cb630890d50903d357308bfb549e0e4022cee38@arm.com
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>

--- kernel/sched/fair.c
+++ kernel/sched/fair.c
@@ -4397,13 +4397,14 @@
 }

 /*
- * sched_balance_self: balance the current task (running on cpu) in domains
- * that have the 'flag' flag set. In practice, this is SD_BALANCE_FORK and
- * SD_BALANCE_EXEC.
- *
- * Balance, ie. select the least loaded group.
- *
- * Returns the target CPU number, or the same CPU if no balancing is needed.
+ * select_task_rq_fair: Select target runqueue for the waking task in domains
+ * that have the 'sd_flag' flag set. In practice, this is SD_BALANCE_WAKE,
+ * SD_BALANCE_FORK, or SD_BALANCE_EXEC.
+ *
+ * Balances load by selecting the idlest cpu in the idlest group, or under
+ * certain conditions an idle sibling cpu if the domain has SD_WAKE_AFFINE set.
+ *
+ * Returns the target cpu number.
  *
  * preempt must be disabled.
  */


sched/idle: Add missing checks to the exit condition of cpu_idle_poll()

cpu_idle_poll() is entered into when either the cpu_idle_force_poll is set or
tick_check_broadcast_expired() returns true. The exit condition from
cpu_idle_poll() is tif_need_resched().

However this does not take into account scenarios where cpu_idle_force_poll
changes or tick_check_broadcast_expired() returns false, without setting
the resched flag. So a cpu will be caught in cpu_idle_poll() needlessly,
thereby wasting power. Add an explicit check on cpu_idle_force_poll and
tick_check_broadcast_expired() to the exit condition of cpu_idle_poll()
to avoid this.

Signed-off-by: Preeti U Murthy <437f8f4633f3d09bf55bbcfb98d29bc10a99c7d0@linux.vnet.ibm.com>
Reviewed-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Cc: 624e0123bdcc7ea450e9efbcd399e8858e365d3e@lists.ozlabs.org
Cc: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>
Link: c503a73e00addd56984fdf587ad3501ee32a5335@preeti.in.ibm.com
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>

--- kernel/sched/idle.c
+++ kernel/sched/idle.c
@@ -47,7 +47,8 @@
 	rcu_idle_enter();
 	trace_cpu_idle_rcuidle(0, smp_processor_id());
 	local_irq_enable();
-	while (!tif_need_resched())
+	while (!tif_need_resched() &&
+		(cpu_idle_force_poll || tick_check_broadcast_expired()))
 		cpu_relax();
 	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
 	rcu_idle_exit();


sched: Drop group_capacity to 1 only if local group has extra capacity

When SD_PREFER_SIBLING is set on a sched domain, drop group_capacity to 1
only if the local group has extra capacity. The extra check prevents the case
where you always pull from the heaviest group when it is already under-utilized
(possible with a large weight task outweighs the tasks on the system).

For example, consider a 16-cpu quad-core quad-socket machine with MC and NUMA
scheduling domains. Let's say we spawn 15 nice0 tasks and one nice-15 task,
and each task is running on one core. In this case, we observe the following
events when balancing at the NUMA domain:

- find_busiest_group() will always pick the sched group containing the niced
  task to be the busiest group.
- find_busiest_queue() will then always pick one of the cpus running the
  nice0 task (never picks the cpu with the nice -15 task since
  weighted_cpuload > imbalance).
- The load balancer fails to migrate the task since it is the running task
  and increments sd->nr_balance_failed.
- It repeats the above steps a few more times until sd->nr_balance_failed > 5,
  at which point it kicks off the active load balancer, wakes up the migration
  thread and kicks the nice 0 task off the cpu.

The load balancer doesn't stop until we kick out all nice 0 tasks from
the sched group, leaving you with 3 idle cpus and one cpu running the
nice -15 task.

When balancing at the NUMA domain, we drop sgs.group_capacity to 1 if the child
domain (in this case MC) has SD_PREFER_SIBLING set.  Subsequent load checks are
not relevant because the niced task has a very large weight.

In this patch, we add an extra condition to the "if(prefer_sibling)" check in
update_sd_lb_stats(). We drop the capacity of a group only if the local group
has extra capacity, ie. nr_running < group_capacity. This patch preserves the
original intent of the prefer_siblings check (to spread tasks across the system
in low utilization scenarios) and fixes the case above.

It helps in the following ways:
- In low utilization cases (where nr_tasks << nr_cpus), we still drop
  group_capacity down to 1 if we prefer siblings.
- On very busy systems (where nr_tasks >> nr_cpus), sgs.nr_running will most
  likely be > sgs.group_capacity.
- When balancing large weight tasks, if the local group does not have extra
  capacity, we do not pick the group with the niced task as the busiest group.
  This prevents failed balances, active migration and the under-utilization
  described above.

Signed-off-by: Nikhil Rao <aa0de3d42f37219b73acc73470e3a1bd2defa4dd@google.com>
Signed-off-by: Peter Zijlstra <645ca7d3a8d3d4f60557176cd361ea8351edc32b@chello.nl>
LKML-Reference: <1287173550-30365-5-git-send-email-aa0de3d42f37219b73acc73470e3a1bd2defa4dd@google.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- kernel/sched_fair.c
+++ kernel/sched_fair.c
@@ -2554,9 +2554,14 @@
 		/*
 		 * In case the child domain prefers tasks go to siblings
 		 * first, lower the sg capacity to one so that we'll try
-		 * and move all the excess tasks away.
+		 * and move all the excess tasks away. We lower the capacity
+		 * of a group only if the local group has the capacity to fit
+		 * these excess tasks, i.e. nr_running < group_capacity. The
+		 * extra check prevents the case where you always pull from the
+		 * heaviest group when it is already under-utilized (possible
+		 * with a large weight task outweighs the tasks on the system).
 		 */
-		if (prefer_sibling)
+		if (prefer_sibling && !local_group && sds->this_has_capacity)
 			sgs.group_capacity = min(sgs.group_capacity, 1UL);

 		if (local_group) {


sched: Remove redundant test in check_preempt_tick()

The caller already checks for nr_running > 1, therefore we don't have
to do so again.

Signed-off-by: Wang Xingchao <0ae113da488534f7fe00657f1949b04597984b2e@intel.com>
Reviewed-by: Paul Turner <56b59ac50e86208fd62726b53c1d890b9a8ff058@google.com>
Signed-off-by: Peter Zijlstra <645ca7d3a8d3d4f60557176cd361ea8351edc32b@chello.nl>
Link: http://lkml.kernel.org/r/1316194552-12019-1-git-send-email-0ae113da488534f7fe00657f1949b04597984b2e@intel.com
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- kernel/sched_fair.c
+++ kernel/sched_fair.c
@@ -1106,6 +1106,8 @@
 check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
 {
 	unsigned long ideal_runtime, delta_exec;
+	struct sched_entity *se;
+	s64 delta;

 	ideal_runtime = sched_slice(cfs_rq, curr);
 	delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
@@ -1127,16 +1129,14 @@
 	if (delta_exec < sysctl_sched_min_granularity)
 		return;

-	if (cfs_rq->nr_running > 1) {
-		struct sched_entity *se = __pick_first_entity(cfs_rq);
-		s64 delta = curr->vruntime - se->vruntime;
-
-		if (delta < 0)
-			return;
-
-		if (delta > ideal_runtime)
-			resched_task(rq_of(cfs_rq)->curr);
-	}
+	se = __pick_first_entity(cfs_rq);
+	delta = curr->vruntime - se->vruntime;
+
+	if (delta < 0)
+		return;
+
+	if (delta > ideal_runtime)
+		resched_task(rq_of(cfs_rq)->curr);
 }

 static void


compositemixer: Change to RAW caps

compositemixer: Change to RAW caps

Change-Id: I3dfce986241236b245434feb194076bee69f47a2

--- kmscompositemixer.c
+++ kmscompositemixer.c
@@ -44,6 +44,43 @@
   )                                           \
 )

+#define AUDIO_SINK_PAD_PREFIX_COMP "audio_sink_"
+#define VIDEO_SINK_PAD_PREFIX_COMP "video_sink_"
+#define AUDIO_SRC_PAD_PREFIX_COMP "audio_src_"
+#define VIDEO_SRC_PAD_PREFIX_COMP "video_src_"
+#define AUDIO_SINK_PAD_NAME_COMP AUDIO_SINK_PAD_PREFIX_COMP "%u"
+#define VIDEO_SINK_PAD_NAME_COMP VIDEO_SINK_PAD_PREFIX_COMP "%u"
+#define AUDIO_SRC_PAD_NAME_COMP AUDIO_SRC_PAD_PREFIX_COMP "%u"
+#define VIDEO_SRC_PAD_NAME_COMP VIDEO_SRC_PAD_PREFIX_COMP "%u"
+
+static GstStaticPadTemplate audio_sink_factory =
+GST_STATIC_PAD_TEMPLATE (AUDIO_SINK_PAD_NAME_COMP,
+    GST_PAD_SINK,
+    GST_PAD_SOMETIMES,
+    GST_STATIC_CAPS (KMS_AGNOSTIC_RAW_AUDIO_CAPS)
+    );
+
+static GstStaticPadTemplate video_sink_factory =
+GST_STATIC_PAD_TEMPLATE (VIDEO_SINK_PAD_NAME_COMP,
+    GST_PAD_SINK,
+    GST_PAD_SOMETIMES,
+    GST_STATIC_CAPS (KMS_AGNOSTIC_RAW_VIDEO_CAPS)
+    );
+
+static GstStaticPadTemplate audio_src_factory =
+GST_STATIC_PAD_TEMPLATE (AUDIO_SRC_PAD_NAME_COMP,
+    GST_PAD_SRC,
+    GST_PAD_SOMETIMES,
+    GST_STATIC_CAPS (KMS_AGNOSTIC_RAW_AUDIO_CAPS)
+    );
+
+static GstStaticPadTemplate video_src_factory =
+GST_STATIC_PAD_TEMPLATE (VIDEO_SRC_PAD_NAME_COMP,
+    GST_PAD_SRC,
+    GST_PAD_SOMETIMES,
+    GST_STATIC_CAPS (KMS_AGNOSTIC_RAW_VIDEO_CAPS)
+    );
+
 struct _KmsCompositeMixerPrivate
 {
   GstElement *videomixer;
@@ -546,6 +583,7 @@
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   KmsBaseHubClass *base_hub_class = KMS_BASE_HUB_CLASS (klass);
+  GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);

   gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass),
       "CompositeMixer", "Generic", "Mixer element that composes n input flows"
@@ -563,6 +601,15 @@
   base_hub_class->unhandle_port =
       GST_DEBUG_FUNCPTR (kms_composite_mixer_unhandle_port);

+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&audio_src_factory));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&video_src_factory));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&audio_sink_factory));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&video_sink_factory));
+
   /* Registers a private structure for the instantiatable type */
   g_type_class_add_private (klass, sizeof (KmsCompositeMixerPrivate));
 }


ERR: Still need to include vtkObject.h.

ERR: Still need to include vtkObject.h.

--- Common/vtkInformationKey.h
+++ Common/vtkInformationKey.h
@@ -27,6 +27,7 @@
 #define __vtkInformationKey_h

 #include "vtkObjectBase.h"
+#include "vtkObject.h" // Need vtkTypeRevisionMacro

 class VTK_EXPORT vtkInformationKey : public vtkObjectBase
 {


replace stupid code in __Pyx_PyGen_FetchStopIterationValue() by fast code

--- Cython/Utility/Coroutine.c
+++ Cython/Utility/Coroutine.c
@@ -332,7 +332,6 @@
 static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
     PyObject *et, *ev, *tb;
     PyObject *value = NULL;
-    int result;

     __Pyx_ErrFetch(&et, &ev, &tb);

@@ -346,7 +345,6 @@

     // most common case: plain StopIteration without or with separate argument
     if (likely(et == PyExc_StopIteration)) {
-        int error = 0;
 #if PY_VERSION_HEX >= 0x030300A0
         if (ev && Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
             value = ((PyStopIterationObject *)ev)->value;
@@ -358,7 +356,7 @@
             return 0;
         }
 #endif
-        if (!ev || !(error = PyObject_IsInstance(ev, PyExc_StopIteration))) {
+        if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
             // PyErr_SetObject() and friends put the value directly into ev
             if (!ev) {
                 Py_INCREF(Py_None);
@@ -386,10 +384,6 @@
             *pvalue = ev;
             return 0;
         }
-        if (unlikely(error == -1)) {
-            // error during isinstance() check
-            return -1;
-        }
     } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
         __Pyx_ErrRestore(et, ev, tb);
         return -1;
@@ -397,19 +391,13 @@

     // otherwise: normalise and check what that gives us
     PyErr_NormalizeException(&et, &ev, &tb);
-    result = PyObject_IsInstance(ev, PyExc_StopIteration);
-    if (unlikely(!result)) {
+    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
         // looks like normalisation failed - raise the new exception
         __Pyx_ErrRestore(et, ev, tb);
         return -1;
     }
     Py_XDECREF(tb);
     Py_DECREF(et);
-    if (unlikely(result == -1)) {
-        // error during isinstance() check
-        Py_DECREF(ev);
-        return -1;
-    }
 #if PY_VERSION_HEX >= 0x030300A0
     value = ((PyStopIterationObject *)ev)->value;
     Py_INCREF(value);


fixed http header usage

fixed http header usage

--- wifi_manager/main/http_server.c
+++ wifi_manager/main/http_server.c
@@ -60,7 +60,7 @@
 extern const uint8_t wifi3_png_end[] asm("_binary_wifi3_png_end");

-// HTTP headers and web pages
+/* const http headers stored in ROM */
 const static char http_html_hdr[] = "HTTP/1.1 200 OK\nContent-type: text/html\n\n";
 const static char http_png_hdr[] = "HTTP/1.1 200 OK\nContent-type: image/png\n\n";
 const static char http_css_hdr[] = "HTTP/1.1 200 OK\nContent-type: text/css\n\n";
@@ -441,14 +441,16 @@

 				if(!found){
 					//bad request
-					netconn_write(conn, http_404_hdr, sizeof(http_404_hdr) - 1, NETCONN_NOCOPY);
+					netconn_write(conn, http_400_hdr, sizeof(http_400_hdr) - 1, NETCONN_NOCOPY);
 				}
 			}
 			else{
-				netconn_write(conn, http_404_hdr, sizeof(http_404_hdr) - 1, NETCONN_NOCOPY);
-			}
-		}
-		else printf("Invalid HTTP request ignored\n");
+				netconn_write(conn, http_400_hdr, sizeof(http_400_hdr) - 1, NETCONN_NOCOPY);
+			}
+		}
+		else{
+			netconn_write(conn, http_404_hdr, sizeof(http_404_hdr) - 1, NETCONN_NOCOPY);
+		}
 	}

 	// close the connection and free the buffer


Added a FIXME and a better prototype.

Added a FIXME and a better prototype.

git-svn-id: 0e1153e6534495dc57987e8ae99aae841c146be6@765 1f819a86-672b-0410-b5ed-9de735de380c

--- stormG3/source/ia32/memory_global.c
+++ stormG3/source/ia32/memory_global.c
@@ -1,4 +1,4 @@
-/* $chaos: memory_global.c,v 1.6 2002/08/09 06:16:18 per Exp $ */
+/* $chaos: memory_global.c,v 1.7 2002/10/04 19:01:21 per Exp $ */
 /* Abstract: Global memory allocation. */
 /* Author: Per Lundberg <per@chaosdev.org> */

@@ -21,8 +21,10 @@
 static memory_global_slab_t *global_512byte = NULL;
 static memory_global_slab_t *global_1024byte = NULL;

+// FIXME: Add spinlocks.
+
 /* Initialize global memory allocation. */
-void memory_global_init ()
+void memory_global_init (void)
 {
 }


net: lwm2m: add missing bootstrap-finish handling

When the bootstrap support was added, it looks like I somehow missed
the handling block in the engine.

Let's add it now to fix boostrap support.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/18080

Signed-off-by: Michael Scott <a17fed27eaa842282862ff7c1b9c8395a26ac320@foundries.io>

--- subsys/net/lib/lwm2m/lwm2m_engine.c
+++ subsys/net/lib/lwm2m/lwm2m_engine.c
@@ -3312,6 +3312,13 @@
 		}

 		well_known = true;
+#if defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP)
+	/* check for bootstrap-finish */
+	} else if ((code & COAP_REQUEST_MASK) == COAP_METHOD_POST && r == 1 && \
+		   strncmp(options[0].value, "bs", options[0].len) == 0) {
+		engine_bootstrap_finish();
+		return 0;
+#endif
 	} else {
 		r = coap_options_to_path(options, r, &msg->path);
 		if (r < 0) {


Use an explicit cast to throw away `const' qualifier.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@837432 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_fs/convert-size.c
+++ subversion/libsvn_fs/convert-size.c
@@ -98,7 +98,9 @@
     }
   else
     {
-      *endptr = data + i;
+      /* We have to throw away the const here, to avoid constraining
+	 the caller.  */
+      *endptr = (char *) data + i;
       return value;
     }
 }


* subversion/libsvn_fs_fs/rep-cache.c
  (svn_fs_fs__open_rep_cache): Use a more specific error message.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1051535 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_fs_fs/rep-cache.c
+++ subversion/libsvn_fs_fs/rep-cache.c
@@ -72,8 +72,9 @@
                           apr_pool_t *pool)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
-  return svn_error_return(svn_atomic__init_once(&ffd->rep_cache_db_opened,
-                                                open_rep_cache, fs, pool));
+  svn_error_t *err = svn_atomic__init_once(&ffd->rep_cache_db_opened,
+                                           open_rep_cache, fs, pool);
+  return svn_error_quick_wrap(err, _("Couldn't open rep-cache database"));
 }

 svn_error_t *


ra_serf: Do a pass at documenting some ra_serf-internal functions.

* subversion/libsvn_ra_serf/ra_serf.h: Sprinkle a litle bit of docco...

--- subversion/libsvn_ra_serf/ra_serf.h
+++ subversion/libsvn_ra_serf/ra_serf.h
@@ -322,10 +322,13 @@
                              apr_pool_t *pool);

 /*
- * Handler that discards the entire request body.
- *
- * If baton is a svn_ra_serf__server_error_t and an error is detected, it
- * will be populated for later detection.
+ * Handler that discards the entire @a response body associated with a
+ * @a request.
+ *
+ * If @a baton is a svn_ra_serf__server_error_t (i.e. non-NULL) and an
+ * error is detected, it will be populated for later detection.
+ *
+ * All temporary allocations will be made in a @a pool.
  */
 apr_status_t
 svn_ra_serf__handler_discard_body(serf_request_t *request,
@@ -334,7 +337,7 @@
                                   apr_pool_t *pool);

 /*
- * Helper function to queue a request in the handler's connection.
+ * Helper function to queue a request in the @a handler's connection.
  */
 serf_request_t*
 svn_ra_serf__request_create(svn_ra_serf__handler_t *handler);
@@ -342,14 +345,24 @@
 /* XML helper callbacks. */

 typedef struct svn_ra_serf__xml_state_t {
+  /* A numeric value that represents the current state in parsing.
+   *
+   * Value 0 is reserved for use as the default state.
+   */
   int current_state;

+  /* Private pointer set by the parsing code. */
   void *private;

+  /* Allocations should be made in this pool to match the lifetime of the
+   * state.
+   */
   apr_pool_t *pool;

+  /* The currently-declared namespace for this state. */
   svn_ra_serf__ns_t *ns_list;

+  /* Our previous states. */
   struct svn_ra_serf__xml_state_t *prev;
 } svn_ra_serf__xml_state_t;

@@ -377,26 +390,59 @@
  * specify how an XML response will be processed.
  */
 struct svn_ra_serf__xml_parser_t {
+  /* Temporary allocations should be made in this pool. */
   apr_pool_t *pool;

+  /* Caller-specific data passed to the start, end, cdata callbacks.  */
   void *user_data;

+  /* Callback invoked when a tag is opened. */
   svn_ra_serf__xml_start_element_t start;
+
+  /* Callback invoked when a tag is closed. */
   svn_ra_serf__xml_end_element_t end;
+
+  /* Callback invoked when a cdata chunk is received. */
   svn_ra_serf__xml_cdata_chunk_handler_t cdata;

+  /* Our associated XML parser. */
   XML_Parser xmlp;

+  /* Our current state. */
   svn_ra_serf__xml_state_t *state;
+
+  /* Our previously used states (will be reused). */
   svn_ra_serf__xml_state_t *free_state;

+  /* If non-NULL, the status code of the response will be stored here.
+   *
+   * If this is NULL and an error is received, an abort will be triggered.
+   */
   int *status_code;
+
+  /* If non-NULL, this value will be set to TRUE when the response is
+   * completed.
+   */
   svn_boolean_t *done;
+
+  /* If non-NULL, when this parser completes, it will add done_item to
+   * the list.
+   */
   svn_ra_serf__list_t **done_list;

+  /* A pointer to the item that will be inserted into the list upon
+   * completeion.
+   */
   svn_ra_serf__list_t *done_item;

+  /* If this flag is TRUE, errors during parsing will be ignored.
+   *
+   * This is mainly used when we are processing an error XML response to
+   * avoid infinite loops.
+   */
   svn_boolean_t ignore_errors;
+
+  /* If an error occurred, this value will be non-NULL. */
   svn_error_t *error;
 };

@@ -429,13 +475,27 @@
   apr_size_t message_len;
 } svn_ra_serf__server_error_t;

+/* A simple request context that can be passed to handle_status_only. */
 typedef struct {
+  /* The HTTP status code of the response */
   int status;
+
+  /* The HTTP status line of the response */
   const char *reason;
+
+  /* This value is set to TRUE when the response is completed. */
   svn_boolean_t done;
+
+  /* If an error occurred, this value will be initialized. */
   svn_ra_serf__server_error_t server_error;
 } svn_ra_serf__simple_request_context_t;

+/*
+ * Serf handler for @a request / @a response pair that takes in a
+ * @a baton (@see svn_ra_serf__simple_request_context_t).
+ *
+ * Temporary allocations are made in @a pool.
+ */
 apr_status_t
 svn_ra_serf__handle_status_only(serf_request_t *request,
                                 serf_bucket_t *response,
@@ -459,13 +519,25 @@

 /** XML helper functions. **/

+/*
+ * Advance the internal XML @a parser to the @a state.
+ */
 void
 svn_ra_serf__xml_push_state(svn_ra_serf__xml_parser_t *parser,
                             int state);

+/*
+ * Return to the previous internal XML @a parser state.
+ */
 void
 svn_ra_serf__xml_pop_state(svn_ra_serf__xml_parser_t *parser);

+/*
+ * Add the appropriate serf buckets to @a agg_bucket represented by
+ * the XML * @a tag and @a value.
+ *
+ * The bucket will be allocated from @a bkt_alloc.
+ */
 void
 svn_ra_serf__add_tag_buckets(serf_bucket_t *agg_bucket,
                              const char *tag,
@@ -473,12 +545,10 @@
                              serf_bucket_alloc_t *bkt_alloc);

 /*
- * Look up the ATTRS array for namespace definitions and add each one
- * to the NS_LIST of namespaces.
- *
- * Temporary allocations are made in POOL.
- *
- * TODO: handle scoping of namespaces
+ * Look up the @a attrs array for namespace definitions and add each one
+ * to the @a ns_list of namespaces.
+ *
+ * New namespaces will be allocated in @a pool.
  */
 void
 svn_ra_serf__define_ns(svn_ra_serf__ns_t **ns_list,
@@ -486,22 +556,30 @@
                        apr_pool_t *pool);

 /*
- * Look up NAME in the NS_LIST list for previously declared namespace
- * definitions and return a DAV_PROPS_T-tuple.
+ * Look up @a name in the @a ns_list list for previously declared namespace
+ * definitions.
+ *
+ * @return @a svn_ra_serf__dav_props_t tuple representing the expanded name.
  */
 svn_ra_serf__dav_props_t
 svn_ra_serf__expand_ns(svn_ra_serf__ns_t *ns_list,
                        const char *name);

 /*
- * look for ATTR_NAME in the attrs array and return its value.
+ * Look for @a attr_name in the @a attrs array and return its value.
  *
  * Returns NULL if no matching name is found.
  */
 const char *
 svn_ra_serf__find_attr(const char **attrs,
-          const char *attr_name);
-
+                       const char *attr_name);
+
+/*
+ * Expand the string represented by @a cur with a current size of @a
+ * cur_len by appending @a new with a size of @a new_len.
+ *
+ * The reallocated string is made in @a pool.
+ */
 void
 svn_ra_serf__expand_string(const char **cur, apr_size_t *cur_len,
                            const char *new, apr_size_t new_len,
@@ -509,11 +587,18 @@

 /** PROPFIND-related functions **/

+/* Opaque structure representing PROPFINDs. */
 typedef struct svn_ra_serf__propfind_context_t svn_ra_serf__propfind_context_t;

+/*
+ * Returns a flag representing whether the PROPFIND @a ctx is completed.
+ */
 svn_boolean_t
 svn_ra_serf__propfind_is_done(svn_ra_serf__propfind_context_t *ctx);

+/*
+ * Returns the response status code of the PROPFIND @a ctx.
+ */
 int
 svn_ra_serf__propfind_status_code(svn_ra_serf__propfind_context_t *ctx);


Made only static get() public.

Made only static get() public.

--- downloader.h
+++ downloader.h
@@ -43,7 +43,7 @@
 {
     Q_OBJECT

-public:
+protected:

     /**
      * @brief Constructs downloader, generating target path
@@ -73,8 +73,10 @@
      */
     virtual ~Downloader();

-    /**
-     * @brief Download a file (recommended method)
+public:
+
+    /**
+     * @brief Download a file (public method)
      *
      * Arguments are assumed to be valid - validate before calling this!
      * If the target file already exists, a confirmation dialog is displayed.
@@ -87,6 +89,8 @@
      */
     static QString get(QString sourceUrl, QString targetDir, QString filename="", QString userAgent="");

+protected:
+
     /**
      * @brief Initiate download
      *
@@ -102,7 +106,7 @@
      */
     QString download(int maxRedirects);

-public slots:
+protected slots:

     /**
      * @brief Finish download, clean up


* subversion/libsvn_subr/svn_string.c:   (svn_stringbuf__morph_into_string): kill the weak words. Go big!

--- subversion/libsvn_subr/svn_string.c
+++ subversion/libsvn_subr/svn_string.c
@@ -262,8 +262,8 @@
 #endif

   /* Both, svn_string_t and svn_stringbuf_t are public API structures
-   * since a couple of releases now. Thus, we can rely on their precise
-   * layout not to change.
+   * since the svn epoch. Thus, we can rely on their precise layout not
+   * to change.
    *
    * It just so happens that svn_string_t is structurally equivalent
    * to the (data, len) sub-set of svn_stringbuf_t. There is also no


* subversion/libsvn_subr/svn_string.c
  (svn_stringbuf__morph_into_string): Fix the debug code to specify the
    correct allocated size. This bug could potentially have resulted in
    spurious failures in debug-mode builds, though it is quite unlikely.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1308989 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_subr/svn_string.c
+++ subversion/libsvn_subr/svn_string.c
@@ -258,7 +258,7 @@
    */
 #ifdef SVN_DEBUG
   strbuf->pool = NULL;
-  strbuf->blocksize = strbuf->len;
+  strbuf->blocksize = strbuf->len + 1;
 #endif

   /* Both, svn_string_t and svn_stringbuf_t are public API structures


Don't continue to check mutually exclusive options in the interactive conflict
resolver.

* subversion/svn/conflict-callbacks.c
  (svn_cl__conflict_handler): Use 'else if' when checking prompt responses.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@867638 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/svn/conflict-callbacks.c
+++ subversion/svn/conflict-callbacks.c
@@ -286,23 +286,23 @@
                 "  (l)aunch   - use third-party tool to resolve conflict\n"
                 "  (h)elp     - show this list\n\n")));
             }
-          if (strcmp(answer, "p") == 0)
+          else if (strcmp(answer, "p") == 0)
             {
               /* Do nothing, let file be marked conflicted. */
               (*result)->choice = svn_wc_conflict_choose_postpone;
               break;
             }
-          if (strcmp(answer, "m") == 0)
+          else if (strcmp(answer, "m") == 0)
             {
               (*result)->choice = svn_wc_conflict_choose_mine;
               break;
             }
-          if (strcmp(answer, "t") == 0)
+          else if (strcmp(answer, "t") == 0)
             {
               (*result)->choice = svn_wc_conflict_choose_theirs;
               break;
             }
-          if (strcmp(answer, "d") == 0)
+          else if (strcmp(answer, "d") == 0)
             {
               const char *path1, *path2;
               svn_diff_t *diff;
@@ -343,7 +343,7 @@
                                                     subpool));
               performed_edit = TRUE;
             }
-          if (strcmp(answer, "e") == 0)
+          else if (strcmp(answer, "e") == 0)
             {
               if (desc->merged_file)
                 {
@@ -374,7 +374,7 @@
                                             _("Invalid option; there's no "
                                               "merged version to edit.\n\n")));
             }
-          if (strcmp(answer, "l") == 0)
+          else if (strcmp(answer, "l") == 0)
             {
               if (desc->base_file && desc->their_file &&
                   desc->my_file && desc->merged_file)
@@ -408,7 +408,7 @@
                 SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
                                             _("Invalid option.\n\n")));
             }
-          if (strcmp(answer, "r") == 0)
+          else if (strcmp(answer, "r") == 0)
             {
               /* We only allow the user accept the merged version of
                  the file if they've edited it, or at least looked at


gnrc_sixlowpan_nd: add missing header

gnrc_sixlowpan_nd: add missing header

`gnrc_pktsnip_t` is used in `net/gnrc/sixlowpan/nd.h` but it is not
included. There were no compile errors yet, since this file is always
included with some other GNRC headers, but it might not in the future.

--- sys/include/net/gnrc/sixlowpan/nd.h
+++ sys/include/net/gnrc/sixlowpan/nd.h
@@ -26,6 +26,7 @@
 #include <stdint.h>

 #include "kernel_types.h"
+#include "net/gnrc/pkt.h"
 #include "net/ipv6/addr.h"
 #include "net/ndp.h"
 #include "net/sixlowpan/nd.h"


Mege audit_syscalls.c:1.11 from HEAD to RELENG_6:

  Remove two XXX comments that no longer apply.

  Obtained from:  TrustedBSD Project

--- sys/security/audit/audit_syscalls.c
+++ sys/security/audit/audit_syscalls.c
@@ -192,9 +192,6 @@
 	}

 	/*
-	 * XXX Need to implement these commands by accessing the global
-	 * values associated with the commands.
-	 *
 	 * XXXAUDIT: Locking?
 	 */
 	switch (uap->cmd) {
@@ -542,8 +539,6 @@
 /*
  * MPSAFE
  * Syscall to manage audit files.
- *
- * XXX: Should generate an audit event.
  */
 /* ARGSUSED */
 int


Adding "u" suffix to some integers in is_prime_pseudosquare


got rid of IEntityFactory and descendants

--- stingraykit/GenericEntityFactory.h
+++ stingraykit/GenericEntityFactory.h
@@ -8,10 +8,8 @@
 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

-
 #include <stingraykit/exception.h>
 #include <stingraykit/TypeList.h>
-

 namespace stingray
 {
@@ -58,6 +56,7 @@

 	}

+
 	template < typename Derived, typename TagType, typename ReturnType >
 	class GenericInvoker
 	{
@@ -81,6 +80,7 @@
 #undef DETAIL_STINGRAYKIT_DECLARE_GENERICINVOKER_INVOKE
 	};

+
 	class UnknownEntityTagException : public Exception
 	{
 	public:
@@ -89,6 +89,7 @@
 			: Exception("Unknown tag: " + tag.ToString())
 		{ }
 	};
+

 	template < typename EntityTagType, size_t EntityTagOffset, size_t EntityTagLength >
 	struct GenericEntityTagReader
@@ -100,6 +101,7 @@
 			return stream.template Read<EntityTagLength>();
 		}
 	};
+

 	template < typename Derived, typename BaseEntityType, typename EntityTagType, typename EntityTagReader = GenericEntityTagReader<EntityTagType, 0, 8> >
 	class GenericEntityFactory
@@ -161,29 +163,6 @@
 		}
 	};

-	template < typename BaseEntityType, typename StreamType_ >
-	struct IEntityFactory
-	{
-		typedef StreamType_									StreamType;
-		typedef IEntityFactory<BaseEntityType, StreamType>	InterfaceType;
-		typedef shared_ptr<BaseEntityType>					EntityPtr;
-
-		virtual ~IEntityFactory() { }
-
-		virtual EntityPtr Create(StreamType& stream) const = 0;
-	};
-
-	template < typename InterfaceType, typename EntityFactory >
-	struct EntityFactoryWrapper : public InterfaceType
-	{
-		typedef typename InterfaceType::StreamType		StreamType;
-		typedef typename InterfaceType::EntityPtr		EntityPtr;
-
-		virtual EntityPtr Create(StreamType& stream) const
-		{ return EntityFactory::Create(stream); }
-	};
-
 }

-
 #endif


Remove a pointless way to test a return value (cherry picked from commit 692813d03e0d89b239639499c5b700ddf6d9458d)

--- upnp/src/genlib/net/http/webserver.c
+++ upnp/src/genlib/net/http/webserver.c
@@ -493,8 +493,6 @@

 void web_server_destroy(void)
 {
-	int ret;
-
 	if (bWebServerState == WEB_SERVER_ENABLED) {
 		membuffer_destroy(&gDocumentRootDir);
 		alias_release(&gAliasDoc);
@@ -503,8 +501,7 @@
 		memset(&gAliasDoc, 0, sizeof(struct xml_alias_t));
 		ithread_mutex_unlock(&gWebMutex);

-		ret = ithread_mutex_destroy(&gWebMutex);
-		assert(ret == 0);
+		ithread_mutex_destroy(&gWebMutex);
 		bWebServerState = WEB_SERVER_DISABLED;
 	}
 }


elf_loader: Simplify assembly code slightly

--- elf_loader.c
+++ elf_loader.c
@@ -699,9 +699,8 @@
     ".type _start,@function\n"
     "_start:\n"
     "xorq %rbp, %rbp\n"
-    "movq %rsp, %rbx\n"         /* Save starting SP in %rbx.  */
+    "movq %rsp, %rdi\n"         /* Argument: stack block.  */
     "andq $-16, %rsp\n"         /* Align the stack as per ABI.  */
-    "movq %rbx, %rdi\n"         /* Argument: stack block.  */
     "call do_load\n"
     "movq %rax, %rsp\n"         /* Switch to new stack */
     "jmp *-8(%rax)\n"           /* Jump to the entry point. */


Add missing const in some casts

Add missing const in some casts

--- Eigen/src/Core/Transpose.h
+++ Eigen/src/Core/Transpose.h
@@ -353,7 +353,7 @@
 {
   static bool run(const Scalar* dest, const OtherDerived& src)
   {
-    return (bool(blas_traits<OtherDerived>::IsTransposed) != DestIsTransposed) && (dest!=0 && dest==(Scalar*)extract_data(src));
+    return (bool(blas_traits<OtherDerived>::IsTransposed) != DestIsTransposed) && (dest!=0 && dest==(const Scalar*)extract_data(src));
   }
 };

@@ -362,8 +362,8 @@
 {
   static bool run(const Scalar* dest, const CwiseBinaryOp<BinOp,DerivedA,DerivedB>& src)
   {
-    return ((blas_traits<DerivedA>::IsTransposed != DestIsTransposed) && (dest!=0 && dest==(Scalar*)extract_data(src.lhs())))
-        || ((blas_traits<DerivedB>::IsTransposed != DestIsTransposed) && (dest!=0 && dest==(Scalar*)extract_data(src.rhs())));
+    return ((blas_traits<DerivedA>::IsTransposed != DestIsTransposed) && (dest!=0 && dest==(const Scalar*)extract_data(src.lhs())))
+        || ((blas_traits<DerivedB>::IsTransposed != DestIsTransposed) && (dest!=0 && dest==(const Scalar*)extract_data(src.rhs())));
   }
 };


Add some comments

Add some comments

--- XADMaster/WinZipJPEG/Decompressor.c
+++ XADMaster/WinZipJPEG/Decompressor.c
@@ -6,12 +6,15 @@

+// Helper functions for reading from the input stream.
 static int FullRead(WinZipJPEGDecompressor *self,uint8_t *buffer,size_t length);
 static int SkipBytes(WinZipJPEGDecompressor *self,size_t length);

+// Little endian integer parsing functions.
 static inline uint16_t LittleEndianUInt16(uint8_t *ptr) { return ptr[0]|(ptr[1]<<8); }
 static inline uint32_t LittleEndianUInt32(uint8_t *ptr) { return ptr[0]|(ptr[1]<<8)|(ptr[2]<<16)|(ptr[3]<<24); }

+// Allocator functions for LZMA.
 static void *Alloc(void *p,size_t size) { return malloc(size); }
 static void Free(void *p,void *address) { return free(address); }
 static ISzAlloc lzmaallocator={Alloc,Free};
@@ -44,21 +47,26 @@

 int ReadWinZipJPEGHeader(WinZipJPEGDecompressor *self)
 {
+	// Read 4-byte header.
 	uint8_t header[4];
 	int error=FullRead(self,header,sizeof(header));
 	if(error) return error;

+	// Sanity check the header, and make sure it contains only versions we can handle.
 	if(header[0]<4) return WinZipJPEGInvalidHeaderError;
 	if(header[1]!=0x10) return WinZipJPEGInvalidHeaderError;
 	if(header[2]!=0x01) return WinZipJPEGInvalidHeaderError;
 	if(header[3]&0xe0) return WinZipJPEGInvalidHeaderError;

+	// The header can possibly be bigger than 4 bytes, so skip the rest.
+	// (Unlikely to happen).
 	if(header[0]>4)
 	{
 		int error=SkipBytes(self,header[0]-4);
 		if(error) return error;
 	}

+	// Parse slice value.
 	self->slicevalue=header[3]&0x1f;

 	return WinZipJPEGNoError;
@@ -66,17 +74,22 @@

 int ReadNextWinZipJPEGBundle(WinZipJPEGDecompressor *self)
 {
+	// Free and clear any old metadata.
 	free(self->metadatabytes);
 	self->metadatalength=0;
 	self->metadatabytes=NULL;

+	// Read bundle header.
 	uint8_t header[4];
 	int error=FullRead(self,header,sizeof(header));
 	if(error) return error;

+	// Parse metadata sizes from header.
 	uint32_t uncompressedsize=LittleEndianUInt16(&header[0]);
 	uint32_t compressedsize=LittleEndianUInt16(&header[2]);

+	// If the sizes do not fit in 16 bits, both are set to 0xffff and
+	// an 8-byte 32-bit header is appended.
 	if(uncompressedsize==0xffff && compressedsize==0xffff)
 	{
 		uint8_t header[8];
@@ -87,30 +100,36 @@
 		compressedsize=LittleEndianUInt32(&header[4]);
 	}

+	// Allocate space for the uncompressed metadata.
 	self->metadatabytes=malloc(uncompressedsize);
 	if(!self->metadatabytes) return WinZipJPEGOutOfMemoryError;
 	self->metadatalength=uncompressedsize;

+	// Allocate temporary space for the compressed metadata, and read it.
 	uint8_t *compressedbytes=malloc(compressedsize);
 	if(!compressedbytes) return WinZipJPEGOutOfMemoryError;

 	error=FullRead(self,compressedbytes,compressedsize);
 	if(error) { free(compressedbytes); return error; }

+	// Calculate the dictionary size used for the LZMA coding.
 	int dictionarysize=(uncompressedsize+511)&~511;
 	if(dictionarysize<1024) dictionarysize=1024; // Silly - LZMA enforce a lower limit of 4096.
 	if(dictionarysize>512*1024) dictionarysize=512*1024;

+	// Create properties chunk for LZMA, using the dictionary size and default settings (lc=3, lp=0, pb=2).
 	uint8_t properties[5]={3+0*9+2*5*9,dictionarysize,dictionarysize>>8,dictionarysize>>16,dictionarysize>>24};

+	// Run LZMA decompressor.
 	SizeT destlen=uncompressedsize,srclen=compressedsize;
 	ELzmaStatus status;
-
 	SRes res=LzmaDecode(self->metadatabytes,&destlen,compressedbytes,&srclen,
 	properties,sizeof(properties),LZMA_FINISH_END,&status,&lzmaallocator);

+	// Free temporary buffer.
 	free(compressedbytes);

+	// Check if LZMA decoding succeeded.
 	if(res!=SZ_OK) return WinZipJPEGLZMAError;

 	return WinZipJPEGNoError;
@@ -118,7 +137,9 @@

-
+// Helper function that makes sure to read as much data as requested, even
+// if the read function returns short buffers, and reports an error if it
+// reaches EOF prematurely.
 static int FullRead(WinZipJPEGDecompressor *self,uint8_t *buffer,size_t length)
 {
 	size_t totalread=0;
@@ -132,6 +153,7 @@
 	return WinZipJPEGNoError;
 }

+// Helper function to skip data by reading and discarding.
 static int SkipBytes(WinZipJPEGDecompressor *self,size_t length)
 {
 	uint8_t buffer[1024];


ALSA: aloop - add locking to timer access

When the loopback timer handler is running, calling del_timer() (for STOP
trigger) will not wait for the handler to complete before deactivating the
timer. The timer gets rescheduled in the handler as usual. Then a subsequent
START trigger will try to start the timer using add_timer() with a timer pending
leading to a kernel panic.

Serialize the calls to add_timer() and del_timer() using a spin lock to avoid
this.

Signed-off-by: Omair Mohammed Abdullah <0d11f347914fc4d0a7a7fd4ee5b542429c901266@linux.intel.com>
Signed-off-by: Vinod Koul <5cf69c63beb17bf38d63aa0e923ee8256af0e205@linux.intel.com>
Cc: <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org>
Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

--- sound/drivers/aloop.c
+++ sound/drivers/aloop.c
@@ -120,6 +120,7 @@
 	unsigned int last_drift;
 	unsigned long last_jiffies;
 	struct timer_list timer;
+	spinlock_t timer_lock;
 };

 static struct platform_device *devices[SNDRV_CARDS];
@@ -170,6 +171,7 @@
 	unsigned long tick;
 	unsigned int rate_shift = get_rate_shift(dpcm);

+	spin_lock(&dpcm->timer_lock);
 	if (rate_shift != dpcm->pcm_rate_shift) {
 		dpcm->pcm_rate_shift = rate_shift;
 		dpcm->period_size_frac = frac_pos(dpcm, dpcm->pcm_period_size);
@@ -182,12 +184,15 @@
 	tick = (tick + dpcm->pcm_bps - 1) / dpcm->pcm_bps;
 	dpcm->timer.expires = jiffies + tick;
 	add_timer(&dpcm->timer);
+	spin_unlock(&dpcm->timer_lock);
 }

 static inline void loopback_timer_stop(struct loopback_pcm *dpcm)
 {
+	spin_lock(&dpcm->timer_lock);
 	del_timer(&dpcm->timer);
 	dpcm->timer.expires = 0;
+	spin_unlock(&dpcm->timer_lock);
 }

 #define CABLE_VALID_PLAYBACK	(1 << SNDRV_PCM_STREAM_PLAYBACK)
@@ -667,6 +672,7 @@
 	dpcm->substream = substream;
 	setup_timer(&dpcm->timer, loopback_timer_function,
 		    (unsigned long)dpcm);
+	spin_lock_init(&dpcm->timer_lock);

 	cable = loopback->cables[substream->number][dev];
 	if (!cable) {


updating LinkDef according to recently added classes

--- HLT/AliHLTTRDLinkDef.h
+++ HLT/AliHLTTRDLinkDef.h
@@ -11,7 +11,8 @@
 #pragma link C++ class AliHLTTRDEsdWriterComponent;
 #pragma link C++ class AliHLTTRDCalibrationComponent;
 #pragma link C++ class AliHLTTRDUtils;
-#pragme link C++ class AliHLTTRDClusterHistoComponent;
+#pragma link C++ class AliHLTTRDClusterHistoComponent;
+#pragma link C++ class AliHLTTRDTrackHistoComponent;
 #pragma link C++ class AliHLTTRDOfflineClusterizerComponent;
 #pragma link C++ class AliHLTTRDOfflineTrackerV1Component;
 #endif


Forgot a trailing _ in the 64-bit version - wouldn't build

--- engine-itc.c
+++ engine-itc.c
@@ -78,7 +78,7 @@
 /* Push an inline literal */
 void mu_alit_()  { PUSH(*IP++); }
 #ifdef ADDR_64
-void mu_lit_()   { mu_alit(); }
+void mu_lit_()   { mu_alit_(); }
 #else
 void mu_lit_()
 {


SubtitleInfo: add a note about different supported subtitle formats

--- Helpers/SubtitleInfo.h
+++ Helpers/SubtitleInfo.h
@@ -30,6 +30,19 @@
  * Please use the parameterized initializers.
  *
  * @note This class is immutable.
+ *
+ * @note Different services support specific subtitles formats:
+ *
+ * - DLNA service supports @c SRT format only. Since there is no official
+ * specification for them, subtitles may not work on all DLNA-compatible devices.
+ *
+ * - Netcast service supports @c SRT format only, through DLNA.
+ *
+ * - Google Cast service supports @c WebVTT format only and has additional
+ * requirements: https://developers.google.com/cast/docs/ios_sender#cors-requirements
+ *
+ * - FireTV service supports @c WebVTT format only. Subtitles on Fire TV are
+ * hidden by default and should be displayed manually by the user.
  */
 @interface SubtitleInfo : NSObject


FIX: incorrect integer type for the milliseconds value

--- src/common/statistics/hdr_writer.c
+++ src/common/statistics/hdr_writer.c
@@ -22,7 +22,7 @@
 }

 bool hdr_lat_writer_write(const stat_latency_t *latency, gru_status_t *status) {
-	uint64_t milli_latency = gru_time_to_milli(&latency->elapsed);;
+	int64_t milli_latency = gru_time_to_milli(&latency->elapsed);;

 	hdr_interval_recorder_record_value(&lat_wrapper.recorder, milli_latency);
 	return true;


Fix halley_main.h

Fix halley_main.h

--- src/engine/core/include/halley/core/game/halley_main.h
+++ src/engine/core/include/halley/core/game/halley_main.h
@@ -43,7 +43,7 @@

 // Macro to implement program
 #if defined(HALLEY_EXECUTABLE)
-	#if defined(_WIN32) || !defined(WINDOWS_STORE)
+	#if defined(_WIN32) && !defined(WINDOWS_STORE)
 		#define HalleyGame(T) int __stdcall WinMain(void*, void*, char*, int) { return Halley::HalleyMain::winMain<T>(); }
 	#else
 		#define HalleyGame(T) int main(int argc, char* argv[]) { return Halley::HalleyMain::main<T>(argc, argv); }


changes to address issue #388

changes to address issue #388

--- tardis/montecarlo/src/cmontecarlo.c
+++ tardis/montecarlo/src/cmontecarlo.c
@@ -295,20 +295,20 @@
     chi_boundfree = rpacket_get_chi_boundfree(packet);
     rpacket_set_chi_freefree(packet, 0.0);
     chi_freefree = rpacket_get_chi_freefree(packet);
-    chi_electron = storage->electron_densities[packet->current_shell_id] * storage->sigma_thomson *
+    chi_electron = storage->electron_densities[rpacket_get_current_shell_id(packet)] * storage->sigma_thomson *
        rpacket_doppler_factor (packet, storage);
     chi_continuum = chi_boundfree + chi_freefree + chi_electron;
     d_continuum = rpacket_get_tau_event(packet) / chi_continuum;
   }
   else
   {
-    chi_electron = storage->electron_densities[packet->current_shell_id] * storage->sigma_thomson;
+    chi_electron = storage->electron_densities[rpacket_get_current_shell_id(packet)] * storage->sigma_thomson;
     chi_continuum = chi_electron;
     d_continuum = storage->inverse_electron_densities[rpacket_get_current_shell_id (packet)] *
       storage->inverse_sigma_thomson * rpacket_get_tau_event (packet);
   }

-  if (packet->virtual_packet > 0)
+  if (rpacket_get_virtual_packet(packet) > 0)
     {
 	  //Set all continuum distances to MISS_DISTANCE in case of an virtual_packet
 	  rpacket_set_d_continuum(packet, MISS_DISTANCE);
@@ -437,19 +437,19 @@
 	  for (i = 0; i < rpacket_get_virtual_packet_flag (packet); i++)
 	    {
 	      memcpy ((void *) &virt_packet, (void *) packet, sizeof (rpacket_t));
-	      if (virt_packet.r > storage->r_inner[0])
+	      if (rpacket_get_r(&virt_packet) > storage->r_inner[0])
 		{
 		  mu_min =
 		    -1.0 * sqrt (1.0 -
-				 (storage->r_inner[0] / virt_packet.r) *
-				 (storage->r_inner[0] / virt_packet.r));
+				 (storage->r_inner[0] / rpacket_get_r(&virt_packet)) *
+				 (storage->r_inner[0] / rpacket_get_r(&virt_packet)));
 		}
 	      else
 		{
 		  mu_min = 0.0;
 		}
 	      mu_bin = (1.0 - mu_min) / rpacket_get_virtual_packet_flag (packet);
-	      virt_packet.mu = mu_min + (i + rk_double (&mt_state)) * mu_bin;
+	      rpacket_set_mu(&virt_packet,mu_min + (i + rk_double (&mt_state)) * mu_bin);
 	      switch (virtual_mode)
 		{
 		case -2:
@@ -457,7 +457,7 @@
 		  break;
 		case -1:
 		  weight =
-		    2.0 * virt_packet.mu /
+		    2.0 * rpacket_get_mu(&virt_packet) /
 		    rpacket_get_virtual_packet_flag (packet);
 		  break;
 		case 1:
@@ -471,12 +471,12 @@
 	      doppler_factor_ratio =
 		rpacket_doppler_factor (packet, storage) /
 		rpacket_doppler_factor (&virt_packet, storage);
-	      virt_packet.energy =
-		rpacket_get_energy (packet) * doppler_factor_ratio;
-	      virt_packet.nu = rpacket_get_nu (packet) * doppler_factor_ratio;
+	      rpacket_set_energy(&virt_packet,
+		rpacket_get_energy (packet) * doppler_factor_ratio);
+	      rpacket_set_nu(&virt_packet,rpacket_get_nu (packet) * doppler_factor_ratio);
 	      reabsorbed = montecarlo_one_packet_loop (storage, &virt_packet, 1);
-	      if ((virt_packet.nu < storage->spectrum_end_nu) &&
-		  (virt_packet.nu > storage->spectrum_start_nu))
+	      if ((rpacket_get_nu(&virt_packet) < storage->spectrum_end_nu) &&
+		  (rpacket_get_nu(&virt_packet) > storage->spectrum_start_nu))
 		{
 #ifdef WITHOPENMP
 #pragma omp critical
@@ -488,15 +488,15 @@
 			storage->virt_packet_nus = realloc(storage->virt_packet_nus, sizeof(double) * storage->virt_array_size);
 			storage->virt_packet_energies = realloc(storage->virt_packet_energies, sizeof(double) * storage->virt_array_size);
 		      }
-		    storage->virt_packet_nus[storage->virt_packet_count] = virt_packet.nu;
-		    storage->virt_packet_energies[storage->virt_packet_count] = virt_packet.energy * weight;
+		    storage->virt_packet_nus[storage->virt_packet_count] = rpacket_get_nu(&virt_packet);
+		    storage->virt_packet_energies[storage->virt_packet_count] = rpacket_get_energy(&virt_packet) * weight;
 		    storage->virt_packet_count += 1;
 		    virt_id_nu =
-		      floor ((virt_packet.nu -
+		      floor ((rpacket_get_nu(&virt_packet) -
 			      storage->spectrum_start_nu) /
 			     storage->spectrum_delta_nu);
 		    storage->spectrum_virt_nu[virt_id_nu] +=
-		      virt_packet.energy * weight;
+		      rpacket_get_energy(&virt_packet) * weight;
 #ifdef WITHOPENMP
 		  }
 #endif


Added GeometryTypeId enum and getGeometryTypeId abstract Geometry method.

git-svn-id: 6c2b1bd10c324c49ea9d9e6e31006a80e70507cb@226 5242fede-7e19-0410-aef8-94bd7d2200fb

--- source/headers/geom.h
+++ source/headers/geom.h
@@ -1,5 +1,8 @@
 /*
 * $Log$
+* Revision 1.40  2003/10/24 21:27:31  strk
+* Added GeometryTypeId enum and getGeometryTypeId abstract Geometry method.
+*
 * Revision 1.39  2003/10/20 15:41:34  strk
 * Geometry::checkNotGeometryCollection made static and non-distructive.
 *
@@ -44,6 +47,16 @@
 using namespace std;

 namespace geos {
+
+enum GeometryTypeId {
+	GEOS_POINT,
+	GEOS_LINESTRING,
+	GEOS_POLYGON,
+	GEOS_MULTIPOINT,
+	GEOS_MULTILINESTRING,
+	GEOS_MULTIPOLYGON,
+	GEOS_GEOMETRYCOLLECTION
+};

 class Coordinate;

@@ -504,6 +517,7 @@
 	Geometry(const Geometry &geom);
 	Geometry(const PrecisionModel* pm, int SRID);
 	virtual string getGeometryType() const=0; //Abstract
+	virtual GeometryTypeId getGeometryTypeId() const=0; //Abstract
 	virtual int getSRID() const;
 	virtual void setSRID(int newSRID);
 	virtual PrecisionModel* getPrecisionModel() const;
@@ -735,6 +749,9 @@
 	virtual const Geometry* getGeometryN(int n) const;
 	virtual int getNumPoints() const;
 	virtual string getGeometryType() const;
+	virtual GeometryTypeId getGeometryTypeId() const {
+		return GEOS_GEOMETRYCOLLECTION;
+	}
 	virtual bool isSimple() const;
 	virtual Geometry* getBoundary() const;
 	virtual bool equalsExact(const Geometry *other, double tolerance) const;
@@ -813,6 +830,9 @@
 	double getY() const;
 	const Coordinate* getCoordinate() const;
 	string getGeometryType() const;
+	virtual GeometryTypeId getGeometryTypeId() const {
+		return GEOS_POINT;
+	}
 	Geometry* getBoundary() const;
 	void apply_ro(CoordinateFilter *filter) const;
 	void apply_rw(CoordinateFilter *filter);
@@ -867,6 +887,9 @@
 	virtual bool isClosed() const;
 	virtual bool isRing() const;
 	virtual string getGeometryType() const;
+	virtual GeometryTypeId getGeometryTypeId() const {
+		return GEOS_LINESTRING;
+	}
 	virtual bool isSimple() const;
 	virtual Geometry* getBoundary() const;
 	virtual bool isCoordinate(Coordinate& pt) const;
@@ -928,6 +951,9 @@
 	int getNumInteriorRing() const;
 	const LineString* getInteriorRingN(int n) const;
 	string getGeometryType() const;
+	virtual GeometryTypeId getGeometryTypeId() const {
+		return GEOS_POLYGON;
+	}
 	Geometry* getBoundary() const;
 	bool equalsExact(const Geometry *other, double tolerance) const;
 	void apply_rw(CoordinateFilter *filter);
@@ -958,6 +984,9 @@
 	int getDimension() const;
 	int getBoundaryDimension() const;
 	string getGeometryType() const;
+	virtual GeometryTypeId getGeometryTypeId() const {
+		return GEOS_MULTIPOINT;
+	}
 	bool isValid() const;
 	bool isClosed() const;
 	bool isSimple() const;
@@ -975,6 +1004,9 @@
 	int getDimension() const;
 	int getBoundaryDimension() const;
 	string getGeometryType() const;
+	virtual GeometryTypeId getGeometryTypeId() const {
+		return GEOS_MULTILINESTRING;
+	}
 	bool isClosed() const;
 	bool isSimple() const;
 	Geometry* getBoundary() const;
@@ -989,6 +1021,9 @@
 	int getDimension() const;
 	int getBoundaryDimension() const;
 	string getGeometryType() const;
+	virtual GeometryTypeId getGeometryTypeId() const {
+		return GEOS_MULTIPOLYGON;
+	}
 	bool isSimple() const;
 	Geometry* getBoundary() const;
 	bool equalsExact(const Geometry *other, double tolerance) const;


+ Added no_state and no_act. + Added delete_state and shutdown_state for the new startd stuff.

--- src/condor_includes/condor_state.h
+++ src/condor_includes/condor_state.h
@@ -23,13 +23,13 @@
 #ifndef _CONDOR_STATE_H
 #define _CONDOR_STATE_H

-enum State { owner_state, unclaimed_state, matched_state,
-			 claimed_state, preempting_state, _state_threshold_,
-			 _error_state_ };
+enum State { no_state=0, owner_state, unclaimed_state, matched_state,
+			 claimed_state, preempting_state, shutdown_state,
+			 delete_state,  _state_threshold_, _error_state_ };

-enum Activity { idle_act, busy_act, vacating_act, suspended_act,
-				benchmarking_act, killing_act, _act_threshold_,
-				_error_act_ };
+enum Activity { no_act=0, idle_act, busy_act, vacating_act,
+				suspended_act, benchmarking_act, killing_act,
+				_act_threshold_, _error_act_ };

 char* state_to_string(State);
 State string_to_state(char*);


Don't try to copy a NULL dictionary.

Don't try to copy a NULL dictionary.

--- source/pdf/pdf-xref.c
+++ source/pdf/pdf-xref.c
@@ -332,7 +332,7 @@
 		fz_try(ctx)
 		{
 			sub = fz_malloc_struct(ctx, pdf_xref_subsec);
-			trailer = pdf_copy_dict(ctx, xref->trailer);
+			trailer = xref->trailer ? pdf_copy_dict(ctx, xref->trailer) : NULL;
 			doc->xref_sections = fz_resize_array(ctx, doc->xref_sections, doc->num_xref_sections + 1, sizeof(pdf_xref));
 			xref = &doc->xref_sections[0];
 			pxref = &doc->xref_sections[1];


Update RingRayLib - raylib.c - Add Function : void UnloadModelAnimation(ModelAnimation anim)


Updated Arduino pins for MBM

Updated Arduino pins for MBM

--- source/pins_arduino.h
+++ source/pins_arduino.h
@@ -23,9 +23,12 @@
 const static uint8_t SCL = 13;
 const static uint8_t SDA = 15;
 const static uint8_t CS0 = 5;
+const static uint8_t CE0 = CS0;
+static const uint8_t SS = CS0;
 const static uint8_t MISO = 7;
 const static uint8_t MOSI = 9;
 const static uint8_t SCLK = 11;
+const static uint8_t SCK = SCLK;
 const static uint8_t CTS1 = 10;
 const static uint8_t RTS1 = 12;
 const static uint8_t RX1 = 8;
@@ -74,12 +77,12 @@
 const static uint8_t SCL1 = 5;
 const static uint8_t SDA1 = 3;
 const static uint8_t CS0 = 24;
+const static uint8_t CE0 = CS0;
+static const uint8_t SS = CS0;
 const static uint8_t CS1 = 26;
-const static uint8_t CE0 = 24;
-const static uint8_t CE1 = 26;
-static const uint8_t SS = 24;
+const static uint8_t CE1 = CS1;
 const static uint8_t SCLK = 23;
-const static uint8_t SCK = 23;
+const static uint8_t SCK = SCLK;
 const static uint8_t MISO = 21;
 const static uint8_t MOSI = 19;
 const static uint8_t RXD = 10;


Update RingRayLib - raylib.c - Add Function : Ray GetMouseRay(Vector2 mousePosition, Camera camera)


Update RingRayLib - raylib.c - Add Function : char *LoadText(const char *fileName)


more debug

more debug

--- src/core/lib/iomgr/timer_generic.c
+++ src/core/lib/iomgr/timer_generic.c
@@ -452,6 +452,18 @@
   for (timer = shard->list.next; timer != &shard->list; timer = next) {
     next = timer->next;

+#ifndef NDEBUG
+    if (next == timer && next != &shard->list) {
+      grpc_closure *c = timer->closure;
+      gpr_log(GPR_ERROR,
+              "We have a problem!!!! - timer %p closure: %p, created-at: "
+              "[%s,%d], scheduled-at: [%s, %d]",
+              timer, c, c->file_initiated, c->line_created, c->file_initiated,
+              c->line_initiated);
+      abort();
+    }
+#endif
+
     if (timer->deadline < shard->queue_deadline_cap) {
       if (GRPC_TRACER_ON(grpc_timer_check_trace)) {
         gpr_log(GPR_DEBUG, "  .. add timer with deadline %" PRIdPTR " to heap",


SINGA-490 Optimize Add, Sub, EltwiseMult Performance

--- src/core/tensor/tensor_math_cuda.h
+++ src/core/tensor/tensor_math_cuda.h
@@ -220,66 +220,80 @@
   const float* inPtr2 = static_cast<const float*>(in2.block()->data());
   float* outPtr = static_cast<float*>(out->block()->mutable_data());

-  // if stride has 0, the tensor is broadcasted.
-  int strideProduct = 1;
-  for(const auto &i: in1.stride())
-    strideProduct *= i;
-  for(const auto &i: in2.stride())
-    strideProduct *= i;
-
-  const float* _inPtr1;
-  cudnnTensorDescriptor_t in1NdDesc;
-  if (strideProduct != 0) {
-    _inPtr1 = inPtr1;
-    in1NdDesc = generate_tensor_nd_desc(in1);
-  } else {
-    Tensor in1Bc = get_broadcasted_tensor(in1, ctx);
-    _inPtr1 = static_cast<const float*>(in1Bc.block()->data());
-    in1NdDesc = generate_tensor_nd_desc(in1Bc);
-  }
-
-  check_cudnn(cudnnOpTensor(ctx->cudnn_handle, generate_op_desc(CUDNN_OP_TENSOR_ADD),
-                            (void*)(&alpha1), in1NdDesc, _inPtr1,
-                            (void*)(&alpha2), generate_tensor_nd_desc(in2), inPtr2,
-                            (void*)(&beta), generate_tensor_nd_desc(*out), outPtr
-                           ));
+  // In the simplest case, use the most efficient cuda math kernal
+  if ((!in1.transpose() && !in2.transpose()) && (in1.stride() == in2.stride()) && in1.nDim() == in2.nDim()){
+      cuda::add(in1.Size(), inPtr1, inPtr2, outPtr, ctx->stream);
+    }
+  else { // else we use the cudnn with broadcast function
+  	  // if stride has 0, the tensor is broadcasted.
+  	  int strideProduct = 1;
+  	  for(const auto &i: in1.stride())
+  	    strideProduct *= i;
+  	  for(const auto &i: in2.stride())
+  	    strideProduct *= i;
+
+  	  const float* _inPtr1;
+  	  cudnnTensorDescriptor_t in1NdDesc;
+  	  if (strideProduct != 0) {
+  	    _inPtr1 = inPtr1;
+  	    in1NdDesc = generate_tensor_nd_desc(in1);
+  	  } else {
+  	    Tensor in1Bc = get_broadcasted_tensor(in1, ctx);
+  	    _inPtr1 = static_cast<const float*>(in1Bc.block()->data());
+  	    in1NdDesc = generate_tensor_nd_desc(in1Bc);
+  	  }
+
+  	  check_cudnn(cudnnOpTensor(ctx->cudnn_handle, generate_op_desc(CUDNN_OP_TENSOR_ADD),
+  	                            (void*)(&alpha1), in1NdDesc, _inPtr1,
+  	                            (void*)(&alpha2), generate_tensor_nd_desc(in2), inPtr2,
+  	                            (void*)(&beta), generate_tensor_nd_desc(*out), outPtr
+  	                           ));
+  	}
+
 }

 /// out = in1 - in2
 template <>
 void Sub<float, lang::Cuda>(const Tensor& in1,
                             const Tensor& in2, Tensor* out, Context* ctx) {
-  const float* inPtr1 = static_cast<const float*>(in1.block()->data());
-  const float* inPtr2 = static_cast<const float*>(in2.block()->data());
-  float* outPtr = static_cast<float*>(out->block()->mutable_data());
-
   float alpha1 = 1.0;
   float alpha2 = -1.0;
   float beta = 0.0;

-  // if stride has 0, the tensor is broadcasted.
-  int strideProduct = 1;
-  for(const auto &i: in1.stride())
-    strideProduct *= i;
-  for(const auto &i: in2.stride())
-    strideProduct *= i;
-
-  const float* _inPtr1;
-  cudnnTensorDescriptor_t in1NdDesc;
-  if (strideProduct != 0) {
-    _inPtr1 = inPtr1;
-    in1NdDesc = generate_tensor_nd_desc(in1);
-  } else {
-    Tensor in1Bc = get_broadcasted_tensor(in1, ctx);
-    _inPtr1 = static_cast<const float*>(in1Bc.block()->data());
-    in1NdDesc = generate_tensor_nd_desc(in1Bc);
-  }
-
-  check_cudnn(cudnnOpTensor(ctx->cudnn_handle, generate_op_desc(CUDNN_OP_TENSOR_ADD),
-                            (void*)(&alpha1), in1NdDesc, _inPtr1,
-                            (void*)(&alpha2), generate_tensor_nd_desc(in2), inPtr2,
-                            (void*)(&beta), generate_tensor_nd_desc(*out), outPtr
-                           ));
+  const float* inPtr1 = static_cast<const float*>(in1.block()->data());
+  const float* inPtr2 = static_cast<const float*>(in2.block()->data());
+  float* outPtr = static_cast<float*>(out->block()->mutable_data());
+
+  // In the simplest case, use the most efficient cuda math kernal
+  if ((!in1.transpose() && !in2.transpose()) && (in1.stride() == in2.stride()) && in1.nDim() == in2.nDim()){
+      cuda::sub(in1.Size(), inPtr1, inPtr2, outPtr, ctx->stream);
+    }
+  else { // else we use the cudnn with broadcast function
+  	  // if stride has 0, the tensor is broadcasted.
+  	  int strideProduct = 1;
+  	  for(const auto &i: in1.stride())
+  	    strideProduct *= i;
+  	  for(const auto &i: in2.stride())
+  	    strideProduct *= i;
+
+  	  const float* _inPtr1;
+  	  cudnnTensorDescriptor_t in1NdDesc;
+  	  if (strideProduct != 0) {
+  	    _inPtr1 = inPtr1;
+  	    in1NdDesc = generate_tensor_nd_desc(in1);
+  	  } else {
+  	    Tensor in1Bc = get_broadcasted_tensor(in1, ctx);
+  	    _inPtr1 = static_cast<const float*>(in1Bc.block()->data());
+  	    in1NdDesc = generate_tensor_nd_desc(in1Bc);
+  	  }
+
+  	  check_cudnn(cudnnOpTensor(ctx->cudnn_handle, generate_op_desc(CUDNN_OP_TENSOR_ADD),
+  	                            (void*)(&alpha1), in1NdDesc, _inPtr1,
+  	                            (void*)(&alpha2), generate_tensor_nd_desc(in2), inPtr2,
+  	                            (void*)(&beta), generate_tensor_nd_desc(*out), outPtr
+  	                           ));
+  	}
+
 }

 template <>
@@ -377,15 +391,14 @@
 void EltwiseMult<float, lang::Cuda>(const Tensor& in1,
                                     const Tensor& in2, Tensor* out,
                                     Context* ctx) {
-
   float alpha1 = 1.0;
   float alpha2 = 1.0;
   float beta = 0.0;
   const float* inPtr1 = static_cast<const float*>(in1.block()->data());
   const float* inPtr2 = static_cast<const float*>(in2.block()->data());
   float* outPtr = static_cast<float*>(out->block()->mutable_data());
-
-  // if stride has 0, the tensor is broadcasted.
+  const size_t num = in1.Size();
+
   int strideProduct = 1;
   for(const auto &i: in1.stride())
     strideProduct *= i;
@@ -394,20 +407,36 @@

   const float* _inPtr1;
   cudnnTensorDescriptor_t in1NdDesc;
-  if (strideProduct != 0) {
-    _inPtr1 = inPtr1;
-    in1NdDesc = generate_tensor_nd_desc(in1);
-  } else {
-    Tensor in1Bc = get_broadcasted_tensor(in1, ctx);
-    _inPtr1 = static_cast<const float*>(in1Bc.block()->data());
-    in1NdDesc = generate_tensor_nd_desc(in1Bc);
-  }
-
-  check_cudnn(cudnnOpTensor(ctx->cudnn_handle, generate_op_desc(CUDNN_OP_TENSOR_MUL),
-                            (void*)(&alpha1), in1NdDesc, _inPtr1,
-                            (void*)(&alpha2), generate_tensor_nd_desc(in2), inPtr2,
-                            (void*)(&beta), generate_tensor_nd_desc(*out), outPtr
-                           ));
+  if (strideProduct != 0) { //When there is no need to broadcast, use the efficient kernal
+  	if (!in1.transpose() && !in2.transpose() && (in1.stride() == in2.stride())) {
+  	  cuda::mult(num, inPtr1, inPtr2, outPtr, ctx->stream);
+  	} else { //else we check whether in1 or in2 or both are transposed
+  	  if (in1.transpose() && in2.transpose()) {
+  	    Tensor t(in1.shape(), in1.device(), in1.data_type());
+  	    Transform<float, lang::Cuda>(in1, &t, ctx);
+  	    Transform<float, lang::Cuda>(in2, out, ctx);
+
+  	    float* tPtr = static_cast<float*>(t.block()->mutable_data());
+  	    cuda::mult(num, tPtr, outPtr, outPtr, ctx->stream);
+  	  } else if (in1.transpose()) {
+  	    Transform<float, lang::Cuda>(in1, out, ctx);
+  	    cuda::mult(num, outPtr, inPtr2, outPtr, ctx->stream);
+  	  } else if (in2.transpose()) {
+  	    Transform<float, lang::Cuda>(in2, out, ctx);
+  	    cuda::mult(num, inPtr1, outPtr, outPtr, ctx->stream);
+  	  }
+  	}
+  } else { //When we need broadcasting:
+  	Tensor in1Bc = get_broadcasted_tensor(in1, ctx);
+  	_inPtr1 = static_cast<const float*>(in1Bc.block()->data());
+  	in1NdDesc = generate_tensor_nd_desc(in1Bc);
+  	check_cudnn(cudnnOpTensor(ctx->cudnn_handle, generate_op_desc(CUDNN_OP_TENSOR_MUL),
+  	                          (void*)(&alpha1), in1NdDesc, _inPtr1,
+  	                          (void*)(&alpha2), generate_tensor_nd_desc(in2), inPtr2,
+  	                          (void*)(&beta), generate_tensor_nd_desc(*out), outPtr
+  	                         ));
+  }
+
 }


x86: kernel: ACPICA: Fix memory map bug

x86: kernel: ACPICA: Fix memory map bug

Add call to mmap_device_memory in AcpiOsMapMemory function.
This solves Memory Map bug at issue #1835

Signed-off-by: Puranjay Mohan <e4d09ccd00b0539b39770dbb60a701a448d09e82@gmail.com>

--- third-party/lib/acpica/osemboxxf.c
+++ third-party/lib/acpica/osemboxxf.c
@@ -25,6 +25,7 @@
 #include <kernel/printk.h>
 #include <kernel/thread.h>
 #include <kernel/time/ktime.h>
+#include <sys/mman.h>

 #ifdef DEBUG
 #define PRINTD(msg) printk("ACPICA OSL DEBUG: " msg "\n")
@@ -100,7 +101,13 @@

 void *AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS Where, ACPI_SIZE Length) {
 	PRINTD("AcpiOsMapMemory() called");
-
+	if (MAP_FAILED == mmap_device_memory((void *) Where,
+                Length,
+                PROT_READ | PROT_WRITE | PROT_NOCACHE,
+                MAP_FIXED,
+                Where)) {
+		return NULL;
+	}
 	return ACPI_PHYSADDR_TO_PTR(Where);
 }


ucspilogd: allow last log line to not be null-terminated

--- src/daemontools-extras/ucspilogd.c
+++ src/daemontools-extras/ucspilogd.c
@@ -160,7 +160,11 @@
       satmp.len = 0 ;
       {
         register int r = skagetlnsep(buffer_0f1, &satmp, "\n", 2) ;
-        if (r < 0) strerr_diefu1sys(111, "read from stdin") ;
+        if (r < 0)
+        {
+          if (errno != EPIPE || !stralloc_0(&satmp))
+            strerr_diefu1sys(111, "read from stdin") ;
+        }
         if (!r) break ;
       }
       if (!satmp.len) continue ;