Fixing indentation in parcels.h

Fixing indentation in parcels.h

--- parcels/include/parcels.h
+++ parcels/include/parcels.h
@@ -735,24 +735,24 @@
     if (grid->zdim==1){
       float data2D_U[2][2][2], data2D_V[2][2][2];
       if (gridindexingtype == NEMO) {
-          status = getCell2D(U, xi[igrid], yi[igrid], ti[igrid], data2D_U, 1); CHECKSTATUS(status);
-          status = getCell2D(V, xi[igrid], yi[igrid], ti[igrid], data2D_V, 1); CHECKSTATUS(status);
+        status = getCell2D(U, xi[igrid], yi[igrid], ti[igrid], data2D_U, 1); CHECKSTATUS(status);
+        status = getCell2D(V, xi[igrid], yi[igrid], ti[igrid], data2D_V, 1); CHECKSTATUS(status);
       }
       else if (gridindexingtype == MITGCM) {
-          status = getCell2D(U, xi[igrid], yi[igrid]-1, ti[igrid], data2D_U, 1); CHECKSTATUS(status);
-          status = getCell2D(V, xi[igrid]-1, yi[igrid], ti[igrid], data2D_V, 1); CHECKSTATUS(status);
+        status = getCell2D(U, xi[igrid], yi[igrid]-1, ti[igrid], data2D_U, 1); CHECKSTATUS(status);
+        status = getCell2D(V, xi[igrid]-1, yi[igrid], ti[igrid], data2D_V, 1); CHECKSTATUS(status);
       }
       status = spatial_interpolation_UV_c_grid(xsi, eta, xi[igrid], yi[igrid], grid, gcode, data2D_U[0], data2D_V[0], u, v); CHECKSTATUS(status);
     }
     else{
       float data3D_U[2][2][2][2], data3D_V[2][2][2][2];
       if (gridindexingtype == NEMO) {
-          status = getCell3D(U, xi[igrid], yi[igrid], zi[igrid], ti[igrid], data3D_U, 1); CHECKSTATUS(status);
-          status = getCell3D(V, xi[igrid], yi[igrid], zi[igrid], ti[igrid], data3D_V, 1); CHECKSTATUS(status);
+        status = getCell3D(U, xi[igrid], yi[igrid], zi[igrid], ti[igrid], data3D_U, 1); CHECKSTATUS(status);
+        status = getCell3D(V, xi[igrid], yi[igrid], zi[igrid], ti[igrid], data3D_V, 1); CHECKSTATUS(status);
       }
       else if (gridindexingtype == MITGCM){
-          status = getCell3D(U, xi[igrid], yi[igrid]-1, zi[igrid], ti[igrid], data3D_U, 1); CHECKSTATUS(status);
-          status = getCell3D(V, xi[igrid]-1, yi[igrid], zi[igrid], ti[igrid], data3D_V, 1); CHECKSTATUS(status);
+        status = getCell3D(U, xi[igrid], yi[igrid]-1, zi[igrid], ti[igrid], data3D_U, 1); CHECKSTATUS(status);
+        status = getCell3D(V, xi[igrid]-1, yi[igrid], zi[igrid], ti[igrid], data3D_V, 1); CHECKSTATUS(status);
       }
       status = spatial_interpolation_UV_c_grid(xsi, eta, xi[igrid], yi[igrid], grid, gcode, data3D_U[0][0], data3D_V[0][0], u, v); CHECKSTATUS(status);
     }


fix warning

fix warning

--- hdhomerun_sock_windows.c
+++ hdhomerun_sock_windows.c
@@ -335,7 +335,7 @@
 	return true;
 }

