Fix building on gcc

Fix building on gcc

--- XADMaster/XADException.h
+++ XADMaster/XADException.h
@@ -33,11 +33,15 @@
 #define XADSubArchiveError 0x10000

 #ifndef CLANG_ANALYZER_NORETURN
-#if __has_feature(attribute_analyzer_noreturn)
-#define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
-#else
-#define CLANG_ANALYZER_NORETURN
-#endif
+	#ifdef __clang__
+		#if __has_feature(attribute_analyzer_noreturn)
+			#define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
+		#else
+			#define CLANG_ANALYZER_NORETURN
+		#endif
+	#else
+		#define CLANG_ANALYZER_NORETURN
+	#endif
 #endif

 extern NSString *XADExceptionName;


NVCCのコンパイル時に例外が発生してコンパイルできない問題を修正．

NVCCのコンパイル時に例外が発生してコンパイルできない問題を修正．

git-svn-id: 3507153f7f2a502978d43a270f21b34bb2e07470@1205 b31369ee-dac5-0310-8161-cccb92f82ee5

--- mist/limits.h
+++ mist/limits.h
@@ -362,29 +362,25 @@
 		template < class T >
 		static const rgb< T > limits( const rgb< T > &v )
 		{
-			typedef limits_0_255__< is_char< T >::value > limits_0_255_;
-			return( rgb< T >( limits_0_255_::limits( v.r ), limits_0_255_::limits( v.g ), limits_0_255_::limits( v.b ) ) );
+			return( rgb< T >( limits_0_255__< is_char< T >::value >::limits( v.r ), limits_0_255__< is_char< T >::value >::limits( v.g ), limits_0_255__< is_char< T >::value >::limits( v.b ) ) );
 		}

 		template < class T >
 		static const rgba< T > limits( const rgba< T > &v )
 		{
-			typedef limits_0_255__< is_char< T >::value > limits_0_255_;
-			return( rgba< T >( limits_0_255_::limits( v.r ), limits_0_255_::limits( v.g ), limits_0_255_::limits( v.b ), limits_0_255_::limits( v.a ) ) );
+			return( rgba< T >( limits_0_255__< is_char< T >::value >::limits( v.r ), limits_0_255__< is_char< T >::value >::limits( v.g ), limits_0_255__< is_char< T >::value >::limits( v.b ), limits_0_255__< is_char< T >::value >::limits( v.a ) ) );
 		}

 		template < class T >
 		static const bgr< T > limits( const bgr< T > &v )
 		{
-			typedef limits_0_255__< is_char< T >::value > limits_0_255_;
-			return( bgr< T >( limits_0_255_::limits( v.r ), limits_0_255_::limits( v.g ), limits_0_255_::limits( v.b ) ) );
+			return( bgr< T >( limits_0_255__< is_char< T >::value >::limits( v.r ), limits_0_255__< is_char< T >::value >::limits( v.g ), limits_0_255__< is_char< T >::value >::limits( v.b ) ) );
 		}

 		template < class T >
 		static const bgra< T > limits( const bgra< T > &v )
 		{
-			typedef limits_0_255__< is_char< T >::value > limits_0_255_;
-			return( bgra< T >( limits_0_255_::limits( v.r ), limits_0_255_::limits( v.g ), limits_0_255_::limits( v.b ), limits_0_255_::limits( v.a ) ) );
+			return( bgra< T >( limits_0_255__< is_char< T >::value >::limits( v.r ), limits_0_255__< is_char< T >::value >::limits( v.g ), limits_0_255__< is_char< T >::value >::limits( v.b ), limits_0_255__< is_char< T >::value >::limits( v.a ) ) );
 		}
 	};
 }


Fixup r326851: mmap64 interceptor should not be used on Darwin.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@326864 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -425,7 +425,7 @@
   (SI_LINUX_NOT_ANDROID || SI_MAC || SI_FREEBSD || SI_NETBSD)

 #define SANITIZER_INTERCEPT_MMAP (SI_POSIX && !SI_FREEBSD && !SI_NETBSD)
-#define SANITIZER_INTERCEPT_MMAP64 SI_POSIX
+#define SANITIZER_INTERCEPT_MMAP64 (SI_POSIX && !SI_MAC)
 #define SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO \
   (!SI_FREEBSD && !SI_MAC && !SI_NETBSD && SI_NOT_FUCHSIA)
 #define SANITIZER_INTERCEPT_MEMALIGN (!SI_FREEBSD && !SI_MAC && !SI_NETBSD)


Sending single CAN message is non-blocking.

--- libat90/can.c
+++ libat90/can.c
@@ -393,6 +393,8 @@
 			return NO_MOB_ERR;
 		}

+		msg_list[mob] = 0;
+
 		uint8_t data[8] = {0};
 		data[0] = (len << 3) & 0xF8;
 		for (uint8_t i = 0; i < len; ++i)
@@ -404,9 +406,7 @@
 		MOB_SET_DLC(8);
 		MOB_TX_DATA(data);
 		MOB_EN_TX();
-		while(TX_BUSY());
-		BIT_CLEAR(mob_on_job, mob);
-		sfree((void *)msg);
+		CAN_ENABLE_MOB_INTERRUPT(mob);
 	}
 	return SUCCES;
 }
@@ -533,6 +533,11 @@

 static void continue_sending(uint8_t mob) {
+	if (msg_list[mob] == 0) {
+		BIT_CLEAR(mob_on_job, mob);
+		return;
+	}
+
 	if (msg_list[mob]->waiting)
 		return;


[Sanitizers] Intercept getpwent() on FreeBSD
Committed unreviewed with permission.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@227791 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -95,7 +95,8 @@
 #define SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS SI_NOT_WINDOWS
 #define SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS \
   SI_MAC || SI_LINUX_NOT_ANDROID
-#define SANITIZER_INTERCEPT_GETPWENT SI_MAC || SI_LINUX_NOT_ANDROID
+#define SANITIZER_INTERCEPT_GETPWENT \
+  SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID
 #define SANITIZER_INTERCEPT_FGETPWENT SI_LINUX_NOT_ANDROID
 #define SANITIZER_INTERCEPT_GETPWENT_R SI_LINUX_NOT_ANDROID
 #define SANITIZER_INTERCEPT_SETPWENT SI_MAC || SI_LINUX_NOT_ANDROID


[sanitizer] Fix Mac build.

[sanitizer] Fix Mac build.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@182469 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -90,7 +90,11 @@
     int ai_family;
     int ai_socktype;
     int ai_protocol;
+#if SANITIZER_MAC
+    unsigned ai_addrlen;
+#else
     uptr ai_addrlen;
+#endif
     void *ai_addr;
     char *ai_canonname;
     struct __sanitizer_addrinfo *ai_next;


Reference MacRuby.

Reference MacRuby.

--- src/Elysium.h
+++ src/Elysium.h
@@ -9,6 +9,7 @@

 #import <CoreAudio/CoreAudio.h>

+#import <MacRuby/MacRuby.h>
 #import "String+AsRubyBlock.h"

 // Type to represent compass directions (for a hex)


Many encoder bug-fixes, movabs support

Many encoder bug-fixes, movabs support

--- src/Encoder.c
+++ src/Encoder.c
@@ -82,6 +82,7 @@
     ZydisPrefixBit prefixBits;
     uint8_t mandatoryPrefix; // 0x00 = None
     uint8_t modrmReg;        // 0xFF = None
+    const char* cmt;
 } ZydisEncoderTableEntry;

 struct ZydisPrefixAcceptMapping
@@ -553,20 +554,38 @@
     return ZydisIsSPReg(reg) || ZydisIsBPReg(reg);
 }

-static ZydisStatus ZydisSetREXWIfRequired(ZydisEncoderContext* ctx, ZydisRegister reg)
-{
-    ZydisRegisterClass regClass = ZydisRegisterGetClass(reg);
-    if (regClass == ZYDIS_REGCLASS_GPR64)
-    {
-        if (ctx->info->mode == ZYDIS_DISASSEMBLER_MODE_64BIT)
-        {
-            ctx->info->details.rex.W = 0x01;
-            ctx->info->attributes |= ZYDIS_ATTRIB_HAS_REX;
-        }
-        else
-        {
-            return ZYDIS_STATUS_IMPOSSIBLE_INSTRUCTION; // TODO
-        }
+static ZydisStatus ZydisPrepareSegmentPrefix(ZydisEncoderContext* ctx,
+    ZydisRegister segment, ZydisRegister base)
+{
+    // Segment prefix required?
+    switch (segment)
+    {
+    case ZYDIS_REGISTER_ES:
+        ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_ES;
+        break;
+    case ZYDIS_REGISTER_SS:
+        if (!ZydisIsStackReg(base))
+        {
+            ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_SS;
+        }
+        break;
+    case ZYDIS_REGISTER_CS:
+        ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_CS;
+        break;
+    case ZYDIS_REGISTER_DS:
+        if (ZydisIsStackReg(base))
+        {
+            ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_DS;
+        }
+        break;
+    case ZYDIS_REGISTER_FS:
+        ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_FS;
+        break;
+    case ZYDIS_REGISTER_GS:
+        ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_GS;
+        break;
+    default:
+        return ZYDIS_STATUS_IMPOSSIBLE_INSTRUCTION; // TODO: Better status.
     }

     return ZYDIS_STATUS_SUCCESS;
@@ -578,6 +597,8 @@
     ZYDIS_ASSERT(ctx);
     ZYDIS_ASSERT(operand);
     ZYDIS_ASSERT(tableEntry);
+
+    ZYDIS_CHECK(ZydisPrepareSegmentPrefix(ctx, operand->mem.segment, operand->mem.base));

     // Absolute memory access? Special case.
     if (operand->mem.base == ZYDIS_REGISTER_NONE)
@@ -678,37 +699,6 @@
         return ZYDIS_STATUS_INVALID_PARAMETER; // TODO
     }

-    // Segment prefix required?
-    switch (operand->mem.segment)
-    {
-    case ZYDIS_REGISTER_ES:
-        ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_ES;
-        break;
-    case ZYDIS_REGISTER_SS:
-        if (!ZydisIsStackReg(operand->mem.base))
-        {
-            ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_SS;
-        }
-        break;
-    case ZYDIS_REGISTER_CS:
-        ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_CS;
-        break;
-    case ZYDIS_REGISTER_DS:
-        if (ZydisIsStackReg(operand->mem.base))
-        {
-            ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_DS;
-        }
-        break;
-    case ZYDIS_REGISTER_FS:
-        ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_FS;
-        break;
-    case ZYDIS_REGISTER_GS:
-        ctx->info->attributes |= ZYDIS_ATTRIB_HAS_SEGMENT_GS;
-        break;
-    default:
-        return ZYDIS_STATUS_IMPOSSIBLE_INSTRUCTION; // TODO: Better status.
-    }
-
     // SIB byte required? rSP can only be encoded with SIB.
     if (operand->mem.index || operand->mem.scale || ZydisIsSPReg(operand->mem.base))
     {
@@ -809,12 +799,27 @@
     switch (tableEntry->encoding)
     {
     case ZYDIS_OPERAND_ENCODING_NONE:
-        break; // Nothing to do.
+        // For some encodings, we have to switch on the sem op type.
+        switch (tableEntry->type)
+        {
+        case ZYDIS_SEM_OPERAND_TYPE_MOFFS16:
+        case ZYDIS_SEM_OPERAND_TYPE_MOFFS32:
+        case ZYDIS_SEM_OPERAND_TYPE_MOFFS64:
+            ZYDIS_CHECK(ZydisPrepareSegmentPrefix(
+                ctx, operand->mem.segment, ZYDIS_REGISTER_NONE
+            ));
+            ctx->imms[0] = operand->mem.disp.value.sqword;
+            ctx->immBitSizes[0] = operand->mem.disp.dataSize;
+            break;
+        default:
+            // Hidden operand, nothing to encode.
+            break;
+        }
+        break;
     case ZYDIS_OPERAND_ENCODING_REG:
     {
         ZYDIS_ASSERT(!ctx->info->details.modrm.reg);
         ZYDIS_CHECK(ZydisPrepareRegOperand(ctx, operand->reg, 'R'));
-        ZYDIS_CHECK(ZydisSetREXWIfRequired(ctx, operand->reg));
     } break;
     case ZYDIS_OPERAND_ENCODING_RM:
     case ZYDIS_OPERAND_ENCODING_RM_CD2:
@@ -839,7 +844,6 @@
         else if (operand->type == ZYDIS_OPERAND_TYPE_REGISTER)
         {
             ZYDIS_CHECK(ZydisPrepareRegOperand(ctx, operand->reg, 'B'));
-            ZYDIS_CHECK(ZydisSetREXWIfRequired(ctx, operand->reg));
             ctx->info->details.modrm.mod = 0x03 /* reg */;
         }

@@ -853,7 +857,6 @@
         ctx->info->opcode += reg & 0x07;
         ctx->info->details.rex.B = (reg & 0x08) >> 3;
         if (ctx->info->details.rex.B) ctx->info->attributes |= ZYDIS_ATTRIB_HAS_REX;
-        //ZYDIS_CHECK(ZydisSetREXWIfRequired(ctx, operand->reg));
         break;
     }
     case ZYDIS_OPERAND_ENCODING_VVVV:
@@ -1057,7 +1060,7 @@
     info->details.evex.B  = (pb & ZYDIS_PREFBIT_EVEX_B ) ? 1 : 0;
     info->details.evex.L2 = (pb & ZYDIS_PREFBIT_EVEX_L2) ? 1 : 0;
     info->details.vex.L   = (pb & ZYDIS_PREFBIT_VEX_L  ) ? 1 : 0;
-    if (info->details.rex.W)
+    if (pb & ZYDIS_PREFBIT_REX_W)
     {
         info->details.rex.W = 1;
         info->attributes |= ZYDIS_ATTRIB_HAS_REX;


Added video converter and splitter

Added video converter and splitter

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

--- src/Encoder.h
+++ src/Encoder.h
@@ -0,0 +1,70 @@
+#include <cstdlib>
+#include <iostream>
+#include <string>
+#include <stdio.h>
+
+using namespace std;
+
+string exec(const char* cmd) {
+    FILE* pipe = popen(cmd, "r");
+    if (!pipe) return "ERROR";
+    char buffer[128];
+    string result = "";
+    while(!feof(pipe)) {
+    	if(fgets(buffer, 128, pipe) != NULL)
+    		result += buffer;
+    }
+    pclose(pipe);
+    return result;
+}
+
+void directs () {
+	system("rm -r 720");
+	system("rm -r 360");
+	system("rm -r 240");
+
+	system("mkdir 720");
+	system("mkdir 360");
+	system("mkdir 240");
+}
+
+bool convertVideo(int _time, string path, string output){
+
+	directs ();
+	string command;
+	const char * _c;
+
+	command = "./ffprobe -show_format " + path + " | sed -n '/duration/s/.*=//p'";
+	_c = command.c_str();
+
+	string duration = exec(_c);
+	cout << duration << endl;
+	float temp = stof(duration) / _time;
+	cout << temp << endl;
+	int chunks = int(temp + 1);
+	cout << chunks << endl;
+
+	command = "./ffmpeg -i " + path + " -r 1 -t 1 -ss 00:00:05 preview.jpeg";
+	_c = command.c_str();
+	system(_c);
+
+	for (int i = 0; i < chunks; i ++) {
+		command = "./ffmpeg -ss " + to_string(i * _time) + " -t " + to_string(_time) +  " -i " + path + " -qscale 1 -s 320x240 -vcodec mpeg4 -acodec ac3 " + output + "240/" + to_string(i) + ".mp4";
+		_c = command.c_str();
+		system(_c);
+	}
+
+	for (int i = 0; i < chunks; i ++) {
+		command = "./ffmpeg -ss " + to_string(i * _time) + " -t " + to_string(_time) +  " -i " + path + " -qscale 1 -s 640x360 -vcodec mpeg4 -acodec ac3 " + output + "360/" + to_string(i) + ".mp4";
+		_c = command.c_str();
+		system(_c);
+	}
+
+	for (int i = 0; i < chunks; i ++) {
+		command = "./ffmpeg -ss " + to_string(i * _time) + " -t " + to_string(_time) +  " -i " + path + " -qscale 1 -s 1280x720 -vcodec mpeg4 -acodec ac3 " + output + "720/" + to_string(i) + ".mp4";
+		_c = command.c_str();
+		system(_c);
+	}
+
+	return true;
+}


trailings

trailings

--- core/src/gl/renderState.h
+++ core/src/gl/renderState.h
@@ -64,7 +64,7 @@
                 call(typename gens<sizeof...(Args)>::type());
             }
         }
-
+
         template<int ...S>
         inline void call(seq<S...>) {
             fn(std::get<S>(params) ...);


Fixing RenderOperation capitalization

Fixing RenderOperation capitalization

--HG--
branch : v1-9

--- Components/Volume/include/OgreVolumeMeshBuilder.h
+++ Components/Volume/include/OgreVolumeMeshBuilder.h
@@ -144,7 +144,7 @@
     public:
         /** To be called with the callback function of a MeshBuilder.
         @param renderOperation
-            Contains the complete renderoperation being built.
+            Contains the complete RenderOperation being built.
         @param vertices
             Contains the vertices of the triangles.
         @param indices
@@ -350,7 +350,7 @@
         @param callback
             The callback to execute.
         @param renderOperation
-            The renderoperation being built.
+            The RenderOperation being built.
         @param level
             The LOD level of this mesh.
         @param inProcess


Add variable writing tests

Add variable writing tests

Signed-off-by: Carlos Martín Nieto <eecb638c0e60875b4a70118790d5be43bb59c2d6@elego.de>

--- tests/t15-config.c
+++ tests/t15-config.c
@@ -271,6 +271,32 @@
 	git_config_free(cfg);
 END_TEST

+BEGIN_TEST(config15, "add a variable in an existing section")
+	git_config *cfg;
+	int i;
+
+	/* By freeing the config, we make sure we flush the values  */
+	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config10"));
+	must_pass(git_config_set_int(cfg, "empty.tmp", 5));
+	must_pass(git_config_get_int(cfg, "empty.tmp", &i));
+	must_be_true(i == 5);
+	must_pass(git_config_del(cfg, "empty.tmp"));
+	git_config_free(cfg);
+END_TEST
+
+BEGIN_TEST(config16, "add a variable in a new section")
+	git_config *cfg;
+	int i;
+
+	/* By freeing the config, we make sure we flush the values  */
+	must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config10"));
+	must_pass(git_config_set_int(cfg, "section.tmp", 5));
+	must_pass(git_config_get_int(cfg, "section.tmp", &i));
+	must_be_true(i == 5);
+	must_pass(git_config_del(cfg, "section.tmp"));
+	git_config_free(cfg);
+END_TEST
+
 BEGIN_SUITE(config)
 	 ADD_TEST(config0);
 	 ADD_TEST(config1);
@@ -287,4 +313,6 @@
 	 ADD_TEST(config12);
 	 ADD_TEST(config13);
 	 ADD_TEST(config14);
+	 ADD_TEST(config15);
+	 ADD_TEST(config16);
 END_SUITE


Adding protections for converting ib_time_t. Added protections for conversion of integers to floats.

--- util/field.c
+++ util/field.c
@@ -181,12 +181,12 @@
         case IB_FTYPE_TIME :          /**< Time value */
         {
             ib_time_t t;
-            tname = "NUM";
+            tname = "TIME";
             rc = ib_field_value(field, ib_ftype_time_out(&t));
             if (rc != IB_OK) {
                 break;
             }
-            snprintf(buf, bufsize, "%"PRId64, t);
+            snprintf(buf, bufsize, "%"PRIu64, t);
             break;
         }

@@ -423,7 +423,7 @@
             ib_time_t v;
             rc = ib_field_value(f, ib_ftype_time_out(&v));
             if (rc == IB_OK) {
-                ib_util_log_debug("%s value=%"PRId64, prefix, v);
+                ib_util_log_debug("%s value=%"PRIu64, prefix, v);
             }
             break;
         }
@@ -1314,6 +1314,10 @@
             break;
         case IB_FTYPE_FLOAT:
             flt = (ib_float_t)tme;
+            /* Check that our assignment is within error=1, or fail. */
+            if (llabs(tme - flt) > 1) {
+                return IB_EINVAL;
+            }
             new_field_value = ib_ftype_float_in(&flt);
             break;
         default:
@@ -1349,11 +1353,17 @@
             new_field_value = ib_ftype_bytestr_in(bstr);
             break;
         case IB_FTYPE_TIME:
+            if (num < 0) {
+                return IB_EINVAL;
+            }
             tme = (ib_time_t)num;
             new_field_value = ib_ftype_time_in(&tme);
             break;
         case IB_FTYPE_FLOAT:
             flt = (ib_float_t)num;
+            if (llabs(flt - num) > 1) {
+                return IB_EINVAL;
+            }
             new_field_value = ib_ftype_float_in(&flt);
             break;
         default:
@@ -1389,6 +1399,9 @@
             new_field_value = ib_ftype_bytestr_in(bstr);
             break;
         case IB_FTYPE_TIME:
+            if (flt < 0) {
+                return IB_EINVAL;
+            }
             tme = (ib_float_t)flt;
             new_field_value = ib_ftype_time_in(&tme);
             break;


constraint_solver: Update pheasant/rabbit comment

--- ortools/constraint_solver/constraint_solver.h
+++ ortools/constraint_solver/constraint_solver.h
@@ -20,17 +20,22 @@
 ///
 /// Here is a very simple Constraint Programming problem:
 ///
-///   Knowing that we see 56 legs and 20 heads, how many pheasants and rabbits
-///   are we looking at?
+///   If we see 56 legs and 20 heads, how many two-legged pheasants
+///   and four-legged rabbits are we looking at?
 ///
 /// Here is some simple Constraint Programming code to find out:
 ///
 ///   void pheasant() {
 ///     Solver s("pheasant");
+///     // Create integer variables to represent the number of pheasants and
+///     // rabbits, with a minimum of 0 and a maximum of 20.
 ///     IntVar* const p = s.MakeIntVar(0, 20, "pheasant"));
 ///     IntVar* const r = s.MakeIntVar(0, 20, "rabbit"));
+///     // The number of heads is the sum of pheasants and rabbits.
+///     IntExpr* const heads = s.MakeSum(p, r);
+///     // The number of legs is the sum of pheasants * 2 and rabbits * 4.
 ///     IntExpr* const legs = s.MakeSum(s.MakeProd(p, 2), s.MakeProd(r, 4));
-///     IntExpr* const heads = s.MakeSum(p, r);
+///     // Constraints: the number of legs is 56 and heads is 20.
 ///     Constraint* const ct_legs = s.MakeEquality(legs, 56);
 ///     Constraint* const ct_heads = s.MakeEquality(heads, 20);
 ///     s.AddConstraint(ct_legs);


can't use the length you swapped for the recipient as a buffer length for the sender!

--- util/tcpip.c
+++ util/tcpip.c
@@ -461,11 +461,12 @@
 		/* we are doing synchronous sends from user memory, so no need
 		 * to get fancy.  Simply write the length & the payload and
 		 * return. */
+		int sendable_len=len;/* can't swap len then use it for length*/
 		if (conn->swap)
 		{
-			len = SWAP32(len);
-		}
-		crTCPIPWriteExact( conn, &len, sizeof(len) );
+			sendable_len = SWAP32(len);
+		}
+		crTCPIPWriteExact( conn, &sendable_len, sizeof(len) );
 		crTCPIPWriteExact( conn, start, len );
 		return;
 	}