-bool hdhomerun_sock_event_select(struct hdhomerun_sock_t *sock, long events)
+static bool hdhomerun_sock_event_select(struct hdhomerun_sock_t *sock, long events)
 {
 	if (sock->events_selected != events) {
 		if (WSAEventSelect(sock->sock, sock->event, events) == SOCKET_ERROR) {


Update the copyright notice

Update the copyright notice

--- src/editor.c
+++ src/editor.c
@@ -1,6 +1,6 @@
 /* $Id$ */
 static char const _copyright[] =
-"Copyright © 2006-2018 Pierre Pronchery <khorben@defora.org>";
+"Copyright © 2006-2020 Pierre Pronchery <khorben@defora.org>";
 /* This file is part of DeforaOS Desktop Editor */
 static char const _license[] =
 "All rights reserved.\n"


autogenerated commit

autogenerated commit

--- rdp/netconfig.c
+++ rdp/netconfig.c
@@ -172,9 +172,7 @@
     timeout.tv_usec = timeout_milli * 1000;

     // Wait on select
-    rdp_log("on select");
     select_result = select(source_socket + 1, &read_fds, NULL, NULL, &timeout);
-    rdp_log("off select");

     // Check result
     switch(select_result) {


Don't check corner level 3 MVs.

Don't check corner level 3 MVs.

This bug never triggered since the encoder is careful to set these
corner level 3 MV flags to invalid. We were erroneously looking at them
even though they were always invalid and would have coded a tristate and
perhaps peeked outside the grid to do so.

Spotted by Tim during review of https://review.xiph.org/451/

--- src/encode.c
+++ src/encode.c
@@ -1053,19 +1053,23 @@
           OD_ASSERT(mvp->valid && !mvp->mv[0] && !mvp->mv[1]
            && !other->valid);
         }
-        else if (!(vy & 2) && grid[vy + 1][vx == 1 ? vx - 1 : vx + 1].valid) {
-          int s;
+        else if (vy > 3 && vy < nvmvbs - 3) {
           other = &grid[vy + 2][vx];
-          s = mvp->valid && other->valid ? 0 : mvp->valid
-           + (other->valid << 1);
-          od_ec_encode_cdf_q15(&enc->ec, s, OD_UNIFORM_CDF_Q15(3), 3);
-          /*MVs are valid but will be zero.*/
-          OD_ASSERT((mvp->valid && !mvp->mv[0] && !mvp->mv[1])
-           || (other->valid && !other->mv[0] && !other->mv[1]));
-        }
-        else if (!(vy & 2)) {
-          other = &grid[vy == 3 ? vy - 2 : vy + 2][vx];
-          OD_ASSERT(!mvp->valid && !other->valid);
+          if (!(vy & 2) && grid[vy + 1][vx == 1 ? vx - 1 : vx + 1].valid) {
+            int s;
+            s = mvp->valid && other->valid ? 0 : mvp->valid
+             + (other->valid << 1);
+            od_ec_encode_cdf_q15(&enc->ec, s, OD_UNIFORM_CDF_Q15(3), 3);
+            /*MVs are valid but will be zero.*/
+            OD_ASSERT((mvp->valid && !mvp->mv[0] && !mvp->mv[1])
+             || (other->valid && !other->mv[0] && !other->mv[1]));
+          }
+          else if (!(vy & 2)) {
+            OD_ASSERT(!mvp->valid && !other->valid);
+          }
+        }
+        else {
+          OD_ASSERT(!mvp_valid);
         }
       }
       else if (grid[vy - 1][vx - 1].valid && grid[vy - 1][vx + 1].valid


pk: Split pk_options[] bitmap into per-mode table

- Split up pk_options table, which was getting difficult to maintain.
pk_options[] now only has information common to all modes, like option names
and parameters, and each mode has its own additional table listing the
options that are supported in that mode (and which of those options are
required).

- Reorder definitions in cmdline.c

--- parcelkeeper/cmdline.c
+++ parcelkeeper/cmdline.c
@@ -14,33 +14,13 @@
 #include <stdlib.h>
 #include "defs.h"

-struct pk_mode {
-	char *name;
-	enum mode type;
-	char *desc;
-};
-
-static struct pk_mode pk_modes[] = {
-	{"run",       MODE_RUN,     "Bind and service a virtual disk"},
-	{"upload",    MODE_UPLOAD,  "Split a cache file into individual chunks for upload"},
-	{"hoard",     MODE_HOARD,   "Download all chunks into hoard cache"},
-	{"examine",   MODE_EXAMINE, "Print cache statistics"},
-	{"validate",  MODE_VALIDATE,"Validate cache against keyring"},
-	{"help",      MODE_HELP,    "Show usage summary"},
-	{"version",   MODE_VERSION, "Show version information"},
-	{0}
-};
+#define MAXPARAMS 4

 enum arg_type {
 	REQUIRED,
 	OPTIONAL,
 	ANY,  /* any number permitted, including zero */
 };
-
-#define MAXPARAMS 4
-static char *optparams[MAXPARAMS];
-static char *progname;
-static struct pk_mode *curmode;

 enum option {
 	OPT_USER,
@@ -54,42 +34,149 @@
 	OPT_LOG,
 	OPT_FOREGROUND,
 	OPT_MODE,
+	END_OPTS = -1
 };

 struct pk_option {
 	char *name;
 	enum option opt;
-	enum arg_type type;
-	unsigned mask;
 	char *args[MAXPARAMS];
 	char *comment;
+};
+
+struct pk_option_record {
+	enum option opt;
+	enum arg_type type;
 	unsigned _seen;  /* internal use by pk_getopt() */
 };

-#define POSTPROCESS_MODES (MODE_UPLOAD|MODE_EXAMINE|MODE_VALIDATE)
-#define NONRUN_MODES (POSTPROCESS_MODES|MODE_HOARD)
-#define NONTRIVIAL_MODES (MODE_RUN|NONRUN_MODES)
+struct pk_mode {
+	char *name;
+	enum mode type;
+	struct pk_option_record *opts;
+	char *desc;
+};
+
 static struct pk_option pk_options[] = {
-	{"user",           OPT_USER,           REQUIRED, NONTRIVIAL_MODES                  , {"user_name"}},
-	{"parcel",         OPT_PARCEL,         REQUIRED, NONTRIVIAL_MODES                  , {"parcel_name"}},
-	{"parceldir",      OPT_PARCELDIR,      REQUIRED, NONTRIVIAL_MODES                  , {"parcel_dir"}},
-	{"cache",          OPT_CACHE,          REQUIRED, MODE_UPLOAD|MODE_VALIDATE|MODE_RUN, {"local_cache_dir"}},
-	{"last",           OPT_LAST,           REQUIRED, NONRUN_MODES                      , {"last_cache_dir"}},
-	{"destdir",        OPT_DESTDIR,        REQUIRED, MODE_UPLOAD                       , {"dir"}},
-	{"hoard",          OPT_HOARD,          REQUIRED, MODE_HOARD                        , {"hoard_dir"}},
-	{"cache",          OPT_CACHE,          OPTIONAL, MODE_EXAMINE                      , {"local_cache_dir"}},
-	{"hoard",          OPT_HOARD,          OPTIONAL, POSTPROCESS_MODES|MODE_RUN        , {"hoard_dir"}},
-	{"compression",    OPT_COMPRESSION,    OPTIONAL, MODE_RUN                          , {"algorithm"},                                           "Accepted algorithms: none (default), zlib, lzf"},
-	{"log",            OPT_LOG,            OPTIONAL, NONTRIVIAL_MODES                  , {"logfile", "info_str", "filemask", "stderrmask"}},
-	{"foreground",     OPT_FOREGROUND,     OPTIONAL, MODE_RUN                          , {},                                                      "Don't run in the background"},
-	{"mode",           OPT_MODE,           OPTIONAL, MODE_HELP                         , {"mode"},                                                "Print detailed usage message about the given mode"},
+	{"user",           OPT_USER,           {"user_name"}},
+	{"parcel",         OPT_PARCEL,         {"parcel_name"}},
+	{"parceldir",      OPT_PARCELDIR,      {"parcel_dir"}},
+	{"cache",          OPT_CACHE,          {"local_cache_dir"}},
+	{"last",           OPT_LAST,           {"last_cache_dir"}},
+	{"destdir",        OPT_DESTDIR,        {"dir"}},
+	{"hoard",          OPT_HOARD,          {"hoard_dir"}},
+	{"cache",          OPT_CACHE,          {"local_cache_dir"}},
+	{"hoard",          OPT_HOARD,          {"hoard_dir"}},
+	{"compression",    OPT_COMPRESSION,    {"algorithm"},                                           "Accepted algorithms: none (default), zlib, lzf"},
+	{"log",            OPT_LOG,            {"logfile", "info_str", "filemask", "stderrmask"}},
+	{"foreground",     OPT_FOREGROUND,     {},                                                      "Don't run in the background"},
+	{"mode",           OPT_MODE,           {"mode"},                                                "Print detailed usage message about the given mode"},
 	{0}
 };
+
+#define mode(sym) static struct pk_option_record sym ## _opts[]
+
+mode(RUN) = {
+	{OPT_USER,          REQUIRED},
+	{OPT_PARCEL,        REQUIRED},
+	{OPT_PARCELDIR,     REQUIRED},
+	{OPT_CACHE,         REQUIRED},
+	{OPT_HOARD,         OPTIONAL},
+	{OPT_COMPRESSION,   OPTIONAL},
+	{OPT_LOG,           OPTIONAL},
+	{OPT_FOREGROUND,    OPTIONAL},
+	{END_OPTS}
+};
+
+mode(UPLOAD) = {
+	{OPT_USER,          REQUIRED},
+	{OPT_PARCEL,        REQUIRED},
+	{OPT_PARCELDIR,     REQUIRED},
+	{OPT_CACHE,         REQUIRED},
+	{OPT_LAST,          REQUIRED},
+	{OPT_DESTDIR,       REQUIRED},
+	{OPT_HOARD,         OPTIONAL},
+	{OPT_LOG,           OPTIONAL},
+	{END_OPTS}
+};
+
+mode(HOARD) = {
+	{OPT_USER,          REQUIRED},
+	{OPT_PARCEL,        REQUIRED},
+	{OPT_PARCELDIR,     REQUIRED},
+	{OPT_LAST,          REQUIRED},
+	{OPT_HOARD,         REQUIRED},
+	{OPT_LOG,           OPTIONAL},
+	{END_OPTS}
+};
+
+mode(EXAMINE) = {
+	{OPT_USER,          REQUIRED},
+	{OPT_PARCEL,        REQUIRED},
+	{OPT_PARCELDIR,     REQUIRED},
+	{OPT_LAST,          REQUIRED},
+	{OPT_CACHE,         OPTIONAL},
+	{OPT_HOARD,         OPTIONAL},
+	{OPT_LOG,           OPTIONAL},
+	{END_OPTS}
+};
+
+mode(VALIDATE) = {
+	{OPT_USER,          REQUIRED},
+	{OPT_PARCEL,        REQUIRED},
+	{OPT_PARCELDIR,     REQUIRED},
+	{OPT_CACHE,         REQUIRED},
+	{OPT_LAST,          REQUIRED},
+	{OPT_HOARD,         OPTIONAL},
+	{OPT_LOG,           OPTIONAL},
+	{END_OPTS}
+};
+
+mode(HELP) = {
+	{OPT_MODE,          OPTIONAL},
+	{END_OPTS}
+};
+
+mode(VERSION) = {
+	{END_OPTS}
+};
+
+#undef mode
+
+#define sym(str) MODE_ ## str, str ## _opts
+static struct pk_mode pk_modes[] = {
+	{"run",       sym(RUN),     "Bind and service a virtual disk"},
+	{"upload",    sym(UPLOAD),  "Split a cache file into individual chunks for upload"},
+	{"hoard",     sym(HOARD),   "Download all chunks into hoard cache"},
+	{"examine",   sym(EXAMINE), "Print cache statistics"},
+	{"validate",  sym(VALIDATE),"Validate cache against keyring"},
+	{"help",      sym(HELP),    "Show usage summary"},
+	{"version",   sym(VERSION), "Show version information"},
+	{0}
+};
+#undef sym
+
+static char *optparams[MAXPARAMS];
+static char *progname;
+static struct pk_mode *curmode;
+
+static struct pk_option *get_option(enum option opt)
+{
+	struct pk_option *curopt;
+
+	for (curopt=pk_options; curopt->name != NULL; curopt++) {
+		if (curopt->opt == opt)
+			return curopt;
+	}
+	printf("BUG: Unknown option %d\n", opt);
+	return NULL;
+}

 static void usage(struct pk_mode *mode) __attribute__ ((noreturn));
 static void usage(struct pk_mode *mode)
 {
 	struct pk_mode *mtmp;
+	struct pk_option_record *rtmp;
 	struct pk_option *otmp;
 	char *str_start=NULL;
 	char *str_end=NULL;
@@ -105,16 +192,15 @@
 		printf("Run \"%s help --mode <mode>\" for more information.\n",
 					progname);
 	} else {
-		for (otmp=pk_options; otmp->name != NULL; otmp++) {
-			if ((otmp->mask & mode->type) != mode->type)
-				continue;
+		for (rtmp=mode->opts; rtmp->opt != END_OPTS; rtmp++) {
+			otmp=get_option(rtmp->opt);
 			if (!have_options) {
 				have_options=1;
 				printf("Usage: %s %s <options>\n", progname,
 							mode->name);
 				printf("Available options:\n");
 			}
-			switch (otmp->type) {
+			switch (rtmp->type) {
 			case REQUIRED:
 				str_start=" ";
 				str_end="";
@@ -158,19 +244,18 @@
 static enum option pk_getopt(int argc, char *argv[])
 {
 	static int optind=2;  /* ignore argv[0] and argv[1] */
-	struct pk_option *opts;
+	struct pk_option_record *opts;
+	struct pk_option *curopt;
 	char *arg;
 	int i;

 	if (optind == argc) {
 		/* We've read the entire command line; make sure all required
 		   arguments have been handled */
-		for (opts=pk_options; opts->name != NULL; opts++) {
-			if ((opts->mask & curmode->type) != curmode->type)
-				continue;
+		for (opts=curmode->opts; opts->opt != END_OPTS; opts++) {
 			if (opts->type == REQUIRED && !opts->_seen)
 				PARSE_ERROR("missing required option --%s",
-							opts->name);
+						get_option(opts->opt)->name);
 		}
 		return -1;
 	}
@@ -180,15 +265,14 @@
 		PARSE_ERROR("\"%s\" is not an option element", arg);
 	arg += 2;

-	for (opts=pk_options; opts->name != NULL; opts++) {
-		if ((opts->mask & curmode->type) != curmode->type)
-			continue;
-		if (strcmp(opts->name, arg))
+	for (opts=curmode->opts; opts->opt != END_OPTS; opts++) {
+		curopt=get_option(opts->opt);
+		if (strcmp(curopt->name, arg))
 			continue;
 		if (opts->type != ANY && opts->_seen)
 			PARSE_ERROR("--%s may only be specified once", arg);
 		opts->_seen++;
-		for (i=0; i < MAXPARAMS && opts->args[i] != NULL; i++) {
+		for (i=0; i < MAXPARAMS && curopt->args[i] != NULL; i++) {
 			if (optind == argc)
 				PARSE_ERROR("wrong number of arguments to --%s",
 							arg);
@@ -203,8 +287,8 @@

 	/* This option is invalid.  See if it would have been valid for a
 	   different mode. */
-	for (opts=pk_options; opts->name != NULL; opts++)
-		if (!strcmp(opts->name, arg))
+	for (curopt=pk_options; curopt->name != NULL; curopt++)
+		if (!strcmp(curopt->name, arg))
 			PARSE_ERROR("--%s not valid in this mode", arg);
 	PARSE_ERROR("unknown option --%s", arg);
 }
@@ -249,7 +333,7 @@
 	if (curmode == NULL)
 		PARSE_ERROR("unknown mode %s", argv[1]);

-	while ((opt=pk_getopt(argc, argv)) != -1) {
+	while ((opt=pk_getopt(argc, argv)) != END_OPTS) {
 		switch (opt) {
 		case OPT_USER:
 			config.user=optparams[0];
@@ -316,6 +400,9 @@
 							optparams[0],
 							progname);
 			break;
+		case END_OPTS:
+			/* Silence compiler warning */
+			break;
 		}
 	}


Export symbol for unit test.

Export symbol for unit test.

--- src/arch/intsimdmatrix.h
+++ src/arch/intsimdmatrix.h
@@ -17,6 +17,8 @@

 #ifndef TESSERACT_ARCH_INTSIMDMATRIX_H_
 #define TESSERACT_ARCH_INTSIMDMATRIX_H_
+
+#include <tesseract/platform.h>

 #include <cstdint>
 #include <vector>
@@ -113,7 +115,7 @@
   // Number of groups of inputs to be broadcast.
   // num_input_groups_ = num_inputs_per_register_ / num_inputs_per_group_

-  static const IntSimdMatrix* intSimdMatrix;
+  static TESS_API const IntSimdMatrix* intSimdMatrix;
   // Only available with NEON.
   static const IntSimdMatrix intSimdMatrixNEON;
   // Only available with AVX2 / SSE.


memrev variants only doing the work if the target host is big endian

--- src/endian.h
+++ src/endian.h
@@ -5,4 +5,14 @@
 void memrev32(void *p);
 void memrev64(void *p);

+/* variants of the function doing the actual convertion only if the target
+ * host is big endian */
+#if (BYTE_ORDER == LITTLE_ENDIAN)
+#define memrev16ifbe(p)
+#define memrev32ifbe(p)
+#define memrev64ifbe(p)
+#else
+#define memrev16ifbe(p) memrev16(p)
+#define memrev32ifbe(p) memrev32(p)
+#define memrev64ifbe(p) memrev64(p)
 #endif


removed needless newline.

removed needless newline.

--- tls/s2n_x509_validator.c
+++ tls/s2n_x509_validator.c
@@ -236,7 +236,6 @@
                 verified = conn->verify_host_fn(address_ptr, strlen(address_ptr), conn->data_for_verify_host);
             }
         }
-
     }

     GENERAL_NAMES_free(names_list);


Fixed for deleting unused variables.

Fixed for deleting unused variables.

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@3718 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/image_processing/computed_field_local_frequency.c
+++ source/image_processing/computed_field_local_frequency.c
@@ -616,7 +616,7 @@
 {
         FE_value *re, *im, *kernel, *nothing;
 	int x,y,nx,ny,adr;
-	FE_value cx,cy;
+	/* FE_value cx,cy; */
 	int storage_size;
 	int return_code;
 	int i;
@@ -640,8 +640,9 @@

 		local_frequency_gaussian(kernel, g, xsize, ysize, angle_from_u_axis, centre_frequency);

-		cx = M_PI*M_PI/(FE_value)(nx*nx);
+		/*cx = M_PI*M_PI/(FE_value)(nx*nx);
 		cy = M_PI*M_PI/(FE_value)(ny*ny);
+		*/
 		for (x=-nx/2;x<nx/2;x++)
 		{
 		        for (y=-ny/2;y<ny/2;y++)


Disable 'This Screen' if multiple zones don't exist.
Fix formatting & Whitespace Removal.

git-svn-id: 6ac5796aeae0cef97fb47bcc287d4ce899c6fa6e@50723 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/modules/conf_wallpaper2/e_int_config_wallpaper.c
+++ src/modules/conf_wallpaper2/e_int_config_wallpaper.c
@@ -10,7 +10,6 @@
 //   need after select on delete an ok/cancel if file or "ok to remove whole online source" if online
 //   need to make "exchange" wallpapers have a different look
 //   bug: animated wp doesnt workon first show
-//   need to disable "this screen" if multiple containers/zones dont exist
 //   need to disable "this desktop vs all desktops" if only 1 desk exists
 //   need to be able to "type name to search/filter"

@@ -30,9 +29,7 @@
    Ecore_Idler *idler;
    int          scans;
    int          con_num, zone_num, desk_x, desk_y;
-
    int          use_theme_bg;
-
    int          mode;
 };

@@ -101,6 +98,7 @@
 _pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    if (x)
      {
         if (sd->w < sd->cw) *x = sd->cw - sd->w;
@@ -117,6 +115,7 @@
 _pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    if (w) *w = sd->cw;
    if (h) *h = sd->ch;
 }
@@ -143,20 +142,20 @@
    if (sd->cy > (sd->ch - sd->h)) sd->cy = sd->ch - sd->h;
    if (sd->cx < 0) sd->cx = 0;
    if (sd->cy < 0) sd->cy = 0;
-
+
    iw = sd->w / 4;
-   if (iw > (120 * e_scale)) iw = 120 * e_scale;
+   if (iw > (120 * e_scale)) iw = (120 * e_scale);
    else
      {
-        if (iw < (60 * e_scale)) iw = sd->w / 3;
-        if (iw < (60 * e_scale)) iw = sd->w / 2;
+        if (iw < (60 * e_scale)) iw = (sd->w / 3);
+        if (iw < (60 * e_scale)) iw = (sd->w / 2);
         if (iw < (60 * e_scale)) iw = sd->w;
      }
    x = 0;
    y = 0;
    ww = iw;
    hh = (sd->info->ih * iw) / (sd->info->iw);
-
+
    mw = mh = 0;
    EINA_LIST_FOREACH(sd->items, l, it)
      {
@@ -213,7 +212,7 @@
 	  }
         changed = 1;
      }
-
+
    ox = 0;
    if (sd->w > sd->cw) ox = (sd->w - sd->cw) / 2;
    oy = 0;
@@ -222,10 +221,9 @@
    EINA_LIST_FOREACH(sd->items, l, it)
      {
         Evas_Coord dx, dy, vw, vh;
-
+
         dx = dy = 0;
-        if ((sd->sx >= 0) &&
-            (sd->selmove > 0.0)
+        if ((sd->sx >= 0) && (sd->selmove > 0.0)

 /*            &&
             ((it->x + it->w) > sd->cx) &&
@@ -238,7 +236,7 @@
              double a, d;
              int sum = 0;
              char *p;
-
+
              // -----0X0+++++
              dx = (it->x + (it->w / 2)) - sd->sx;
              dy = (it->y + (it->h / 2)) - sd->sy;
@@ -330,7 +328,7 @@
                                                       _item_down, it);
                        evas_object_event_callback_add(it->frame, EVAS_CALLBACK_MOUSE_UP,
                                                       _item_up, it);
-
+
                        evas_object_smart_member_add(it->frame, obj);
                        evas_object_clip_set(it->frame, evas_object_clip_get(obj));
                        it->image = e_thumb_icon_add(evas_object_evas_get(obj));
@@ -338,21 +336,24 @@
                        evas_object_smart_callback_add(it->image, "e_thumb_gen", _thumb_gen, it);
                        if (it->theme)
                          {
-                            const char *f = e_theme_edje_file_get("base/theme/backgrounds",
-                                                                  "e/desktop/background");
-                            e_thumb_icon_file_set(it->image, f, "e/desktop/background");
+                            const char *f;
+
+                            f = e_theme_edje_file_get("base/theme/backgrounds",
+                                                      "e/desktop/background");
+                            e_thumb_icon_file_set(it->image, f,
+                                                  "e/desktop/background");
                          }
                        else
-                         e_thumb_icon_file_set(it->image, it->file, "e/desktop/background");
-                       e_thumb_icon_size_set(it->image, sd->info->iw, sd->info->ih);
+                         e_thumb_icon_file_set(it->image, it->file,
+                                               "e/desktop/background");
+                       e_thumb_icon_size_set(it->image, sd->info->iw,
+                                             sd->info->ih);
                        evas_object_show(it->image);
-
+
                        e_thumb_icon_begin(it->image);
                     }
                }
-             evas_object_move(it->frame,
-                              xx + dx,
-                              yy + dy);
+             evas_object_move(it->frame, xx + dx, yy + dy);
              evas_object_resize(it->frame, it->w, it->h);
              evas_object_show(it->frame);
              it->visible = EINA_TRUE;
@@ -411,7 +412,7 @@
  */
           }
      }
-
+
    if (changed)
      evas_object_smart_callback_call(obj, "changed", NULL);
    if (recursion == 0) sd->idle_enter = NULL;
@@ -422,6 +423,7 @@
 _e_smart_reconfigure(Evas_Object *obj)
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    if (sd->idle_enter) return;
    sd->idle_enter = ecore_idle_enterer_before_add(_e_smart_reconfigure_do, obj);
 }
@@ -430,6 +432,7 @@
 _e_smart_add(Evas_Object *obj)
 {
    Smart_Data *sd = calloc(1, sizeof(Smart_Data));
+
    if (!sd) return;
    sd->x = sd->y = sd->w = sd->h = 0;
    sd->sx = sd->sy = -1;
@@ -441,6 +444,7 @@
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
    Item *it;
+
    if (sd->seltimer)
      ecore_timer_del(sd->seltimer);
    if (sd->idle_enter)
@@ -465,6 +469,7 @@
 _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    sd->x = x;
    sd->y = y;
    _e_smart_reconfigure(obj);
@@ -474,6 +479,7 @@
 _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    sd->w = w;
    sd->h = h;
    _e_smart_reconfigure(obj);
@@ -545,9 +551,9 @@
 _pan_info_set(Evas_Object *obj, Info *info)
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    sd->info = info;
 }
-

 static Eina_Bool
 _sel_anim(void *data)
@@ -558,6 +564,7 @@
    double len = 1.0;
    double p = t / len;
    double d;
+
    if (p > 1.0) p = 1.0;
    if (!sd->selin)
      {
@@ -618,6 +625,7 @@
 {
    Evas_Object *obj = data;
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    if (!sd->animator)
      {
         sd->seltime = ecore_time_get();
@@ -646,6 +654,7 @@
    Eina_List *l;
    Item *it2;
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    if (it->hilighted) return;
    EINA_LIST_FOREACH(sd->items, l, it2)
      {
@@ -668,6 +677,7 @@
 _pan_sel(Evas_Object *obj, Item *it)
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    if (sd->selmove > 0.0) return;
    edje_object_signal_emit(it->frame, "e,state,selected", "e");
    evas_object_raise(it->frame);
@@ -686,6 +696,7 @@
         if (it->file)
           {
              char *name = NULL, *p;
+
              sd->info->use_theme_bg = 0;
              sd->info->bg_file = strdup(it->file);
              edje_object_file_set(sd->info->mini, sd->info->bg_file,
@@ -705,11 +716,12 @@
           {
              const char *f = e_theme_edje_file_get("base/theme/backgrounds",
                                                    "e/desktop/background");
-             edje_object_file_set(sd->info->mini, f,
-                                  "e/desktop/background");
+
+             edje_object_file_set(sd->info->mini, f, "e/desktop/background");
              sd->info->use_theme_bg = 1;
              sd->info->bg_file = NULL;
-             edje_object_part_text_set(sd->info->bg, "e.text.filename", _("Theme Wallpaper"));
+             edje_object_part_text_set(sd->info->bg, "e.text.filename",
+                                       _("Theme Wallpaper"));
           }
         evas_object_show(sd->info->mini);
      }
@@ -721,6 +733,7 @@
 _pan_sel_up(Evas_Object *obj)
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
+
    if (sd->selmove == 0.0) return;
    if (!sd->animator)
      {
@@ -739,6 +752,7 @@
 _sort_cb(const void *d1, const void *d2)
 {
    const Item *it1 = d1, *it2 = d2;
+
    if ((!it1->sort_id) || (!it2->sort_id)) return 0;
    return strcmp(it1->sort_id, it2->sort_id);
 }
@@ -749,7 +763,7 @@
    Evas_Object *obj = it->obj;
    Smart_Data *sd = evas_object_smart_data_get(obj);
    int num, dosort = 0;
-
+
    sd->id_num++;
    sd->info->scans--;
    num = eina_list_count(sd->items);
@@ -766,7 +780,7 @@
           {
              Eina_List *l;
              Item *it2 = NULL;
-
+
              EINA_LIST_FOREACH(sd->items, l, it2)
                {
                   if (it2->hilighted) break;
@@ -774,25 +788,24 @@
                }
              if (it2)
                e_scrollframe_child_region_show(sd->info->sframe,
-                                               it2->x, it2->y,
-                                               it2->w, it2->h);
+                                               it2->x, it2->y, it2->w, it2->h);
              sd->jump2hi = 1;
           }
      }
    if (sd->info->scans == 0)
-     {
-        edje_object_signal_emit(sd->info->bg, "e,state,busy,off", "e");
-     }
+     edje_object_signal_emit(sd->info->bg, "e,state,busy,off", "e");
 }

 static void
 _thumb_gen(void *data, Evas_Object *obj, void *event_info)
 {
    Item *it = data;
+
    edje_object_signal_emit(it->frame, "e,action,thumb,gen", "e");
    if (!it->sort_id)
      {
         const char *id = e_thumb_sort_id_get(it->image);
+
         if (id)
           {
              it->sort_id = strdup(id);
@@ -827,6 +840,7 @@
 {
    Evas_Event_Mouse_Up *ev = event_info;
    Item *it = data;
+
    if (ev->button == 1)
      {
         if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
@@ -843,6 +857,7 @@
 {
    Smart_Data *sd = evas_object_smart_data_get(obj);
    Item *it = calloc(1, sizeof(Item));
+
    if (!it) return;
    sd->items = eina_list_append(sd->items, it);
    it->obj = obj;
@@ -868,7 +883,7 @@
                                   _item_down, it);
    evas_object_event_callback_add(it->frame, EVAS_CALLBACK_MOUSE_UP,
                                   _item_up, it);
-
+
    evas_object_smart_member_add(it->frame, obj);
    evas_object_clip_set(it->frame, evas_object_clip_get(obj));
    evas_object_show(it->frame);
@@ -879,13 +894,14 @@
      {
         const char *f = e_theme_edje_file_get("base/theme/backgrounds",
                                               "e/desktop/background");
+
         e_thumb_icon_file_set(it->image, f, "e/desktop/background");
      }
    else
      e_thumb_icon_file_set(it->image, it->file, "e/desktop/background");
    e_thumb_icon_size_set(it->image, sd->info->iw, sd->info->ih);
    evas_object_show(it->image);
-
+
    e_thumb_icon_begin(it->image);
    it->do_thumb = 1;
 //   e_thumb_icon_begin(it->image);
@@ -895,7 +911,8 @@
         if (sd->info->use_theme_bg)
           {
              _pan_hilight(it->obj, it);
-             edje_object_part_text_set(sd->info->bg, "e.text.filename", _("Theme Wallpaper"));
+             edje_object_part_text_set(sd->info->bg, "e.text.filename",
+                                       _("Theme Wallpaper"));
           }
      }
    else
@@ -903,12 +920,12 @@
         if (sd->info->bg_file)
           {
              int match = 0;
-
+
              if (!strcmp(sd->info->bg_file, it->file)) match = 1;
              if (!match)
                {
                   const char *p1, *p2;
-
+
                   p1 = ecore_file_file_get(sd->info->bg_file);
                   p2 = ecore_file_file_get(it->file);
                   if (!strcmp(p1, p2)) match = 1;
@@ -961,13 +978,14 @@
 _ok(void *data, void *data2)
 {
    Info *info = data;
+
    if (info->mode == 0)
      {
         /* all desktops */
         while (e_config->desktop_backgrounds)
           {
              E_Config_Desktop_Background *cfbg;
-
+
              cfbg = e_config->desktop_backgrounds->data;
              e_bg_del(cfbg->container, cfbg->zone, cfbg->desk_x, cfbg->desk_y);
           }
@@ -986,7 +1004,7 @@
      {
         Eina_List *dlist = NULL, *l;
         E_Config_Desktop_Background *cfbg;
-
+
         /* this screen */
         EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
           {
@@ -1031,7 +1049,7 @@
    struct dirent *dp;
    char buf[PATH_MAX];
    Info *info = data;
-
+
    if (!info->dir)
      {
         info->idler = NULL;
@@ -1060,7 +1078,7 @@
      }
    info->scans++;
    _pan_file_add(info->span, buf, 0, 0);
-
+
    e_util_wakeup();
    return ECORE_CALLBACK_RENEW;
 }
@@ -1074,7 +1092,8 @@
           {
              info->scans = 0;
              edje_object_signal_emit(info->bg, "e,state,busy,on", "e");
-             edje_object_part_text_set(info->bg, "e.text.busy_label", _("Loading files..."));
+             edje_object_part_text_set(info->bg, "e.text.busy_label",
+                                       _("Loading files..."));
           }
         if (info->curdir) free(info->curdir);
         info->curdir = info->dirs->data;
@@ -1096,24 +1115,23 @@
    Evas_Object *o, *o2, *ob;
    E_Radio_Group *rg;
    char buf[PATH_MAX];
-
+
    info = calloc(1, sizeof(Info));
    if (!info) return NULL;
-
+
    zone = e_util_zone_current_get(con->manager);
    desk = e_desk_current_get(zone);
    info->con_num = con->num;
    info->zone_num = zone->id;
    info->desk_x = desk->x;
    info->desk_y = desk->y;
-
    info->mode = 0;
    cfbg = e_bg_config_get(con->num, zone->id, desk->x, desk->y);
    if (cfbg)
      {
         if ((cfbg->container >= 0) && (cfbg->zone >= 0))
           {
-             if (cfbg->desk_x >= 0 && cfbg->desk_y >= 0)
+             if ((cfbg->desk_x >= 0) && (cfbg->desk_y >= 0))
                info->mode = 1;
              else
                info->mode = 2;
@@ -1121,17 +1139,13 @@
         info->bg_file = strdup(cfbg->file);
      }
    if ((!info->bg_file) && (e_config->desktop_default_background))
-     {
-        info->bg_file = strdup(e_config->desktop_default_background);
-     }
+     info->bg_file = strdup(e_config->desktop_default_background);
    else
-     {
-        info->use_theme_bg = 1;
-     }
-
-   info->iw = 120 * e_scale;
+     info->use_theme_bg = 1;
+
+   info->iw = (120 * e_scale);
    info->ih = (zone->h * info->iw) / (zone->w);
-
+
    win = e_win_new(con);
    if (!win)
      {
@@ -1141,12 +1155,12 @@
      }
    info->win = win;
    win->data = info;
-
+
    e_user_dir_concat_static(buf, "backgrounds");
    info->dirs = eina_list_append(info->dirs, strdup(buf));
    e_prefix_data_concat_static(buf, "data/backgrounds");
    info->dirs = eina_list_append(info->dirs, strdup(buf));
-
+
    e_win_title_set(win, _("Wallpaper Settings"));
    e_win_name_class_set(win, "E", "_config::appearance/wallpaper2");
    e_win_border_icon_set(win, "preferences-desktop-wallpaper");
@@ -1162,12 +1176,12 @@

    // ok button
    info->box = e_widget_list_add(info->win->evas, 1, 1);
-
+
    info->button = e_widget_button_add(info->win->evas, _("OK"), NULL,
                                       _ok, info, NULL);
    evas_object_show(info->button);
    e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
-
+
    e_widget_size_min_get(info->box, &mw, &mh);
    edje_extern_object_min_size_set(info->box, mw, mh);
    edje_object_part_swallow(info->bg, "e.swallow.buttons", info->box);
@@ -1176,10 +1190,11 @@
    // preview
    info->preview = e_livethumb_add(info->win->evas);
    e_livethumb_vsize_set(info->preview, zone->w, zone->h);
-   edje_extern_object_aspect_set(info->preview, EDJE_ASPECT_CONTROL_NEITHER, zone->w, zone->h);
+   edje_extern_object_aspect_set(info->preview, EDJE_ASPECT_CONTROL_NEITHER,
+                                 zone->w, zone->h);
    edje_object_part_swallow(info->bg, "e.swallow.preview", info->preview);
    evas_object_show(info->preview);
-
+
    info->mini = edje_object_add(e_livethumb_evas_get(info->preview));
    e_livethumb_thumb_set(info->preview, info->mini);
    evas_object_show(info->mini);
@@ -1189,13 +1204,14 @@
      {
         const char *f = e_theme_edje_file_get("base/theme/backgrounds",
                                               "e/desktop/background");
+
         edje_object_file_set(info->mini, f, "e/desktop/background");
      }
-
+
    // scrolled thumbs
    info->span = _pan_add(info->win->evas);
    _pan_info_set(info->span, info);
-
+
    // the scrollframe holding the scrolled thumbs
    info->sframe = e_scrollframe_add(info->win->evas);
    e_scrollframe_custom_theme_set(info->sframe, "base/theme/widgets",
@@ -1206,50 +1222,52 @@
    edje_object_part_swallow(info->bg, "e.swallow.list", info->sframe);
    evas_object_show(info->sframe);
    evas_object_show(info->span);
-
+
    ob = e_widget_list_add(info->win->evas, 0, 1);

    o = e_widget_list_add(info->win->evas, 1, 0);
-
+
    rg = e_widget_radio_group_new(&(info->mode));
    o2 = e_widget_radio_add(info->win->evas, _("All Desktops"), 0, rg);
    evas_object_smart_callback_add(o2, "changed", _wp_changed, info);
    e_widget_list_object_append(o, o2, 1, 0, 0.5);
    evas_object_show(o2);
-
+
    o2 = e_widget_radio_add(info->win->evas, _("This Desktop"), 1, rg);
    evas_object_smart_callback_add(o2, "changed", _wp_changed, info);
    e_widget_list_object_append(o, o2, 1, 0, 0.5);
    evas_object_show(o2);
-
+
    o2 = e_widget_radio_add(info->win->evas, _("This Screen"), 2, rg);
    evas_object_smart_callback_add(o2, "changed", _wp_changed, info);
    e_widget_list_object_append(o, o2, 1, 0, 0.5);
+   if (!(e_util_container_zone_number_get(0, 1) ||
+         (e_util_container_zone_number_get(1, 0))))
+     e_widget_disabled_set(o2, EINA_TRUE);
    evas_object_show(o2);
-
+
    e_widget_list_object_append(ob, o, 1, 0, 0.5);
    evas_object_show(o);
-
+
    o = e_widget_list_add(info->win->evas, 1, 0);
-
+
    o2 =  e_widget_button_add(info->win->evas, _("Add"), NULL,
                              _wp_add, info, NULL);
    e_widget_list_object_append(o, o2, 1, 0, 0.5);
    evas_object_show(o2);
-
+
    o2 =  e_widget_button_add(info->win->evas, _("Delete"), NULL,
                              _wp_delete, info, NULL);
    e_widget_list_object_append(o, o2, 1, 0, 0.5);
    evas_object_show(o2);
-
+
    e_widget_list_object_append(ob, o, 1, 0, 0.5);
    evas_object_show(o);
-
+
    e_widget_size_min_get(ob, &mw, &mh);
    edje_extern_object_min_size_set(ob, mw, mh);
    edje_object_part_swallow(info->bg, "e.swallow.extras", ob);
    evas_object_show(ob);
-

    // min size calc
    edje_object_size_min_calc(info->bg, &mw, &mh);
@@ -1265,7 +1283,7 @@

    // add theme bg
    _pan_file_add(info->span, NULL, 0, 1);
-
+
    _scan(info);
    return info;
 }
@@ -1274,6 +1292,7 @@
 wp_broser_free(Info *info)
 {
    char *s;
+
    if (!info) return;
    e_object_del(E_OBJECT(info->win));
    if (info->dir) closedir(info->dir);


Remove useless include

Remove useless include

--- xbob/learn/linear/include/xbob.learn.linear/api.h
+++ xbob/learn/linear/include/xbob.learn.linear/api.h
@@ -178,8 +178,6 @@
 # define PyBobLearnLinearFisherLDATrainer_Check (*(PyBobLearnLinearFisherLDATrainer_Check_RET (*)PyBobLearnLinearFisherLDATrainer_Check_PROTO) PyXbobLearnLinear_API[PyBobLearnLinearFisherLDATrainer_Check_NUM])

 # if !defined(NO_IMPORT_ARRAY)
-
-#include <xbob.learn.activation/api.h>

   /**
    * Returns -1 on error, 0 on success. PyCapsule_Import will set an exception


MS5611

--- readMS5611.c
+++ readMS5611.c
@@ -36,7 +36,7 @@

 // check daily sea level pressure at
 // http://www.kma.go.kr/weather/observation/currentweather.jsp
-#define SEA_LEVEL_PRESSURE 1023.20
+#define SEA_LEVEL_PRESSURE 1023.20 // Seoul 1023.20hPa

 unsigned int PROM_read(int DA, char PROM_CMD)
 {


Move to static stack for CLI commands

Move to static stack for CLI commands

Statically allocate stack for CLI task.

Resolves: LE-15550
Related: LE-15486
Change-Id: Idb8de85bf7ba54e4dbe4912b14dfb020e31b960e

--- framework/daemons/rtos/microSupervisor/microSupervisor.c
+++ framework/daemons/rtos/microSupervisor/microSupervisor.c
@@ -680,6 +680,13 @@
     // Define task, stack and all necessary structures in order to run CLI commands
     // in dedicated thread.

+    // Force static stacks as a workaround for LE-15486.
+    // TODO: remove this once LE-15486 is fixed.
+    #if LE_CONFIG_TARGET_HL78
+    #    undef LE_CONFIG_STATIC_THREAD_STACKS
+    #    define LE_CONFIG_STATIC_THREAD_STACKS 1
+    #endif
+
     #if LE_CONFIG_STATIC_THREAD_STACKS
     LE_THREAD_DEFINE_STATIC_STACK(cli, LE_CONFIG_CLI_STACK_SIZE);
     #endif


Missing a prototype

Missing a prototype

--- engine/rasterizer_integer.h
+++ engine/rasterizer_integer.h
@@ -62,9 +62,7 @@
 	LeColor background;				/**< background color */

 private:
-	void topTriangleZC(int vt, int vm1, int vm2);
-	void bottomTriangleZC(int vm1, int vm2, int vb);
-
+	inline void fillTriangleZC(int vi1, int vi2, int vi3, bool top);
 	inline void fillFlatTexZC(int y, int x1, int x2, int w1, int w2, int u1, int u2, int v1, int v2);
 	inline void fillFlatTexZCFog(int y, int x1, int x2, int w1, int w2, int u1, int u2, int v1, int v2);
 	inline void fillFlatTexAlphaZC(int y, int x1, int x2, int w1, int w2, int u1, int u2, int v1, int v2);


auth: Auth master process is now running as default_internal_user by default.
Workers are still running as root, so PAM will continue to work as before.

--HG--
branch : HEAD

--- src/auth/auth-settings.c
+++ src/auth/auth-settings.c
@@ -40,7 +40,7 @@
 	.protocol = "",
 	.type = "",
 	.executable = "auth",
-	.user = "",
+	.user = "$default_internal_user",
 	.group = "",
 	.privileged_group = "",
 	.extra_groups = "",
@@ -62,7 +62,7 @@

 /* <settings checks> */
 static struct file_listener_settings auth_worker_unix_listeners_array[] = {
-	{ "auth-worker", 0600, "", "" }
+	{ "auth-worker", 0600, "$default_internal_user", "" }
 };
 static struct file_listener_settings *auth_worker_unix_listeners[] = {
 	&auth_worker_unix_listeners_array[0]


auth: passdb static assumed that missing "password" field meant empty password Missing password should be an error unless nopassword is set. If an empty password is wanted then "password=" can be used.

--- src/auth/passdb-static.c
+++ src/auth/passdb-static.c
@@ -13,7 +13,7 @@
 	const char *static_password_tmpl;
 };

-static void
+static enum passdb_result
 static_save_fields(struct auth_request *request, const char **password_r)
 {
 	struct static_passdb_module *module =
@@ -24,23 +24,33 @@
 	auth_request_log_debug(request, AUTH_SUBSYS_DB, "lookup");
 	passdb_template_export(module->tmpl, request);

-	if (module->static_password_tmpl == NULL)
-		*password_r = "";
-	else {
+	if (module->static_password_tmpl != NULL) {
 		table = auth_request_get_var_expand_table(request, NULL);
 		var_expand(str, module->static_password_tmpl, table);
 		*password_r = str_c(str);
+	} else if (auth_fields_exists(request->extra_fields, "nopassword")) {
+		*password_r = "";
+	} else {
+		auth_request_log_info(request, AUTH_SUBSYS_DB,
+			"No password returned (and no nopassword)");
+		return PASSDB_RESULT_PASSWORD_MISMATCH;
 	}
+	return PASSDB_RESULT_OK;
 }

 static void
 static_verify_plain(struct auth_request *request, const char *password,
 		    verify_plain_callback_t *callback)
 {
+	enum passdb_result result;
 	const char *static_password;
 	int ret;

-	static_save_fields(request, &static_password);
+	result = static_save_fields(request, &static_password);
+	if (result != PASSDB_RESULT_OK) {
+		callback(result, request);
+		return;
+	}

 	ret = auth_request_password_verify(request, password, static_password,
 					   STATIC_PASS_SCHEME, AUTH_SUBSYS_DB);
@@ -56,10 +66,11 @@
 static_lookup_credentials(struct auth_request *request,
 			  lookup_credentials_callback_t *callback)
 {
+	enum passdb_result result;
 	const char *static_password;

-	static_save_fields(request, &static_password);
-	passdb_handle_credentials(PASSDB_RESULT_OK, static_password,
+	result = static_save_fields(request, &static_password);
+	passdb_handle_credentials(result, static_password,
 				  STATIC_PASS_SCHEME, callback, request);
 }


cleanup

cleanup

--- src/backend/port/isinf.c
+++ src/backend/port/isinf.c
@@ -1,9 +1,11 @@
-/* $Id: isinf.c,v 1.11 1999/07/18 20:43:12 momjian Exp $ */
+/* $Id: isinf.c,v 1.12 1999/07/18 20:43:33 momjian Exp $ */

 #include <math.h>
+
 #include "config.h"

-#if HAVE_FPCLASS
+#if HAVE_FPCLASS /* this is _not_ HAVE_FP_CLASS, and not typo */
+
 #if HAVE_IEEEFP_H
 #include <ieeefp.h>
 #endif
@@ -26,6 +28,7 @@
 #else

 #if defined(HAVE_FP_CLASS) || defined(HAVE_FP_CLASS_D)
+
 #if HAVE_FP_CLASS_H
 #include <fp_class.h>
 #endif
@@ -48,10 +51,7 @@
 	return 0;
 }

-#endif
-#endif
-
-#if defined(HAVE_CLASS)
+#else defined(HAVE_CLASS)
 int
 isinf(double x)
 {
@@ -65,3 +65,5 @@
 }

 #endif
+#endif
+#endif


removed unused variable

removed unused variable

--- src/events.c
+++ src/events.c
@@ -130,7 +130,6 @@
 {
     ASSERT_ARGS(Parrot_cx_count_handlers_local)
     PMC * const handlers = Parrot_pcc_get_handlers(interp, interp->ctx);
-    INTVAL elements;

     if (PMC_IS_NULL(handlers))
         return 0;


Ensure event callbacks are threadsafe

Ensure event callbacks are threadsafe

Take a global lock whenever changing any event callbacks to
ensure thread safety

--- src/events.c
+++ src/events.c
@@ -56,6 +56,8 @@
     virFreeCallback ff;
 };

+GMutex *eventlock = NULL;
+
 static int nextwatch = 1;
 static unsigned int nhandles = 0;
 static struct vir_g_event_handle **handles = NULL;
@@ -97,6 +99,9 @@
 {
     struct vir_g_event_handle *data;
     GIOCondition cond = 0;
+    int ret;
+
+    g_mutex_lock(eventlock);

     handles = g_realloc(handles, sizeof(*handles)*(nhandles+1));
     data = g_malloc(sizeof(*data));
@@ -124,7 +129,11 @@

     handles[nhandles++] = data;

-    return data->watch;
+    ret = data->watch;
+
+    g_mutex_unlock(eventlock);
+
+    return ret;
 }

 static struct vir_g_event_handle *
@@ -141,17 +150,20 @@
 void vir_g_event_handle_update(int watch,
                                int events)
 {
-    struct vir_g_event_handle *data = vir_g_event_handle_find(watch);
-
+    struct vir_g_event_handle *data;
+
+    g_mutex_lock(eventlock);
+
+    data = vir_g_event_handle_find(watch);
     if (!data) {
         DEBUG("Update for missing handle watch %d", watch);
-        return;
+        goto cleanup;
     }

     if (events) {
         GIOCondition cond = 0;
         if (events == data->events)
-            return;
+            goto cleanup;

         if (data->source)
             g_source_remove(data->source);
@@ -168,24 +180,34 @@
         data->events = events;
     } else {
         if (!data->source)
-            return;
+            goto cleanup;

         g_source_remove(data->source);
         data->source = 0;
         data->events = 0;
     }
+
+cleanup:
+    g_mutex_unlock(eventlock);
 }

 int vir_g_event_handle_remove(int watch)
 {
-    struct vir_g_event_handle *data = vir_g_event_handle_find(watch);
-
+    struct vir_g_event_handle *data;
+    int ret = -1;
+
+    g_mutex_lock(eventlock);
+
+    data = vir_g_event_handle_find(watch);
     if (!data) {
         DEBUG("Remove of missing watch %d", watch);
-        return -1;
+        goto cleanup;
     }

     DEBUG("Remove handle %d %d\n", watch, data->fd);
+
+    if (!data->source)
+        goto cleanup;

     g_source_remove(data->source);
     data->source = 0;
@@ -194,7 +216,11 @@
         (data->ff)(data->opaque);
     free(data);

-    return 0;
+    ret = 0;
+
+cleanup:
+    g_mutex_unlock(eventlock);
+    return ret;
 }

@@ -215,6 +241,9 @@
                         virFreeCallback ff)
 {
     struct vir_g_event_timeout *data;
+    int ret;
+
+    g_mutex_lock(eventlock);

     timeouts = g_realloc(timeouts, sizeof(*timeouts)*(ntimeouts+1));
     data = g_malloc(sizeof(*data));
@@ -234,7 +263,11 @@

     DEBUG("Add timeout %p %d %p %p %d\n", data, interval, cb, opaque, data->timer);

-    return data->timer;
+    ret = data->timer;
+
+    g_mutex_unlock(eventlock);
+
+    return ret;
 }

@@ -253,18 +286,21 @@
 void vir_g_event_timeout_update(int timer,
                                int interval)
 {
-    struct vir_g_event_timeout *data = vir_g_event_timeout_find(timer);
-
+    struct vir_g_event_timeout *data;
+
+    g_mutex_lock(eventlock);
+
+    data = vir_g_event_timeout_find(timer);
     if (!data) {
         DEBUG("Update of missing timer %d", timer);
-        return;
+        goto cleanup;
     }

     DEBUG("Update timeout %p %d %d\n", data, timer, interval);

     if (interval >= 0) {
         if (data->source)
-            return;
+            goto cleanup;

         data->interval = interval;
         data->source = g_timeout_add(data->interval,
@@ -272,26 +308,33 @@
                                      data);
     } else {
         if (!data->source)
-            return;
+            goto cleanup;

         g_source_remove(data->source);
         data->source = 0;
     }
+
+cleanup:
+    g_mutex_unlock(eventlock);
 }

 int vir_g_event_timeout_remove(int timer)
 {
-    struct vir_g_event_timeout *data = vir_g_event_timeout_find(timer);
-
+    struct vir_g_event_timeout *data;
+    int ret = -1;
+
+    g_mutex_lock(eventlock);
+
+    data = vir_g_event_timeout_find(timer);
     if (!data) {
         DEBUG("Remove of missing timer %d", timer);
-        return -1;
+        goto cleanup;
     }

     DEBUG("Remove timeout %p %d\n", data, timer);

     if (!data->source)
-        return -1;
+        goto cleanup;

     g_source_remove(data->source);
     data->source = 0;
@@ -301,7 +344,11 @@

     free(data);

-    return 0;
+    ret = 0;
+
+cleanup:
+    g_mutex_unlock(eventlock);
+    return ret;
 }

@@ -324,6 +371,8 @@
     char *debugEnv = getenv("LIBVIRT_GLIB_DEBUG");
     if (debugEnv && *debugEnv && *debugEnv != '0')
         debugFlag = 1;
+
+    eventlock = g_mutex_new();

     return TRUE;
 }


evtstr: readd the escaping of the CR and LF characters

CR and LF characters should be escaped instead of left intact so an
eventlog generated line always sits on a single line.

Signed-off-by: Viktor Juhasz <0505ada5e2d4ae2226e83f9efc13af77b5074f81@balabit.hu>
Signed-off-by: Balazs Scheidler <c9ced0bffa833fad400e0759f75a89a845bcc267@balabit.hu>

--- src/evtstr.c
+++ src/evtstr.c
@@ -96,7 +96,7 @@
     {
       unsigned c = (unsigned) unescaped[i];

-      if (c < 32 && (c != '\n' && c != '\r' && c != '\t'))
+      if (c < 32 && c != '\t')
         {
           sprintf(&buf[dst], "\\x%02x", (unsigned char) unescaped[i]);
           dst += 4;


Karl's latest patch for SF issue #673791:
Call storeAtts() for all element start tags; this is necessary to
ensure attribute defaults are properly processed for all elements
(needed to do proper namespace checking, at the very least), and that
tag names are properly cooked when there's an end-element-handler but
no start-element-handler.

This causes the new tests to pass, and closes the SF tracker issue.

--- lib/xmlparse.c
+++ lib/xmlparse.c
@@ -316,8 +316,8 @@
 #endif /* XML_DTD */

 static enum XML_Error
-storeAtts(XML_Parser parser, const ENCODING *,
-          const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr);
+storeAtts(XML_Parser parser, const ENCODING *, const char *s,
+          TAG_NAME *tagNamePtr, BINDING **bindingsPtr);
 static enum XML_Error
 addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
            const XML_Char *uri, BINDING **bindingsPtr);
@@ -2104,11 +2104,6 @@
         }
         tag->name.str = (XML_Char *)tag->buf;
         *toPtr = XML_T('\0');
-        if (!startElementHandler && (tok == XML_TOK_START_TAG_NO_ATTS)) {
-          if (defaultHandler)
-            reportDefault(parser, enc, s, next);
-          break;
-        }
         result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings));
         if (result)
           return result;
@@ -2121,13 +2116,6 @@
         break;
       }
     case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
-      if (!startElementHandler && !endElementHandler) {
-        if (defaultHandler)
-          reportDefault(parser, enc, s, next);
-        if (tagLevel == 0)
-          return epilogProcessor(parser, next, end, nextPtr);
-        break;
-      }
       /* fall through */
     case XML_TOK_EMPTY_ELEMENT_WITH_ATTS:
       {
@@ -2141,13 +2129,10 @@
         if (!name.str)
           return XML_ERROR_NO_MEMORY;
         poolFinish(&tempPool);
-        if (startElementHandler ||
-            (tok == XML_TOK_EMPTY_ELEMENT_WITH_ATTS)) {
-          result = storeAtts(parser, enc, s, &name, &bindings);
-          if (result)
-            return result;
-          poolFinish(&tempPool);
-        }
+        result = storeAtts(parser, enc, s, &name, &bindings);
+        if (result)
+          return result;
+        poolFinish(&tempPool);
         if (startElementHandler) {
           startElementHandler(handlerArg, name.str, (const XML_Char **)atts);
           noElmHandlers = XML_FALSE;
@@ -2350,8 +2335,15 @@
   /* not reached */
 }

-/* If tagNamePtr is non-null, build a real list of attributes,
-   otherwise just check the attributes for well-formedness.
+/* Precondition: all arguments must be non-NULL;
+   Purpose:
+   - normalize attributes
+   - check attributes for well-formedness
+   - generate namespace aware attribute names (URI, prefix)
+   - build list of attributes for startElementHandler
+   - default attributes
+   - process namespace declarations (check and report them)
+   - generate namespace aware element name (URI, prefix)
 */
 static enum XML_Error
 storeAtts(XML_Parser parser, const ENCODING *enc,
@@ -2372,21 +2364,20 @@
   const XML_Char *localPart;

   /* lookup the element type name */
-  if (tagNamePtr) {
-    elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0);
-    if (!elementType) {
-      const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
-      if (!name)
-        return XML_ERROR_NO_MEMORY;
-      elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name,
-                                           sizeof(ELEMENT_TYPE));
-      if (!elementType)
-        return XML_ERROR_NO_MEMORY;
-      if (ns && !setElementTypePrefix(parser, elementType))
-        return XML_ERROR_NO_MEMORY;
-    }
-    nDefaultAtts = elementType->nDefaultAtts;
-  }
+  elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0);
+  if (!elementType) {
+    const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str);
+    if (!name)
+      return XML_ERROR_NO_MEMORY;
+    elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name,
+                                         sizeof(ELEMENT_TYPE));
+    if (!elementType)
+      return XML_ERROR_NO_MEMORY;
+    if (ns && !setElementTypePrefix(parser, elementType))
+      return XML_ERROR_NO_MEMORY;
+  }
+  nDefaultAtts = elementType->nDefaultAtts;
+
   /* get the attributes from the tokenizer */
   n = XmlGetAttributes(enc, attStr, attsSize, atts);
   if (n + nDefaultAtts > attsSize) {
@@ -2400,6 +2391,7 @@
     if (n > oldAttsSize)
       XmlGetAttributes(enc, attStr, n, atts);
   }
+
   appAtts = (const XML_Char **)atts;
   for (i = 0; i < n; i++) {
     /* add the name and value to the attribute list */
@@ -2437,14 +2429,10 @@
                                    &tempPool);
       if (result)
         return result;
-      if (tagNamePtr) {
-        appAtts[attIndex] = poolStart(&tempPool);
-        poolFinish(&tempPool);
-      }
-      else
-        poolDiscard(&tempPool);
-    }
-    else if (tagNamePtr) {
+      appAtts[attIndex] = poolStart(&tempPool);
+      poolFinish(&tempPool);
+    }
+    else {
       /* the value did not need normalizing */
       appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr,
                                           atts[i].valueEnd);
@@ -2453,7 +2441,7 @@
       poolFinish(&tempPool);
     }
     /* handle prefixed attribute names */
-    if (attId->prefix && tagNamePtr) {
+    if (attId->prefix) {
       if (attId->xmlns) {
         /* deal with namespace declarations here */
         enum XML_Error result = addBinding(parser, attId->prefix, attId,
@@ -2472,45 +2460,46 @@
     else
       attIndex++;
   }
-  if (tagNamePtr) {
-    int j;
-    nSpecifiedAtts = attIndex;
-    if (elementType->idAtt && (elementType->idAtt->name)[-1]) {
-      for (i = 0; i < attIndex; i += 2)
-        if (appAtts[i] == elementType->idAtt->name) {
-          idAttIndex = i;
-          break;
-        }
-    }
-    else
-      idAttIndex = -1;
-    /* do attribute defaulting */
-    for (j = 0; j < nDefaultAtts; j++) {
-      const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + j;
-      if (!(da->id->name)[-1] && da->value) {
-        if (da->id->prefix) {
-          if (da->id->xmlns) {
-            enum XML_Error result = addBinding(parser, da->id->prefix, da->id,
-                                               da->value, bindingsPtr);
-            if (result)
-              return result;
-          }
-          else {
-            (da->id->name)[-1] = 2;
-            nPrefixes++;
-            appAtts[attIndex++] = da->id->name;
-            appAtts[attIndex++] = da->value;
-          }
+
+  /* set-up for XML_GetSpecifiedAttributeCount and XML_GetIdAttributeIndex */
+  nSpecifiedAtts = attIndex;
+  if (elementType->idAtt && (elementType->idAtt->name)[-1]) {
+    for (i = 0; i < attIndex; i += 2)
+      if (appAtts[i] == elementType->idAtt->name) {
+        idAttIndex = i;
+        break;
+      }
+  }
+  else
+    idAttIndex = -1;
+
+  /* do attribute defaulting */
+  for (i = 0; i < nDefaultAtts; i++) {
+    const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + i;
+    if (!(da->id->name)[-1] && da->value) {
+      if (da->id->prefix) {
+        if (da->id->xmlns) {
+          enum XML_Error result = addBinding(parser, da->id->prefix, da->id,
+                                             da->value, bindingsPtr);
+          if (result)
+            return result;
         }
         else {
-          (da->id->name)[-1] = 1;
+          (da->id->name)[-1] = 2;
+          nPrefixes++;
           appAtts[attIndex++] = da->id->name;
           appAtts[attIndex++] = da->value;
         }
       }
-    }
-    appAtts[attIndex] = 0;
-  }
+      else {
+        (da->id->name)[-1] = 1;
+        appAtts[attIndex++] = da->id->name;
+        appAtts[attIndex++] = da->value;
+      }
+    }
+  }
+  appAtts[attIndex] = 0;
+
   i = 0;
   if (nPrefixes) {
     /* expand prefixed attribute names */
@@ -2555,10 +2544,9 @@
   /* clear the flags that say whether attributes were specified */
   for (; i < attIndex; i += 2)
     ((XML_Char *)(appAtts[i]))[-1] = 0;
-  if (!tagNamePtr)
-    return XML_ERROR_NONE;
   for (binding = *bindingsPtr; binding; binding = binding->nextTagBinding)
     binding->attId->name[-1] = 0;
+
   /* expand the element type name */
   if (elementType->prefix) {
     binding = elementType->prefix->binding;


[extend] Made append_result() use FixedIntegerArray to note return value
instead of RIA; PCC expects a FIA for now.

git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@42091 d31e2699-5ff4-0310-a27c-f18f2fbe73fe

--- src/extend.c
+++ src/extend.c
@@ -1048,24 +1048,25 @@
     /* Update returns_flag */
     return_flags = VTABLE_get_attr_str(interp, sig_object, return_flags_name);
     if (PMC_IS_NULL(return_flags)) {
-        return_flags = pmc_new(interp, enum_class_ResizablePMCArray);
+        return_flags = pmc_new(interp, enum_class_FixedIntegerArray);
+        VTABLE_set_integer_native(interp, return_flags, 1);
         VTABLE_set_attr_str(interp, sig_object, return_flags_name, return_flags);
     }
     switch (Parrot_str_indexed(interp, type, 0)) {
         case 'I':
-            VTABLE_push_integer(interp, return_flags, PARROT_ARG_INTVAL);
+            VTABLE_set_integer_keyed_int(interp, return_flags, 0, PARROT_ARG_INTVAL);
             VTABLE_push_integer(interp, returns, PARROT_ARG_INTVAL);
             break;
         case 'N':
-            VTABLE_push_integer(interp, return_flags, PARROT_ARG_FLOATVAL);
+            VTABLE_set_integer_keyed_int(interp, return_flags, 0, PARROT_ARG_FLOATVAL);
             VTABLE_push_integer(interp, returns, PARROT_ARG_FLOATVAL);
             break;
         case 'S':
-            VTABLE_push_integer(interp, return_flags, PARROT_ARG_STRING);
+            VTABLE_set_integer_keyed_int(interp, return_flags, 0, PARROT_ARG_STRING);
             VTABLE_push_integer(interp, returns, PARROT_ARG_STRING);
             break;
         case 'P':
-            VTABLE_push_integer(interp, return_flags, PARROT_ARG_PMC);
+            VTABLE_set_integer_keyed_int(interp, return_flags, 0, PARROT_ARG_PMC);
             VTABLE_push_integer(interp, returns, PARROT_ARG_PMC);
             break;
         default:


Fix OOM paths in extent_grow_retained().

--- src/extent.c
+++ src/extent.c
@@ -1046,8 +1046,13 @@
 	extent_init(extent, arena, ptr, alloc_size, false, NSIZES,
 	    arena_extent_sn_next(arena), extent_state_active, zeroed,
 	    committed);
-	if (ptr == NULL || extent_register_no_gdump_add(tsdn, extent)) {
+	if (ptr == NULL) {
 		extent_dalloc(tsdn, arena, extent);
+		return NULL;
+	}
+	if (extent_register_no_gdump_add(tsdn, extent)) {
+		extents_leak(tsdn, arena, r_extent_hooks,
+		    &arena->extents_retained, extent);
 		return NULL;
 	}

@@ -1070,7 +1075,8 @@
 		    leadsize, NSIZES, false, esize + trailsize, szind, slab);
 		if (extent == NULL) {
 			extent_deregister(tsdn, lead);
-			extents_leak(tsdn, arena, r_extent_hooks, false, lead);
+			extents_leak(tsdn, arena, r_extent_hooks,
+			    &arena->extents_retained, lead);
 			return NULL;
 		}
 		extent_record(tsdn, arena, r_extent_hooks,