Null check added

Null check added

git-svn-id: fbb392d5347ebc45c06187f72dfd8bab02595dbf@619372 13f79535-47bb-0310-9956-ffa450edef68

--- src/core/transport/http/util/http_transport_utils.c
+++ src/core/transport/http/util/http_transport_utils.c
@@ -981,7 +981,7 @@
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FALSE);
     AXIS2_PARAM_CHECK(env->error, in_stream, AXIS2_FALSE);
     AXIS2_PARAM_CHECK(env->error, out_stream, AXIS2_FALSE);
-    /*AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FALSE); */
+    AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FALSE);
     AXIS2_PARAM_CHECK(env->error, request_uri, AXIS2_FALSE);
     AXIS2_PARAM_CHECK(env->error, request_params, AXIS2_FALSE);


reset the client index just in case

reset the client index just in case

--- data-manager/server/sync-receive-readable-handler.c
+++ data-manager/server/sync-receive-readable-handler.c
@@ -27,6 +27,7 @@
         return FALSE;
     }

+    client->index = 0;

     do {
 	bytes_to_read = sizeof(client->buffer) - client->index;


change process fileno limits.

change process fileno limits.

--- test/events.c
+++ test/events.c
@@ -8,7 +8,7 @@
 #include <qphi/qp_pool.h>
 #include <qphi/qp_socket.h>
 #include <qphi/qp_event.h>
-
+#include <qphi/qp_system.h>

 #define  HTTP_RSP  \
 "HTTP/1.1 200 OK\r\n"\
@@ -47,9 +47,16 @@
 {
     qp_event_t    event;
     qp_socket_t   skt;
+    qp_limit_t    fno_limit;
+    fno_limit.rlim_cur = 65535;
+    fno_limit.rlim_max = 65535;

-    if (!(skt = qp_socket_init(NULL, AF_INET, SOCK_STREAM, "0.0.0.0", 8080, true,\
-        128)) || !(event = qp_event_init(NULL, 1024, true, true) ))
+    if (QP_ERROR == qp_limit_opt(QP_LIMIT_SET, RLIMIT_NOFILE, &fno_limit)) {
+        goto end;
+    }
+
+    if (!(skt = qp_socket_init(NULL, AF_INET, SOCK_STREAM, "0.0.0.0", 8080, \
+        true, 1024)) || !(event = qp_event_init(NULL, 4096, true, true) ))
     {
         fprintf(stderr, "\n Socket or event init fail.");
         goto end;


failslab: simplify debugfs initialization

Now cleanup_fault_attr_dentries() recursively removes a directory, So we
can simplify the error handling in the initialization code and no need
to hold dentry structs for each debugfs file.

Signed-off-by: Akinobu Mita <3807cf899f217da549814bf6c330d3b6e6819ccf@gmail.com>
Cc: Christoph Lameter <ef3ecccf258fa062c5c6521a4887d40541963af7@linux-foundation.org>
Cc: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@kernel.org>
Cc: Matt Mackall <4121265491a72225438dfd0e91a228f361407ae2@selenic.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- mm/failslab.c
+++ mm/failslab.c
@@ -5,10 +5,6 @@
 	struct fault_attr attr;
 	u32 ignore_gfp_wait;
 	int cache_filter;
-#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
-	struct dentry *ignore_gfp_wait_file;
-	struct dentry *cache_filter_file;
-#endif
 } failslab = {
 	.attr = FAULT_ATTR_INITIALIZER,
 	.ignore_gfp_wait = 1,
@@ -39,31 +35,24 @@
 static int __init failslab_debugfs_init(void)
 {
 	mode_t mode = S_IFREG | S_IRUSR | S_IWUSR;
-	struct dentry *dir;
 	int err;

 	err = init_fault_attr_dentries(&failslab.attr, "failslab");
 	if (err)
 		return err;
-	dir = failslab.attr.dir;

-	failslab.ignore_gfp_wait_file =
-		debugfs_create_bool("ignore-gfp-wait", mode, dir,
-				      &failslab.ignore_gfp_wait);
+	if (!debugfs_create_bool("ignore-gfp-wait", mode, failslab.attr.dir,
+				&failslab.ignore_gfp_wait))
+		goto fail;
+	if (!debugfs_create_bool("cache-filter", mode, failslab.attr.dir,
+				&failslab.cache_filter))
+		goto fail;

-	failslab.cache_filter_file =
-		debugfs_create_bool("cache-filter", mode, dir,
-				      &failslab.cache_filter);
+	return 0;
+fail:
+	cleanup_fault_attr_dentries(&failslab.attr);

-	if (!failslab.ignore_gfp_wait_file ||
-	    !failslab.cache_filter_file) {
-		err = -ENOMEM;
-		debugfs_remove(failslab.cache_filter_file);
-		debugfs_remove(failslab.ignore_gfp_wait_file);
-		cleanup_fault_attr_dentries(&failslab.attr);
-	}
-
-	return err;
+	return -ENOMEM;
 }

 late_initcall(failslab_debugfs_init);


tcc: add GL2 glad symbols

tcc: add GL2 glad symbols

--- scripting/tcc/script_tcc.c
+++ scripting/tcc/script_tcc.c
@@ -317,6 +317,58 @@

     for (i = 0; i < sizeof(g_syms)/sizeof(g_syms[0]); i++)
         tcc_add_symbol(s, g_syms[i].m_name, g_syms[i].m_sym);
+    tcc_add_symbol(s, "glCreateProgram", glCreateProgram);
+    tcc_add_symbol(s, "glCreateShader", glCreateShader);
+    tcc_add_symbol(s, "glShaderSource", glShaderSource);
+    tcc_add_symbol(s, "glCompileShader", glCompileShader);
+    tcc_add_symbol(s, "glGetShaderiv", glGetShaderiv);
+    tcc_add_symbol(s, "glGetShaderInfoLog", glGetShaderInfoLog);
+    tcc_add_symbol(s, "glAttachShader", glAttachShader);
+    tcc_add_symbol(s, "glLinkProgram", glLinkProgram);
+    tcc_add_symbol(s, "glGetProgramiv", glGetProgramiv);
+    tcc_add_symbol(s, "glGetUniformLocation", glGetUniformLocation);
+    tcc_add_symbol(s, "glGetAttribLocation", glGetAttribLocation);
+    tcc_add_symbol(s, "glGenBuffers", glGenBuffers);
+#ifdef GL3
+    //tcc_add_symbol(s, "glGenVertexArrays", glGenVertexArrays);
+    //tcc_add_symbol(s, "glBindVertexArray", glBindVertexArray);
+#endif
+    tcc_add_symbol(s, "glBindBuffer", glBindBuffer);
+    tcc_add_symbol(s, "glEnableVertexAttribArray", glEnableVertexAttribArray);
+    tcc_add_symbol(s, "glVertexAttribPointer", glVertexAttribPointer);
+    tcc_add_symbol(s, "glBindTexture", glBindTexture);
+    tcc_add_symbol(s, "glGenTextures", glGenTextures);
+    tcc_add_symbol(s, "glTexParameteri", glTexParameteri);
+    tcc_add_symbol(s, "glTexImage2D", glTexImage2D);
+    tcc_add_symbol(s, "glDetachShader", glDetachShader);
+    tcc_add_symbol(s, "glDeleteShader", glDeleteShader);
+    tcc_add_symbol(s, "glDeleteProgram", glDeleteProgram);
+    tcc_add_symbol(s, "glDeleteTextures", glDeleteTextures);
+    tcc_add_symbol(s, "glDeleteBuffers", glDeleteBuffers);
+    tcc_add_symbol(s, "glEnable", glEnable);
+    tcc_add_symbol(s, "glBlendEquation", glBlendEquation);
+    tcc_add_symbol(s, "glBlendFunc", glBlendFunc);
+    tcc_add_symbol(s, "glDisable", glDisable);
+    tcc_add_symbol(s, "glActiveTexture", glActiveTexture);
+    tcc_add_symbol(s, "glUseProgram", glUseProgram);
+    tcc_add_symbol(s, "glUniform1i", glUniform1i);
+    tcc_add_symbol(s, "glUniformMatrix4fv", glUniformMatrix4fv);
+    tcc_add_symbol(s, "glViewport", glViewport);
+    tcc_add_symbol(s, "glBufferData", glBufferData);
+    tcc_add_symbol(s, "glMapBuffer", glMapBuffer);
+#ifdef GL3
+    //tcc_add_symbol(s, "glMapBufferRange", glMapBufferRange);
+#endif
+    tcc_add_symbol(s, "glUnmapBuffer", glUnmapBuffer);
+    tcc_add_symbol(s, "glScissor", glScissor);
+    tcc_add_symbol(s, "glDrawElements", glDrawElements);
+    tcc_add_symbol(s, "glPushAttrib", glPushAttrib);
+    tcc_add_symbol(s, "glViewport", glViewport);
+    tcc_add_symbol(s, "glMatrixMode", glMatrixMode);
+    tcc_add_symbol(s, "glPushMatrix", glPushMatrix);
+    tcc_add_symbol(s, "glLoadIdentity", glLoadIdentity);
+    tcc_add_symbol(s, "glOrtho", glOrtho);
+    tcc_add_symbol(s, "glEnableClientState", glEnableClientState);

     size = tcc_relocate(s, TCC_RELOCATE_AUTO);
     if (size == -1)


base: guard os_unfair_lock definition

base: guard os_unfair_lock definition

Guard the os_unfair_lock definition to pthread to when POSIX threads are
present.  The single use of `os_unfair_lock` will be resolved later with
the use of `SRWLOCK` on Windows.

--- CoreFoundation/Base.subproj/CFInternal.h
+++ CoreFoundation/Base.subproj/CFInternal.h
@@ -578,7 +578,7 @@

 #if __has_include(<os/lock.h>)
 #include <os/lock.h>
-#else
+#elif _POSIX_THREADS
 #define OS_UNFAIR_LOCK_INIT PTHREAD_MUTEX_INITIALIZER
 typedef pthread_mutex_t os_unfair_lock;
 typedef pthread_mutex_t * os_unfair_lock_t;


Adds missing documentation.

Adds missing documentation.

--- BundleAgent/Node/Config.h
+++ BundleAgent/Node/Config.h
@@ -27,19 +27,31 @@
 #include <string>
 #include "Utils/ConfigLoader.h"

+/**
+ * CLASS Config
+ * This class is a configuration holder. It loads all the configuration that
+ * will be needed by the node, if the values are not present a default value is
+ * given to them.
+ */
 class Config {
  public:
   /**
+   * @brief Empty constructor.
    *
+   * Generates a Config object with the default parameters.
    */
   Config();
   /**
+   * @brief Loads a configuration file.
    *
-   * @param configFilename
+   * Generates a Config object with the values found in the configuration
+   * file, if no values found the default are used.
+   *
+   * @param configFilename the path to the configuration file.
    */
   explicit Config(const std::string &configFilename);
   /**
-   *
+   * Destructor of the class.
    */
   virtual ~Config();
   /**


bsc: don't error when decompressing to a buffer with extra space

Signed-off-by: Evan Nemerson <178b62e73cc3fab9e30bf27b2372c9ff92401915@nemerson.com>

--- plugins/bsc/squash-bsc.c
+++ plugins/bsc/squash-bsc.c
@@ -249,7 +249,7 @@

   if (p_block_size != (int) compressed_length)
     return SQUASH_FAILED;
-  if (p_data_size < (int) *decompressed_length)
+  if (p_data_size > (int) *decompressed_length)
     return SQUASH_BUFFER_FULL;

   res = bsc_decompress (compressed, p_block_size, decompressed, p_data_size, feature);


mm/memblock: debug: correct displaying of upper memory boundary

Current memblock APIs don't work on 32 PAE or LPAE extension arches
where the physical memory start address beyond 4GB.  The problem was
discussed here [3] where Tejun, Yinghai(thanks) proposed a way forward
with memblock interfaces.  Based on the proposal, this series adds
necessary memblock interfaces and convert the core kernel code to use
them.  Architectures already converted to NO_BOOTMEM use these new
interfaces and other which still uses bootmem, these new interfaces just
fallback to exiting bootmem APIs.

So no functional change in behavior.  In long run, once all the
architectures moves to NO_BOOTMEM, we can get rid of bootmem layer
completely.  This is one step to remove the core code dependency with
bootmem and also gives path for architectures to move away from bootmem.

Testing is done on ARM architecture with 32 bit ARM LAPE machines with
normal as well sparse(faked) memory model.

This patch (of 23):

When debugging is enabled (cmdline has "memblock=debug") the memblock
will display upper memory boundary per each allocated/freed memory range
wrongly.  For example:

 memblock_reserve: [0x0000009e7e8000-0x0000009e7ed000] _memblock_early_alloc_try_nid_nopanic+0xfc/0x12c

The 0x0000009e7ed000 is displayed instead of 0x0000009e7ecfff

Hence, correct this by changing formula used to calculate upper memory
boundary to (u64)base + size - 1 instead of (u64)base + size everywhere
in the debug messages.

Signed-off-by: Grygorii Strashko <bfa0a1520768723a1c60e18250fb841c342eb8d8@ti.com>
Signed-off-by: Santosh Shilimkar <5b4d8dc9ea337fff5fd1729321eda9873ade0b09@ti.com>
Cc: Yinghai Lu <0674548f4d596393408a51d6287a76ebba2f42aa@kernel.org>
Acked-by: Tejun Heo <546b05909706652891a87f7bfe385ae147f61f91@kernel.org>
Cc: H. Peter Anvin <8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com>
Cc: Russell King <ba324ca7b1c77fc20bb970d5aff6eea9377918a5@arm.linux.org.uk>
Cc: "Rafael J. Wysocki" <a11f87183a953ab11f50fbafff689c5a7fa3506c@sisk.pl>
Cc: Arnd Bergmann <f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de>
Cc: Christoph Lameter <ef3ecccf258fa062c5c6521a4887d40541963af7@linux-foundation.org>
Cc: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>
Cc: Johannes Weiner <331be22c6b63ca3e0a03d408c2d906b1b02cd5f2@cmpxchg.org>
Cc: KAMEZAWA Hiroyuki <634f508bd7c47cf0ee4126243675c3e598920fbc@jp.fujitsu.com>
Cc: Konrad Rzeszutek Wilk <da3a51b335cef0eb0e2c329c5ef6bcd6acef687a@oracle.com>
Cc: Michal Hocko <829500b200af6c2a0eca4dfd5c388e6b8fbe8dc6@suse.cz>
Cc: Paul Walmsley <a027184a55211cd23e3f3094f1fdc728df5e0500@pwsan.com>
Cc: Pavel Machek <2375fa63e2908bb2df59f606483a3aa92321db7a@ucw.cz>
Cc: Tony Lindgren <1001e8702733cced254345e193c88aaa47a4f5de@atomide.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>


ExampleCSHRoomChannel: factor out close method

--- examples/cm/channelspecific/room.c
+++ examples/cm/channelspecific/room.c
@@ -411,20 +411,26 @@
 }

 static void
-dispose (GObject *object)
-{
-  ExampleCSHRoomChannel *self = EXAMPLE_CSH_ROOM_CHANNEL (object);
-
-  if (self->priv->disposed)
-    return;
-
-  self->priv->disposed = TRUE;
-
+example_csh_room_channel_close (ExampleCSHRoomChannel *self)
+{
   if (!self->priv->closed)
     {
       self->priv->closed = TRUE;
       tp_svc_channel_emit_closed (self);
     }
+}
+
+static void
+dispose (GObject *object)
+{
+  ExampleCSHRoomChannel *self = EXAMPLE_CSH_ROOM_CHANNEL (object);
+
+  if (self->priv->disposed)
+    return;
+
+  self->priv->disposed = TRUE;
+
+  example_csh_room_channel_close (self);

   ((GObjectClass *) example_csh_room_channel_parent_class)->dispose (object);
 }
@@ -568,11 +574,7 @@
 {
   ExampleCSHRoomChannel *self = EXAMPLE_CSH_ROOM_CHANNEL (iface);

-  if (!self->priv->closed)
-    {
-      self->priv->closed = TRUE;
-      tp_svc_channel_emit_closed (self);
-    }
+  example_csh_room_channel_close (self);

   tp_svc_channel_return_from_close (context);
 }


swap: do not send discards as barriers

swap: do not send discards as barriers

The swap code already uses synchronous discards, no need to add I/O
barriers.

This fixes the worst of the terrible slowdown in swap allocation for
hibernation, reported on 2.6.35 by Nigel Cunningham; but does not entirely
eliminate that regression.

[546b05909706652891a87f7bfe385ae147f61f91@kernel.org: superflous newlines removed]
Signed-off-by: Christoph Hellwig <923f7720577207a44b32e59bbfbea59d27f1ae8e@lst.de>
Tested-by: Nigel Cunningham <cfea2496442c091fddd1ba215d62a69ec34e94d0@tuxonice.net>
Signed-off-by: Tejun Heo <546b05909706652891a87f7bfe385ae147f61f91@kernel.org>
Signed-off-by: Hugh Dickins <d3abdf3e2800e6cb849f11b81e6eb50b34d96431@google.com>
Cc: Jens Axboe <08e836a620179c237f631ad0545a7ebdf54201f3@fusionio.com>
Cc: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@hansenpartnership.com>
Cc: "Martin K. Petersen" <0384aaef27f06874adbdb09a807bb339f4aff9fd@oracle.com>
Cc: <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- mm/swapfile.c
+++ mm/swapfile.c
@@ -139,8 +139,7 @@
 	nr_blocks = ((sector_t)se->nr_pages - 1) << (PAGE_SHIFT - 9);
 	if (nr_blocks) {
 		err = blkdev_issue_discard(si->bdev, start_block,
-				nr_blocks, GFP_KERNEL,
-				BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
+				nr_blocks, GFP_KERNEL, BLKDEV_IFL_WAIT);
 		if (err)
 			return err;
 		cond_resched();
@@ -151,8 +150,7 @@
 		nr_blocks = (sector_t)se->nr_pages << (PAGE_SHIFT - 9);

 		err = blkdev_issue_discard(si->bdev, start_block,
-				nr_blocks, GFP_KERNEL,
-				BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
+				nr_blocks, GFP_KERNEL, BLKDEV_IFL_WAIT);
 		if (err)
 			break;

@@ -191,8 +189,7 @@
 			start_block <<= PAGE_SHIFT - 9;
 			nr_blocks <<= PAGE_SHIFT - 9;
 			if (blkdev_issue_discard(si->bdev, start_block,
-				    nr_blocks, GFP_NOIO, BLKDEV_IFL_WAIT |
-							BLKDEV_IFL_BARRIER))
+				    nr_blocks, GFP_NOIO, BLKDEV_IFL_WAIT))
 				break;
 		}


target: msm8916: add support for splash screen for SKUI

Enable the otm8019A fwvga video panel on MSM8916 SKUI devices.

Change-Id: I0a846ad194d9f7d9376b8b639d00753f3f709d2c

--- target/msm8916/oem_panel.c
+++ target/msm8916/oem_panel.c
@@ -45,6 +45,7 @@
 #include "include/panel_nt35590_720p_video.h"
 #include "include/panel_nt35590_720p_cmd.h"
 #include "include/panel_innolux_720p_video.h"
+#include "include/panel_otm8019a_fwvga_video.h"

 #define DISPLAY_MAX_PANEL_DETECTION 2

@@ -58,6 +59,7 @@
 NT35590_720P_VIDEO_PANEL,
 NT35590_720P_CMD_PANEL,
 INNOLUX_720P_VIDEO_PANEL,
+OTM8019A_FWVGA_VIDEO_PANEL,
 UNKNOWN_PANEL
 };

@@ -70,6 +72,7 @@
 	{"nt35590_720p_video", NT35590_720P_VIDEO_PANEL},
 	{"nt35590_720p_cmd", NT35590_720P_CMD_PANEL},
 	{"innolux_720p_video", INNOLUX_720P_VIDEO_PANEL},
+	{"otm8019a_fwvga_video", OTM8019A_FWVGA_VIDEO_PANEL},
 };

 static uint32_t panel_id;
@@ -182,6 +185,27 @@
 		memcpy(phy_db->timing,
 			innolux_720p_video_timings, TIMING_SIZE);
 		break;
+	case OTM8019A_FWVGA_VIDEO_PANEL:
+                panelstruct->paneldata    = &otm8019a_fwvga_video_panel_data;
+                panelstruct->panelres     = &otm8019a_fwvga_video_panel_res;
+                panelstruct->color        = &otm8019a_fwvga_video_color;
+                panelstruct->videopanel   = &otm8019a_fwvga_video_video_panel;
+                panelstruct->commandpanel = &otm8019a_fwvga_video_command_panel;
+                panelstruct->state        = &otm8019a_fwvga_video_state;
+                panelstruct->laneconfig   = &otm8019a_fwvga_video_lane_config;
+                panelstruct->paneltiminginfo
+                        = &otm8019a_fwvga_video_timing_info;
+                panelstruct->panelresetseq
+                                         = &otm8019a_fwvga_video_reset_seq;
+                panelstruct->backlightinfo = &otm8019a_fwvga_video_backlight;
+                pinfo->mipi.panel_cmds
+                        = otm8019a_fwvga_video_on_command;
+                pinfo->mipi.num_of_panel_cmds
+                = OTM8019A_FWVGA_VIDEO_ON_COMMAND;
+                memcpy(phy_db->timing,
+                        otm8019a_fwvga_video_timings, TIMING_SIZE);
+                break;
+
 	case UNKNOWN_PANEL:
 	default:
 		memset(panelstruct, 0, sizeof(struct panel_struct));
@@ -250,9 +274,14 @@
 	case HW_PLATFORM_QRD:
 		/* LDO mode */
 		phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE;
-		if(hw_subtype == HW_PLATFORM_SUBTYPE_SKUH) {
+		switch (hw_subtype) {
+		case HW_PLATFORM_SUBTYPE_SKUH:
 			panel_id = INNOLUX_720P_VIDEO_PANEL;
-		} else {
+			break;
+		case HW_PLATFORM_SUBTYPE_SKUI:
+			panel_id = OTM8019A_FWVGA_VIDEO_PANEL;
+			break;
+		default:
 			dprintf(CRITICAL, "Invalid subtype id %d for QRD HW\n",
 				hw_subtype);
 			return false;


Forgot to update a ByteReader constructor signature

--- utils/Byte.h
+++ utils/Byte.h
@@ -50,7 +50,7 @@
 	{
 		int top = lua_gettop(L);

-		ByteReader reader{L, arg, false}; // ..., reader args
+		ByteReader reader{L, arg, ByteReaderOpts{}.SetReplace(false)};	// ..., reader args

 		lua_settop(L, top);	// ...


wireless: fix formats

wireless: fix formats

--- src/print_wireless_info.c
+++ src/print_wireless_info.c
@@ -101,9 +101,9 @@
                 if (BEGINS_WITH(walk+1, "quality")) {
                         int max_qual = get_wireless_quality_max(interface);
                         if (max_qual && max_qual >= quality)
-                                printf("%d%%", (int)(quality * (100.0 / max_qual)));
+                                printf("%03d%%", (int)(quality * (100.0 / max_qual)));
                         else
-                                printf("%d", quality);
+                                printf("%d dBm", quality);
                         walk += strlen("quality");
                 }


added typedef for executable to use

added typedef for executable to use

--- src/problems/100/c/main.c
+++ src/problems/100/c/main.c
@@ -1,4 +1,6 @@
 #include <stdio.h>
+
+typedef int bool;

 #include "TreeNode.h"
 #include "sametree.h"


Increase buffer size to around 24K.

Increase buffer size to around 24K.

--- src/protocols/vnc/pulse.h
+++ src/protocols/vnc/pulse.h
@@ -45,9 +45,9 @@

 /**
  * The minimum number of PCM bytes to wait for before flushing an audio
- * packet.
+ * packet. The current value is 24K, which works out to be around 140ms.
  */
-#define GUAC_VNC_PCM_WRITE_RATE 10240
+#define GUAC_VNC_PCM_WRITE_RATE 24576

 /**
  * Rate of audio to stream, in Hz.


Add some output functions

Add some output functions

--- libi0/stdio.h
+++ libi0/stdio.h
@@ -27,10 +27,14 @@
 #define put2(a,b) {put1(a); put1(b);}
 #define put4(a,b,c,d) {put2(a,b); put2(c,d);}
 #define put8(a,b,c,d,e,f,g,h) {put4(a,b,c,d); put4(e,f,g,h);}
+#define writeln4(a,b,c,d) {put4(a,b,c,d); put1(C_n);}
 #define writeln6(a,b,c,d,e,f) {put4(a,b,c,d); put2(e,f); put1(C_n);}
 #define writelns6(a) {writeln6(a[0],a[1],a[2],a[3],a[4],a[5]);}
 #define writeln3(a,b,c) {put2(a,b); put2(c, C_n);}
 #define writelns4(a) {put4(a[0], a[1], a[2], a[3]); put1(C_n);}
+#define wr5cqn(a,b,c,d,e,q) {put4(a,b,c,d);output_q(q);put1(C_n);}
+#define wr8n(a,b,c,d,e,f,g,h) {put4(a,b,c,d); put4(e,f,g,h);put1(C_n);}
+

 #define putq(a) output_q(a)


* Added revision 4 of money example.

* Added revision 4 of money example.

git-svn-id: d023f1085a36f7a677188d00334e37d38ffecf51@319 64e312b2-a51f-0410-8e61-82d0ca0eb02a

error: pathspec 'doc/example/src/money.4.c' did not match any file(s) known to git

--- doc/example/src/money.4.c
+++ doc/example/src/money.4.c
@@ -0,0 +1,31 @@
+#include <stdlib.h>
+#include "money.h"
+
+struct Money
+{
+  int amount;
+};
+
+Money *
+money_create (int amount, char *currency)
+{
+  return NULL;
+}
+
+int
+money_amount (Money * m)
+{
+  return m->amount;
+}
+
+char *
+money_currency (Money * m)
+{
+  return NULL;
+}
+
+void
+money_free (Money * m)
+{
+  return;
+}


st/egl: Plug pbuffer leaks.

st/egl: Plug pbuffer leaks.

Unreference validated resources or remove unnecessary validations.

--- src/gallium/state_trackers/egl/common/egl_g3d_api.c
+++ src/gallium/state_trackers/egl/common/egl_g3d_api.c
@@ -403,7 +403,6 @@
                                _EGLConfig *conf, const EGLint *attribs)
 {
    struct egl_g3d_surface *gsurf;
-   struct pipe_resource *ptex = NULL;

    gsurf = create_pbuffer_surface(dpy, conf, attribs,
          "eglCreatePbufferSurface");
@@ -411,13 +410,6 @@
       return NULL;

    gsurf->client_buffer_type = EGL_NONE;
-
-   if (!gsurf->stfbi->validate(gsurf->stfbi,
-            &gsurf->stvis.render_buffer, 1, &ptex)) {
-      egl_g3d_destroy_st_framebuffer(gsurf->stfbi);
-      FREE(gsurf);
-      return NULL;
-   }

    return &gsurf->base;
 }
@@ -478,12 +470,14 @@
    gsurf->client_buffer_type = buftype;
    gsurf->client_buffer = buffer;

+   /* validate now so that it fails if the client buffer is invalid */
    if (!gsurf->stfbi->validate(gsurf->stfbi,
             &gsurf->stvis.render_buffer, 1, &ptex)) {
       egl_g3d_destroy_st_framebuffer(gsurf->stfbi);
       FREE(gsurf);
       return NULL;
    }
+   pipe_resource_reference(&ptex, NULL);

    return &gsurf->base;
 }


Don't hide I/O errors behind LockErr

Don't hide I/O errors behind LockErr

Only return a LockErr if there's lock contention, not on unrelated
I/O errors.

--- core/Lucy/Store/Lock.c
+++ core/Lucy/Store/Lock.c
@@ -263,16 +263,14 @@
     String *lock_dir_name = SSTR_WRAP_C("locks");
     if (!Folder_Exists(ivars->folder, lock_dir_name)) {
         if (!Folder_MkDir(ivars->folder, lock_dir_name)) {
-            Err *mkdir_err = (Err*)CERTIFY(Err_get_error(), ERR);
-            LockErr *err = LockErr_new(Str_newf("Can't create 'locks' directory: %o",
-                                                Err_Get_Mess(mkdir_err)));
+            Err *err = (Err*)INCREF(Err_get_error());
             // Maybe our attempt failed because another process succeeded.
             if (Folder_Find_Folder(ivars->folder, lock_dir_name)) {
                 DECREF(err);
             }
             else {
                 // Nope, everything failed, so bail out.
-                Err_set_error((Err*)err);
+                Err_set_error(err);
                 return false;
             }
         }
@@ -302,24 +300,22 @@
     context.outstream = outstream;
     context.json = json;
     Err *json_error = Err_trap(S_write_lockfile_json, &context);
-    bool wrote_json = !json_error;
     DECREF(outstream);
     DECREF(json);
-    if (wrote_json) {
+    if (json_error) {
+        Err_set_error(json_error);
+    }
+    else {
         success = Folder_Hard_Link(ivars->folder, ivars->link_path,
                                    lock_path);
         if (!success) {
+            // TODO: Only return a LockErr if errno == EEXIST, otherwise
+            // return a normal Err.
             Err *hard_link_err = (Err*)CERTIFY(Err_get_error(), ERR);
-            Err_set_error((Err*)LockErr_new(Str_newf("Failed to obtain lock at '%o': %o",
-                                                     lock_path,
-                                                     Err_Get_Mess(hard_link_err))));
-        }
-    }
-    else {
-        Err_set_error((Err*)LockErr_new(Str_newf("Failed to obtain lock at '%o': %o",
-                                                 lock_path,
-                                                 Err_Get_Mess(json_error))));
-        DECREF(json_error);
+            String *msg = Str_newf("Failed to obtain lock at '%o': %o",
+                                   lock_path, Err_Get_Mess(hard_link_err));
+            Err_set_error((Err*)LockErr_new(msg));
+        }
     }

     // Verify that our temporary file got zapped.


adding modena testing

adding modena testing

error: pathspec 'platforms/m3/pre_v9/software/TEST_MODENA_v1/TEST_MODENA_v1.c' did not match any file(s) known to git

--- platforms/m3/pre_v9/software/TEST_MODENA_v1/TEST_MODENA_v1.c
+++ platforms/m3/pre_v9/software/TEST_MODENA_v1/TEST_MODENA_v1.c
@@ -0,0 +1,505 @@
+//****************************************************************************************************
+//Author:       Gyouho Kim
+//				Yejoong Kim
+//              ZhiYoong Foo
+//Description:  For testing Modena
+//				5/27/2015: Revision 1
+//				- Basic functionality without interfacing with FLSv1
+//****************************************************************************************************
+#include "mbus.h"
+#include "PRCv9E.h"
+#include "RADv5.h"
+#include "FLSv1_GPIO.h"
+
+// GPIO Pin Assignment
+#define MOD_DI 		0
+#define MOD_DO 		1
+#define MOD_CLK		2
+#define MOD_RST		4
+#define MOD_SCAN	5
+
+// Stack order  PRC->MD->RAD->HRV
+#define RAD_ADDR 0x5
+
+// Common parameters
+#define	MBUS_DELAY 200 //Amount of delay between successive messages
+#define WAKEUP_DELAY 10000 // 20s
+#define WAKEUP_DELAY_FINAL 5000	// Delay for waiting for internal decaps to stabilize after waking up MDSENSOR
+#define DELAY_1 5000 // 5000: 0.5s
+#define DELAY_IMG 40000 // 1s
+
+#define MOD_GPIO_DELAY 100
+
+// FLSv1 configurations
+#define FLS_RECORD_LENGTH 0x1FFE // In words; # of words stored -2
+#define FLS_RADIO_LENGTH 50 // In words
+
+//#define FLS_RECORD_LENGTH 0x10
+
+// Radio configurations
+#define RAD_BIT_DELAY       14     //40      //0x54    //Radio tuning: Delay between bits sent (16 bits / packet)
+#define RAD_PACKET_DELAY 	2000      //1000    //Radio tuning: Delay between packets sent (3 packets / sample)
+#define RAD_PACKET_NUM      1      //How many times identical data will be TXed
+
+//***************************************************
+// Global variables
+//***************************************************
+	//Test Declerations
+	// "static" limits the variables to this file, giving compiler more freedom
+	// "volatile" should only be used for MMIO
+	static uint32_t enumerated;
+	static uint32_t exec_count;
+	static uint32_t exec_count_irq;
+	static uint32_t MBus_msg_flag;
+
+	static uint32_t WAKEUP_PERIOD_CONT;
+	static uint32_t WAKEUP_PERIOD_CONT_INIT;
+
+	static uint32_t radio_tx_count;
+	static uint32_t radio_tx_option;
+	static uint32_t radio_tx_numdata;
+
+	static uint32_t md_count;
+	static uint8_t md_capture_img;
+	static uint8_t md_start_motion;
+
+//***************************************************
+//Interrupt Handlers
+//Must clear pending bit!
+//***************************************************
+void handler_ext_int_0(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_1(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_2(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_3(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_4(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_5(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_6(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_7(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_8(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_9(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_10(void) __attribute__ ((interrupt ("IRQ")));
+void handler_ext_int_11(void) __attribute__ ((interrupt ("IRQ")));
+
+void handler_ext_int_0(void){
+    *((volatile uint32_t *) 0xE000E280) = 0x1;
+    MBus_msg_flag = 0x10;
+}
+void handler_ext_int_1(void){
+    *((volatile uint32_t *) 0xE000E280) = 0x2;
+    MBus_msg_flag = 0x11;
+}
+void handler_ext_int_2(void){
+    *((volatile uint32_t *) 0xE000E280) = 0x4;
+    MBus_msg_flag = 0x12;
+}
+void handler_ext_int_3(void){
+    *((volatile uint32_t *) 0xE000E280) = 0x8;
+    MBus_msg_flag = 0x13;
+}
+void handler_ext_int_4(void){ *((volatile uint32_t *) 0xE000E280) = 0x10; }
+void handler_ext_int_5(void){ *((volatile uint32_t *) 0xE000E280) = 0x20; }
+void handler_ext_int_6(void){ *((volatile uint32_t *) 0xE000E280) = 0x40; }
+void handler_ext_int_7(void){ *((volatile uint32_t *) 0xE000E280) = 0x80; }
+void handler_ext_int_8(void){ *((volatile uint32_t *) 0xE000E280) = 0x100; }
+void handler_ext_int_9(void){
+	*((volatile uint32_t *) 0xE000E280) = 0x200;
+	*((volatile uint32_t *) 0xA8000000) = 0x0;
+}
+void handler_ext_int_10(void){ *((volatile uint32_t *) 0xE000E280) = 0x400; }
+void handler_ext_int_11(void){ *((volatile uint32_t *) 0xE000E280) = 0x800; }
+
+
+//************************************
+// GPIO Related Functions
+//************************************
+
+void MOD_GPIO_initialization(){
+	// GPIO_DIR = 0 (output) (ex. FLS_CIN, FLS_DIN)
+	//            1 (input) (ex. FLS_COUT, FLS_DOUT)
+	uint32_t gpio_dir = (0x00000000 | (1 << MOD_DO));
+	init_GPIO(gpio_dir);
+}
+
+void MOD_GPIO_reset(){
+	set_GPIO_WRITE(0x00000000);
+	delay(MOD_GPIO_DELAY);
+	set_GPIO_bit(MOD_CLK);
+	delay(MOD_GPIO_DELAY);
+	set_GPIO_bit(MOD_RST);
+	delay(MOD_GPIO_DELAY*2);
+	kill_GPIO_bit(MOD_CLK);
+	delay(MOD_GPIO_DELAY*2);
+	set_GPIO_bit(MOD_CLK);
+	delay(MOD_GPIO_DELAY*2);
+	kill_GPIO_bit(MOD_RST);
+	delay(MOD_GPIO_DELAY*2);
+	kill_GPIO_bit(MOD_CLK);
+	delay(MOD_GPIO_DELAY);
+	delay(MOD_GPIO_DELAY);
+}
+
+void MOD_GPIO_toggle (volatile uint32_t data, volatile uint32_t numBit) {
+	volatile uint32_t i;
+	volatile uint32_t pos = 1 << (numBit - 1);
+
+	for (i=0; i<numBit; i++){
+		if (data & pos) set_GPIO_bit(MOD_DIN);
+		else kill_GPIO_bit(MOD_DIN);
+		delay(MOD_GPIO_DELAY);
+		kill_GPIO_bit(MOD_CLK);
+		delay(MOD_GPIO_DELAY);
+		set_GPIO_bit(MOD_CLK);
+		delay(MOD_GPIO_DELAY);
+		pos = pos >> 1;
+	}
+}
+
+void MOD_GPIO_sof () {
+	// DIN goes high while CLK low, followed by posedge clk
+	kill_GPIO_bit(MOD_CLK);
+	delay(MOD_GPIO_DELAY);
+	set_GPIO_bit(MOD_DIN);
+	delay(MOD_GPIO_DELAY);
+	set_GPIO_bit(MOD_CLK);
+	delay(MOD_GPIO_DELAY);
+}
+
+void MOD_GPIO_eof () {
+	// DIN goes high, negedge clk, then goes low while clk low
+	set_GPIO_bit(MOD_DIN);
+	delay(MOD_GPIO_DELAY);
+	kill_GPIO_bit(MOD_CLK);
+	delay(MOD_GPIO_DELAY);
+	kill_GPIO_bit(MOD_DIN);
+	delay(MOD_GPIO_DELAY);
+}
+
+void MOD_GPIO_ack () {
+	uint32_t i;
+	for (i=0; i<10; i++){
+		if (rxBit){
+			// Acknowledge received
+			MOD_GPIO_toggle(0,1);
+			return;
+		}
+	}
+	// Timed out
+	MOD_GPIO_reset;
+}
+
+void MOD_GPIO_sendMSG (volatile uint32_t data_0) {
+	MOD_GPIO_sof();
+	MOD_GPIO_toggle(data_0,8);
+	MOD_GPIO_ack();
+	MOD_GPIO_eof();
+}
+
+static void operation_modena(void){
+    MOD_GPIO_sendMSG(0x55);
+}
+
+//************************************
+// PMU Related Functions
+//************************************
+inline static void set_pmu_sleep_clk_low(){
+    // PRCv9 Default: 0x8F770049
+    *((volatile uint32_t *) 0xA200000C) = 0x8F770039; // 0x8F770039: use GOC x0.6-2
+}
+inline static void set_pmu_sleep_clk_default(){
+    // PRCv9 Default: 0x8F770049
+    *((volatile uint32_t *) 0xA200000C) = 0x8F770049; // 0x8F770049: use GOC x10-25
+}
+inline static void set_pmu_sleep_clk_fastest(){
+    // PRCv9 Default: 0x8F770049
+    *((volatile uint32_t *) 0xA200000C) = 0x8F770079; // 0x8F770079: use GOC x70-230
+}
+
+//***************************************************
+//Send Radio Data MSB-->LSB
+//Two Delays:
+//Bit Delay: Delay between each bit (16-bit data)
+//Packet Delay: Delay between each packet (3 packets)
+//Delays are nop delays (therefore dependent on core speed)
+//***************************************************
+static void send_radio_data(uint32_t radio_data){
+  int32_t i; //loop var
+  uint32_t j; //loop var
+  for(j=0;j<1;j++){ //Packet Loop
+    for(i=31;i>=0;i--){ //Bit Loop
+      if ((radio_data>>i)&1) write_mbus_register(RAD_ADDR,0x27,0x1);
+      else                   write_mbus_register(RAD_ADDR,0x27,0x0);
+      //Must clear register
+      delay(RAD_BIT_DELAY);
+      write_mbus_register(RAD_ADDR,0x27,0x0);
+      delay(RAD_BIT_DELAY); //Set delay between sending subsequent bit
+    }
+  }
+}
+
+
+//***************************************************
+// End of Program Sleep Operation
+//***************************************************
+static void operation_sleep(void){
+
+  // Reset wakeup counter
+  // This is required to go back to sleep!!
+  //set_wakeup_timer (0xFFF, 0x0, 0x1);
+  *((volatile uint32_t *) 0xA2000014) = 0x1;
+
+  // Reset IRQ10VEC
+  *((volatile uint32_t *) IRQ10VEC/*IMSG0*/) = 0;
+
+  // Go to Sleep
+  sleep();
+  while(1);
+
+}
+
+static void operation_sleep_noirqreset(void){
+
+  // Reset wakeup counter
+  // This is required to go back to sleep!!
+  *((volatile uint32_t *) 0xA2000014) = 0x1;
+
+  // Go to Sleep
+  sleep();
+  while(1);
+
+}
+
+static void operation_sleep_notimer(void){
+
+  // Disable Timer
+  set_wakeup_timer (0, 0x0, 0x0);
+
+	// Reset IRQ10VEC
+  *((volatile uint32_t *) IRQ10VEC/*IMSG0*/) = 0;
+
+  // Go to sleep without timer
+  operation_sleep();
+
+}
+
+static void operation_init(void){
+	volatile uint32_t temp_addr;
+	volatile uint32_t temp_data;
+	volatile uint32_t temp_numBit;
+
+    // Set PMU Strength & division threshold
+    // PMU_CTRL Register
+    // PRCv9 Default: 0x8F770049
+    // Decrease 5x division switching threshold
+	set_pmu_sleep_clk_default();
+
+    // Speed up GOC frontend to match PMU frequency
+	// Speed up MBUS
+	// GOC_CTRL Register
+    // PRCv9 Default: 0x00202903
+	//*((volatile uint32_t *) 0xA2000008) = 0x00202608;
+
+	// For PREv9E GPIO Isolation disable >> bits 16, 17, 24
+	*((volatile uint32_t *) 0xA2000008) = 0x0120E608;
+
+
+    delay(DELAY_1);
+
+    //Enumerate & Initialize Registers
+    enumerated = 0xDEADBEEE;
+    exec_count = 0;
+    exec_count_irq = 0;
+    MBus_msg_flag = 0;
+    //Enumeration
+    enumerate(RAD_ADDR);
+    delay(MBUS_DELAY*2);
+
+	// Initialize FLSv1 through GPIO
+	FLSMBusGPIO_initialization();
+	FLSMBusGPIO_forceStop();
+	FLSMBusGPIO_enumeration(FLS_ADDR);
+	FLSMBusGPIO_enumeration(FLS_ADDR);
+	temp_numBit = FLSMBusGPIO_rxMsg();
+	temp_addr = FLSMBusGPIO_getRxAddr(); // Optional
+	temp_data = FLSMBusGPIO_getRxData0(); // Optional
+	write_mbus_message(0xEE, temp_addr); // Optional
+	write_mbus_message(0xEE, temp_data); // Optional
+	write_mbus_message(0xEE, temp_numBit); // Optional
+
+	// Set Optimum Tuning Bits
+	FLSMBusGPIO_setOptTune(FLS_ADDR);
+
+	// Receive Sleep Msg
+	temp_numBit = FLSMBusGPIO_rxMsg();
+	temp_addr = FLSMBusGPIO_getRxAddr(); // Optional
+	temp_data = FLSMBusGPIO_getRxData0(); // Optional
+	write_mbus_message(0xEE, temp_addr); // Optional
+	write_mbus_message(0xEE, temp_data); // Optional
+	write_mbus_message(0xEE, temp_numBit); // Optional
+
+	delay (1000);
+
+    // Initialize other global variables
+    WAKEUP_PERIOD_CONT = 100;   // 1: 2-4 sec with PRCv9
+    WAKEUP_PERIOD_CONT_INIT = 1;   // 0x1E (30): ~1 min with PRCv9
+    radio_tx_count = 0;
+    radio_tx_option = 0;
+
+	md_start_motion = 0;
+	md_capture_img = 0;
+	md_count = 0;
+
+	INT_TIME = 5;
+	MD_INT_TIME = 15;
+
+	// Put FLS back to sleep
+	FLSMBusGPIO_sleep();
+
+    // Go to sleep without timer
+    operation_sleep_notimer();
+}
+
+//***************************************************************************************
+// MAIN function starts here
+//***************************************************************************************
+int main() {
+
+    //Clear All Pending Interrupts
+    *((volatile uint32_t *) 0xE000E280) = 0xF;
+    //Enable Interrupts
+    *((volatile uint32_t *) 0xE000E100) = 0xF;
+
+	// Config watchdog timer to about 30 sec: 3,000,000 with default PRCv9
+	//config_timer( timer_id, go, roi, init_val, sat_val )
+	config_timer( 0, 0, 0, 0, 3000000 );
+
+    // Initialization sequence
+    if (enumerated != 0xDEADBEEE){
+        operation_init();
+    }
+
+    // Check if wakeup is due to GOC interrupt
+    // 0x68 is reserved for GOC-triggered wakeup (Named IRQ10VEC)
+    // 8 MSB bits of the wakeup data are used for function ID
+    uint32_t wakeup_data = *((volatile uint32_t *) IRQ10VEC);
+    uint32_t wakeup_data_header = wakeup_data>>24;
+    uint32_t wakeup_data_field_0 = wakeup_data & 0xFF;
+    uint32_t wakeup_data_field_1 = wakeup_data>>8 & 0xFF;
+    uint32_t wakeup_data_field_2 = wakeup_data>>16 & 0xFF;
+
+    if(wakeup_data_header == 1){
+        // Debug mode: Transmit something via radio and go to sleep w/o timer
+        // wakeup_data[7:0] is the # of transmissions
+        // wakeup_data[15:8] is the user-specified period
+        WAKEUP_PERIOD_CONT_INIT = wakeup_data_field_1;
+        delay(MBUS_DELAY);
+        if (exec_count_irq < wakeup_data_field_0){
+            exec_count_irq++;
+            // radio
+            send_radio_data(0xFAFA0000+exec_count_irq);
+            // set timer
+            set_wakeup_timer (WAKEUP_PERIOD_CONT_INIT, 0x1, 0x0);
+            // go to sleep and wake up with same condition
+            operation_sleep_noirqreset();
+
+        }else{
+            exec_count_irq = 0;
+            // radio
+            send_radio_data(0xFAFA0000+exec_count_irq);
+            // Go to sleep without timer
+            operation_sleep_notimer();
+        }
+
+    }else if(wakeup_data_header == 2){
+		// Start motion detection
+        // wakeup_data[7:0] is the md integration period
+        // wakeup_data[15:8] is the img integration period
+        // wakeup_data[19:16] indicates whether or not to to take an image
+		// 						1: md only, 2: img only, 3: md+img
+        // wakeup_data[23:20] indicates whether or not to radio out the result
+
+		MD_INT_TIME = wakeup_data_field_0;
+		INT_TIME = wakeup_data_field_1;
+
+        if (exec_count_irq < 1){
+            exec_count_irq++;
+            // radio
+            send_radio_data(0xFAFA0000+(wakeup_data_field_2 & 0xF));
+            // set timer
+            set_wakeup_timer (WAKEUP_PERIOD_CONT_INIT, 0x1, 0x0);
+            // go to sleep and wake up with same condition
+            operation_sleep_noirqreset();
+
+        }else{
+            exec_count_irq = 0;
+			// Reset IRQ10VEC
+			*((volatile uint32_t *) IRQ10VEC) = 0;
+
+			// Run Program
+			exec_count = 0;
+			md_count = 0;
+			md_start_motion = (wakeup_data_field_2 & 0x1);
+			md_capture_img = (wakeup_data_field_2 & 0x2)>>1;
+			radio_tx_option = (wakeup_data_field_2 >> 4) & 0x1;
+			operation_md();
+        }
+
+    }else if(wakeup_data_header == 3){
+		// Stop MD program and transmit the execution count n times
+        // wakeup_data[7:0] is the # of transmissions
+        // wakeup_data[15:8] is the user-specified period
+        WAKEUP_PERIOD_CONT_INIT = wakeup_data_field_1;
+
+		clear_md_flag();
+		initialize_md_reg();
+        set_pmu_sleep_clk_default();
+		md_start_motion = 0;
+		md_capture_img = 0;
+
+        if (exec_count_irq < wakeup_data_field_0){
+            exec_count_irq++;
+            // radio
+            send_radio_data(0xFAFA0000+md_count);
+            // set timer
+            set_wakeup_timer (WAKEUP_PERIOD_CONT_INIT, 0x1, 0x0);
+            // go to sleep and wake up with same condition
+            operation_sleep_noirqreset();
+
+        }else{
+            exec_count_irq = 0;
+            // Go to sleep without timer
+            operation_sleep_notimer();
+        }
+
+
+
+    }else if(wakeup_data_header == 4){
+
+    }else if(wakeup_data_header == 0x11){
+		// Slow down PMU sleep osc and go to sleep for further programming
+        set_pmu_sleep_clk_low();
+        // Go to sleep without timer
+        operation_sleep_notimer();
+
+    }else if(wakeup_data_header == 0x12){
+		// Restore PMU sleep osc and go to sleep for further programming
+        set_pmu_sleep_clk_default();
+        // Go to sleep without timer
+        operation_sleep_notimer();
+
+    }else if(wakeup_data_header == 0x13){
+        set_pmu_sleep_clk_fastest();
+        // Go to sleep without timer
+        operation_sleep_notimer();
+    }
+
+    // Proceed to continuous mode
+    while(1){
+        operation_modena();
+    }
+
+    // Should not reach here
+    operation_sleep_notimer();
+
+    while(1);
+}
+


Added missing inline definition for MSCV and ARM environments

--- library/ecp.c
+++ library/ecp.c
@@ -58,6 +58,14 @@

 #include <limits.h>
 #include <stdlib.h>
+
+#if defined(_MSC_VER) && !defined(inline)
+#define inline _inline
+#else
+#if defined(__ARMCC_VERSION) && !defined(inline)
+#define inline __inline
+#endif /* __ARMCC_VERSION */
+#endif /*_MSC_VER */

 #if defined(POLARSSL_SELF_TEST)
 /*


Remove "internal RNG" code from ECP

Remove "internal RNG" code from ECP

This is no longer needed, as the RNG param is now mandatory.

Signed-off-by: Manuel Pégourié-Gonnard <4ba0d615aeeda88e422ca8fba28fe2938485facf@arm.com>

--- library/ecp.c
+++ library/ecp.c
@@ -101,16 +101,6 @@

 #include "ecp_internal_alt.h"

-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-#if defined(MBEDTLS_HMAC_DRBG_C)
-#include "mbedtls/hmac_drbg.h"
-#elif defined(MBEDTLS_CTR_DRBG_C)
-#include "mbedtls/ctr_drbg.h"
-#else
-#error "Invalid configuration detected. Include check_config.h to ensure that the configuration is valid."
-#endif
-#endif /* MBEDTLS_ECP_NO_INTERNAL_RNG */
-
 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
     !defined(inline) && !defined(__cplusplus)
 #define inline __inline
@@ -123,144 +113,6 @@
  */
 static unsigned long add_count, dbl_count, mul_count;
 #endif
-
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-/*
- * Currently ecp_mul() takes a RNG function as an argument, used for
- * side-channel protection, but it can be NULL. The initial reasoning was
- * that people will pass non-NULL RNG when they care about side-channels, but
- * unfortunately we have some APIs that call ecp_mul() with a NULL RNG, with
- * no opportunity for the user to do anything about it.
- *
- * The obvious strategies for addressing that include:
- * - change those APIs so that they take RNG arguments;
- * - require a global RNG to be available to all crypto modules.
- *
- * Unfortunately those would break compatibility. So what we do instead is
- * have our own internal DRBG instance, seeded from the secret scalar.
- *
- * The following is a light-weight abstraction layer for doing that with
- * HMAC_DRBG (first choice) or CTR_DRBG.
- */
-
-#if defined(MBEDTLS_HMAC_DRBG_C)
-
-/* DRBG context type */
-typedef mbedtls_hmac_drbg_context ecp_drbg_context;
-
-/* DRBG context init */
-static inline void ecp_drbg_init( ecp_drbg_context *ctx )
-{
-    mbedtls_hmac_drbg_init( ctx );
-}
-
-/* DRBG context free */
-static inline void ecp_drbg_free( ecp_drbg_context *ctx )
-{
-    mbedtls_hmac_drbg_free( ctx );
-}
-
-/* DRBG function */
-static inline int ecp_drbg_random( void *p_rng,
-                                   unsigned char *output, size_t output_len )
-{
-    return( mbedtls_hmac_drbg_random( p_rng, output, output_len ) );
-}
-
-/* DRBG context seeding */
-static int ecp_drbg_seed( ecp_drbg_context *ctx,
-                   const mbedtls_mpi *secret, size_t secret_len )
-{
-    int ret;
-    unsigned char secret_bytes[MBEDTLS_ECP_MAX_BYTES];
-    /* The list starts with strong hashes */
-    const mbedtls_md_type_t md_type = mbedtls_md_list()[0];
-    const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( md_type );
-
-    if( secret_len > MBEDTLS_ECP_MAX_BYTES )
-    {
-        ret = MBEDTLS_ERR_ECP_RANDOM_FAILED;
-        goto cleanup;
-    }
-
-    MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( secret,
-                                               secret_bytes, secret_len ) );
-
-    ret = mbedtls_hmac_drbg_seed_buf( ctx, md_info, secret_bytes, secret_len );
-
-cleanup:
-    mbedtls_platform_zeroize( secret_bytes, secret_len );
-
-    return( ret );
-}
-
-#elif defined(MBEDTLS_CTR_DRBG_C)
-
-/* DRBG context type */
-typedef mbedtls_ctr_drbg_context ecp_drbg_context;
-
-/* DRBG context init */
-static inline void ecp_drbg_init( ecp_drbg_context *ctx )
-{
-    mbedtls_ctr_drbg_init( ctx );
-}
-
-/* DRBG context free */
-static inline void ecp_drbg_free( ecp_drbg_context *ctx )
-{
-    mbedtls_ctr_drbg_free( ctx );
-}
-
-/* DRBG function */
-static inline int ecp_drbg_random( void *p_rng,
-                                   unsigned char *output, size_t output_len )
-{
-    return( mbedtls_ctr_drbg_random( p_rng, output, output_len ) );
-}
-
-/*
- * Since CTR_DRBG doesn't have a seed_buf() function the way HMAC_DRBG does,
- * we need to pass an entropy function when seeding. So we use a dummy
- * function for that, and pass the actual entropy as customisation string.
- * (During seeding of CTR_DRBG the entropy input and customisation string are
- * concatenated before being used to update the secret state.)
- */
-static int ecp_ctr_drbg_null_entropy(void *ctx, unsigned char *out, size_t len)
-{
-    (void) ctx;
-    memset( out, 0, len );
-    return( 0 );
-}
-
-/* DRBG context seeding */
-static int ecp_drbg_seed( ecp_drbg_context *ctx,
-                   const mbedtls_mpi *secret, size_t secret_len )
-{
-    int ret;
-    unsigned char secret_bytes[MBEDTLS_ECP_MAX_BYTES];
-
-    if( secret_len > MBEDTLS_ECP_MAX_BYTES )
-    {
-        ret = MBEDTLS_ERR_ECP_RANDOM_FAILED;
-        goto cleanup;
-    }
-
-    MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( secret,
-                                               secret_bytes, secret_len ) );
-
-    ret = mbedtls_ctr_drbg_seed( ctx, ecp_ctr_drbg_null_entropy, NULL,
-                                 secret_bytes, secret_len );
-
-cleanup:
-    mbedtls_platform_zeroize( secret_bytes, secret_len );
-
-    return( ret );
-}
-
-#else
-#error "Invalid configuration detected. Include check_config.h to ensure that the configuration is valid."
-#endif /* DRBG modules */
-#endif /* MBEDTLS_ECP_NO_INTERNAL_RNG */

 #if defined(MBEDTLS_ECP_RESTARTABLE)
 /*
@@ -309,10 +161,6 @@
         ecp_rsm_comb_core,      /* ecp_mul_comb_core()                      */
         ecp_rsm_final_norm,     /* do the final normalization               */
     } state;
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-    ecp_drbg_context drbg_ctx;
-    unsigned char drbg_seeded;
-#endif
 };

 /*
@@ -325,10 +173,6 @@
     ctx->T = NULL;
     ctx->T_size = 0;
     ctx->state = ecp_rsm_init;
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-    ecp_drbg_init( &ctx->drbg_ctx );
-    ctx->drbg_seeded = 0;
-#endif
 }

 /*
@@ -349,10 +193,6 @@
             mbedtls_ecp_point_free( ctx->T + i );
         mbedtls_free( ctx->T );
     }
-
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-    ecp_drbg_free( &ctx->drbg_ctx );
-#endif

     ecp_restart_rsm_init( ctx );
 }
@@ -2068,9 +1908,7 @@
         i = d;
         MBEDTLS_MPI_CHK( ecp_select_comb( grp, R, T, T_size, x[i] ) );
         MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &R->Z, 1 ) );
-#if defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
         if( f_rng != 0 )
-#endif
             MBEDTLS_MPI_CHK( ecp_randomize_jac( grp, R, f_rng, p_rng ) );
     }

@@ -2204,9 +2042,7 @@
      *
      * Avoid the leak by randomizing coordinates before we normalize them.
      */
-#if defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
     if( f_rng != 0 )
-#endif
         MBEDTLS_MPI_CHK( ecp_randomize_jac( grp, RR, f_rng, p_rng ) );

     MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, RR ) );
@@ -2286,41 +2122,8 @@
     size_t d;
     unsigned char T_size = 0, T_ok = 0;
     mbedtls_ecp_point *T = NULL;
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-    ecp_drbg_context drbg_ctx;
-
-    ecp_drbg_init( &drbg_ctx );
-#endif

     ECP_RS_ENTER( rsm );
-
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-    if( f_rng == NULL )
-    {
-        /* Adjust pointers */
-        f_rng = &ecp_drbg_random;
-#if defined(MBEDTLS_ECP_RESTARTABLE)
-        if( rs_ctx != NULL && rs_ctx->rsm != NULL )
-            p_rng = &rs_ctx->rsm->drbg_ctx;
-        else
-#endif
-            p_rng = &drbg_ctx;
-
-        /* Initialize internal DRBG if necessary */
-#if defined(MBEDTLS_ECP_RESTARTABLE)
-        if( rs_ctx == NULL || rs_ctx->rsm == NULL ||
-            rs_ctx->rsm->drbg_seeded == 0 )
-#endif
-        {
-            const size_t m_len = ( grp->nbits + 7 ) / 8;
-            MBEDTLS_MPI_CHK( ecp_drbg_seed( p_rng, m, m_len ) );
-        }
-#if defined(MBEDTLS_ECP_RESTARTABLE)
-        if( rs_ctx != NULL && rs_ctx->rsm != NULL )
-            rs_ctx->rsm->drbg_seeded = 1;
-#endif
-    }
-#endif /* !MBEDTLS_ECP_NO_INTERNAL_RNG */

     /* Is P the base point ? */
 #if MBEDTLS_ECP_FIXED_POINT_OPTIM == 1
@@ -2392,10 +2195,6 @@
                                                  f_rng, p_rng, rs_ctx ) );

 cleanup:
-
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-    ecp_drbg_free( &drbg_ctx );
-#endif

     /* does T belong to the group? */
     if( T == grp->T )
@@ -2583,22 +2382,7 @@
     unsigned char b;
     mbedtls_ecp_point RP;
     mbedtls_mpi PX;
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-    ecp_drbg_context drbg_ctx;
-
-    ecp_drbg_init( &drbg_ctx );
-#endif
     mbedtls_ecp_point_init( &RP ); mbedtls_mpi_init( &PX );
-
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-    if( f_rng == NULL )
-    {
-        const size_t m_len = ( grp->nbits + 7 ) / 8;
-        MBEDTLS_MPI_CHK( ecp_drbg_seed( &drbg_ctx, m, m_len ) );
-        f_rng = &ecp_drbg_random;
-        p_rng = &drbg_ctx;
-    }
-#endif /* !MBEDTLS_ECP_NO_INTERNAL_RNG */

     /* Save PX and read from P before writing to R, in case P == R */
     MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &PX, &P->X ) );
@@ -2613,9 +2397,7 @@
     MOD_ADD( RP.X );

     /* Randomize coordinates of the starting point */
-#if defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
     if( f_rng != NULL )
-#endif
         MBEDTLS_MPI_CHK( ecp_randomize_mxz( grp, &RP, f_rng, p_rng ) );

     /* Loop invariant: R = result so far, RP = R + P */
@@ -2648,18 +2430,12 @@
      *
      * Avoid the leak by randomizing coordinates before we normalize them.
      */
-#if defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
     if( f_rng != NULL )
-#endif
         MBEDTLS_MPI_CHK( ecp_randomize_mxz( grp, R, f_rng, p_rng ) );

     MBEDTLS_MPI_CHK( ecp_normalize_mxz( grp, R ) );

 cleanup:
-#if !defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
-    ecp_drbg_free( &drbg_ctx );
-#endif
-
     mbedtls_ecp_point_free( &RP ); mbedtls_mpi_free( &PX );

     return( ret );


Added comments.

Added comments.

git-svn-id: 6d5d0d0362179181a2785cceb38b76f62e64641d@470 5dfbf39a-1452-0410-8a97-9e58fedde8e3

--- Diminuto/inc/com/diag/diminuto/diminuto_barrier.h
+++ Diminuto/inc/com/diag/diminuto/diminuto_barrier.h
@@ -15,6 +15,11 @@
 #if defined(__GNUC__)
 #   if defined(__GNUC_MINOR__)
 #       if ((((__GNUC__)*1000)+(__GNUC_MINOR__))>=4001)
+            /**
+             * @def diminuto_barrier()
+             * Use a gcc built-in function (if it exists) to create a full
+             * memory barrier.
+             */
 #           define diminuto_barrier() __sync_synchronize()
 #       endif
 #   endif
@@ -28,7 +33,12 @@
 #if defined(__GNUC__)
 #   if defined(__GNUC_MINOR__)
 #       if ((((__GNUC__)*1000)+(__GNUC_MINOR__))>=4001)
-#           define diminuto_acquire() do { int _diminuto_acquire_lock_; __sync_lock_test_and_set(&_diminuto_acquire_lock_, 1); } while (0)
+            /**
+             * @def diminuto_acquire()
+             * Use a gcc built-in function (if it exists) to create a read
+             * (acquire) memory barrier as a side effect.
+             */
+#           define diminuto_acquire() do { int _diminuto_acquire_lock_ = 0; __sync_lock_test_and_set(&_diminuto_acquire_lock_, 1); } while (0)
 #       endif
 #   endif
 #endif
@@ -41,6 +51,11 @@
 #if defined(__GNUC__)
 #   if defined(__GNUC_MINOR__)
 #       if ((((__GNUC__)*1000)+(__GNUC_MINOR__))>=4001)
+            /**
+             * @def diminuto_release()
+             * Use a gcc built-in function (if it exists) to create a write
+             * (release) memory barrier as a side effect.
+             */
 #           define diminuto_release() do { int _diminuto_release_lock_ = 1; __sync_lock_release(&_diminuto_release_lock_); } while (0)
 #       endif
 #   endif


added QName types

added QName types

--- types/qname.h
+++ types/qname.h
@@ -16,28 +16,44 @@

 class QName : public rcobject
 {
+public:
+	enum qname_type_t {
+		qn_attr,	// attribute name
+		qn_elem,	// element name
+		qn_type,	// type name
+		qn_func,	// function name
+		qn_optn,	// prolog option name
+		qn_prag		// pragma label
+	};
+
 protected:
 	std::string prefix;
 	std::string name;

 public:
 	QName(
+		enum qname_type_t _type,
 		std::string const& _prefix,
 		std::string const& _name)
 	:
+		type(_type),
 		prefix(_prefix),
 		name(_name)
 	{ }

 	QName(
+		enum qname_type_t _type,
 		std::string const& _name)
 	:
+		type(_type),
 		prefix(""),
 		name(_name)
 	{ }

-	QName()
+	QName(
+		enum qname_type_t _type)
 	:
+		type(_type),
 		prefix(""),
 		name("")
 	{ }
@@ -45,6 +61,7 @@
 	~QName() {}

 public:
+	enum qname_type_t type;
 	std::string get_prefix() const { return prefix; }
 	std::string get_name() const { return name; }


[1] Comments. TESTED

[1] Comments. TESTED

--- Diminuto/inc/com/diag/diminuto/diminuto_cxxcapi.h
+++ Diminuto/inc/com/diag/diminuto/diminuto_cxxcapi.h
@@ -13,8 +13,19 @@
  * The CXXCAPI provides tools to make it easier for C and C++
  * applications to interoperate, and for inline functions and
  * macros to be included in either C or C++ translations units.
+ * (CXXCAPI is pronounced "sexy API".) You can use CXXCAPI to
+ * integrate new C++ code with legacy C code bases, or vice versa.
+ * For example, you can use it to integrate Diminuto itself into
+ * an existing C++ code base. CXXCAPI allows you to pass pointers
+ * to C++ objects into C code in a type safe manner, then pass
+ * them back, and to call functions written one language in the
+ * other. See the [Tt]hing* files in the sav directory for an example
+ * of how this works.
  *
- * Originally developed for the Digital Aggregates Grandote C++ framework.
+ * CXXCAPI was originally developed for the Digital Aggregates
+ * Desperado project, starting as far back as 2005. A subset of
+ * Desperado, including CXXCAPI, eventually became the Digital
+ * Aggregates Grandote project.
  *
  * This header file can included from both C++ and C translation units.
  */


Disable 3pX4 kernel on Altivec: despite this platform has 32 registers, this version seems significantly slower.

--- Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -188,7 +188,7 @@
     nr = 4,

     // register block size along the M direction (currently, this one cannot be modified)
-#ifdef EIGEN_HAS_FUSED_MADD
+#if defined(EIGEN_HAS_FUSED_MADD) && !defined(EIGEN_VECTORIZE_ALTIVEC)
     // we assume 16 registers
     mr = 3*LhsPacketSize,
 #else
@@ -296,7 +296,7 @@

     NumberOfRegisters = EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS,
     nr = 4,
-#ifdef EIGEN_HAS_FUSED_MADD
+#if defined(EIGEN_HAS_FUSED_MADD) && !defined(EIGEN_VECTORIZE_ALTIVEC)
     // we assume 16 registers
     mr = 3*LhsPacketSize,
 #else
@@ -759,29 +759,29 @@
           for(Index k=0; k<peeled_kc; k+=pk)
           {
             EIGEN_ASM_COMMENT("begin gegp micro kernel 3p x 4");
-            RhsPacket B_0;
+            RhsPacket B_0, T0;
             LhsPacket A2;
-
+
 #define EIGEN_GEBGP_ONESTEP(K) \
             internal::prefetch(blA+(3*K+16)*LhsProgress); \
             traits.loadLhs(&blA[(0+3*K)*LhsProgress], A0);  \
             traits.loadLhs(&blA[(1+3*K)*LhsProgress], A1);  \
             traits.loadLhs(&blA[(2+3*K)*LhsProgress], A2);  \
             traits.loadRhs(&blB[(0+4*K)*RhsProgress], B_0); \
-            traits.madd(A0, B_0, C0, B_0); \
-            traits.madd(A1, B_0, C4, B_0); \
+            traits.madd(A0, B_0, C0, T0); \
+            traits.madd(A1, B_0, C4, T0); \
             traits.madd(A2, B_0, C8, B_0); \
             traits.loadRhs(&blB[1+4*K*RhsProgress], B_0); \
-            traits.madd(A0, B_0, C1, B_0); \
-            traits.madd(A1, B_0, C5, B_0); \
+            traits.madd(A0, B_0, C1, T0); \
+            traits.madd(A1, B_0, C5, T0); \
             traits.madd(A2, B_0, C9, B_0); \
             traits.loadRhs(&blB[2+4*K*RhsProgress], B_0); \
-            traits.madd(A0, B_0, C2,  B_0); \
-            traits.madd(A1, B_0, C6,  B_0); \
+            traits.madd(A0, B_0, C2,  T0); \
+            traits.madd(A1, B_0, C6,  T0); \
             traits.madd(A2, B_0, C10, B_0); \
             traits.loadRhs(&blB[3+4*K*RhsProgress], B_0); \
-            traits.madd(A0, B_0, C3 , B_0); \
-            traits.madd(A1, B_0, C7,  B_0); \
+            traits.madd(A0, B_0, C3 , T0); \
+            traits.madd(A1, B_0, C7,  T0); \
             traits.madd(A2, B_0, C11, B_0)

             internal::prefetch(blB+(48+0));
@@ -802,7 +802,7 @@
           // process remaining peeled loop
           for(Index k=peeled_kc; k<depth; k++)
           {
-            RhsPacket B_0;
+            RhsPacket B_0, T0;
             LhsPacket A2;
             EIGEN_GEBGP_ONESTEP(0);
             blB += 4*RhsProgress;


fwd declare again

fwd declare again

--- core/src/labels/labels.h
+++ core/src/labels/labels.h
@@ -7,7 +7,6 @@
 #include "data/properties.h"
 #include "isect2d.h"
 #include "glm_vec.h" // for isect2d.h
-#include "tangram.h"

 #include <memory>
 #include <mutex>
@@ -20,6 +19,7 @@
 class Tile;
 class View;
 class Style;
+struct TouchItem;

 /*
  * Singleton class containing all labels