Fixed running <path>/<binary> when building absolute path for doveconf -e.

--- src/lib-master/master-service-settings.c
+++ src/lib-master/master-service-settings.c
@@ -56,10 +56,17 @@
 master_service_exec_config(struct master_service *service, bool preserve_home)
 {
 	const char **conf_argv, *path, *const *paths, *binary_path;
+	char full_path[PATH_MAX];

 	binary_path = service->argv[0];
-	path = getenv("PATH");
-	if (*service->argv[0] != '/' && path != NULL) {
+	if (*service->argv[0] == '/') {
+		/* already have the path */
+	} else if (strchr(service->argv[0], '/') != NULL) {
+		/* relative to current directory */
+		if (realpath(service->argv[0], full_path) == NULL)
+			i_fatal("realpath(%s) failed: %m", service->argv[0]);
+		binary_path = full_path;
+	} else if ((path = getenv("PATH")) != NULL) {
 		/* we have to find our executable from path */
 		paths = t_strsplit(path, ":");
 		for (; *paths != NULL; paths++) {


Fixed fetching physical/virtual size when it wasn't already in cache.

--- src/lib-storage/index/cydir/cydir-mail.c
+++ src/lib-storage/index/cydir/cydir-mail.c
@@ -86,6 +86,7 @@
 	if (cydir_mail_stat(_mail, &st) < 0)
 		return (time_t)-1;

+	data->physical_size = data->virtual_size = st.st_size;
 	index_mail_cache_add(mail, MAIL_CACHE_PHYSICAL_FULL_SIZE,
 			     &data->physical_size, sizeof(data->physical_size));
 	return data->physical_size;


lib-storage: Give name to attachments-connector istream.

--- src/lib-storage/index/index-attachment.c
+++ src/lib-storage/index/index-attachment.c
@@ -438,6 +438,8 @@
 	}

 	input = istream_attachment_connector_finish(&conn);
+	i_stream_set_name(input, t_strdup_printf(
+		"attachments-connector(%s)", i_stream_get_name(*stream)));
 	i_stream_unref(stream);
 	*stream = input;
 	return 0;


Bugfix (#66) -fixed incorrect zero-padding scaling

--- vkFFT/vkFFT.h
+++ vkFFT/vkFFT.h
@@ -24651,7 +24651,7 @@
 			if ((app->configuration.performDCT == 4) && (app->configuration.size[axis_id] % 2 == 0)) axis->specializationConstants.fft_zeropad_Bluestein_left_write[axis_id] /= 2;
 			axis->specializationConstants.fft_zeropad_Bluestein_right_write[axis_id] = FFTPlan->actualFFTSizePerAxis[axis_id][axis_id];
 		}
-		uint64_t zeropad_r2c_multiupload_scale = ((axis_id == 0) && (axis->specializationConstants.performR2CmultiUpload = 1)) ? 2 : 1;
+		uint64_t zeropad_r2c_multiupload_scale = ((axis_id == 0) && (FFTPlan->multiUploadR2C)) ? 2 : 1;
 		if ((inverse)) {
 			if ((app->configuration.frequencyZeroPadding) && (axis_upload_id == FFTPlan->numAxisUploads[axis_id] - 1) && (reverseBluesteinMultiUpload != 1)) {
 				axis->specializationConstants.zeropad[0] = app->configuration.performZeropadding[axis_id];


Added new exit value for DNS error.

Added new exit value for DNS error.

--- simreverse.c
+++ simreverse.c
@@ -35,7 +35,8 @@

 #define SIMREVERSE_EXIT_VALID		0
 #define SIMREVERSE_EXIT_INVALID		1
-#define SIMREVERSE_EXIT_ERROR		2
+#define SIMREVERSE_EXIT_DNS_ERROR	2
+#define SIMREVERSE_EXIT_ERROR		3

     int
 main( int argc, char *argv[])
@@ -67,12 +68,14 @@
 	exit( SIMREVERSE_EXIT_INVALID );

     default:
-	if ( simta_dnsr == NULL ) {
-	    perror( "dnsr_new" );
+	if (( simta_dnsr == NULL )
+		|| ( dnsr_errno( simta_dnsr ) == DNSR_ERROR_SYSTEM )) {
+	    perror( "system error" );
+	    exit( SIMREVERSE_EXIT_ERROR );
 	} else {
-	    fprintf( stderr, "check_reverse: %s\n",
+	    fprintf( stderr, "DNS error: %s\n",
 		dnsr_err2string( dnsr_errno( simta_dnsr )));
+	    exit( SIMREVERSE_EXIT_DNS_ERROR );
 	}
-	exit( SIMREVERSE_EXIT_ERROR );
     }
 }


fixed include

fixed include

--- src/lib/ecl/attitude_fw/ecl_controller.h
+++ src/lib/ecl/attitude_fw/ecl_controller.h
@@ -51,7 +51,6 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <systemlib/perf_counter.h>
-#include <mathlib/mathlib.h>

 struct ECL_ControlData {
 	float roll;


i40e: ignore duplicate port VLAN requests

If user attempts to set a port VLAN on a VF that already has the same
port VLAN configured, the driver will go through a completely
unnecessary flurry of filter removals and filter adds. Just check for
this condition and return success instead of doing a bunch of busywork.

Change-ID: Ia1a9e83e6ed48b3f4658bc20dfc6af0cf525d54a
Signed-off-by: Mitch Williams <acfbed6236bdabd688e979c4a715822951672d73@intel.com>
Tested-by: Jim Young <6714f79d98b49f7991660ced2d12f757f3ef9ae0@intel.com>
Signed-off-by: Jeff Kirsher <87e35f5be20bb3e67f4ba6b86f5f6be3085b1b3a@intel.com>


Add a SemiFuture variant of collect

Add a SemiFuture variant of collect

Summary: At least make it possible to do things correctly.

Reviewed By: yfeldblum, LeeHowes

Differential Revision: D14426753

fbshipit-source-id: 63b3572175224dbbda828981a5c9f067a5e35f33

--- folly/futures/Future-inl.h
+++ folly/futures/Future-inl.h
@@ -1572,9 +1572,9 @@

 // TODO(T26439406): Make return SemiFuture
 template <class InputIterator>
-Future<std::vector<
+SemiFuture<std::vector<
     typename std::iterator_traits<InputIterator>::value_type::value_type>>
-collect(InputIterator first, InputIterator last) {
+collectSemiFuture(InputIterator first, InputIterator last) {
   using F = typename std::iterator_traits<InputIterator>::value_type;
   using T = typename F::value_type;

@@ -1611,15 +1611,22 @@
       }
     });
   }
-  return ctx->p.getSemiFuture().via(&InlineExecutor::instance());
+  return ctx->p.getSemiFuture();
+}
+
+template <class InputIterator>
+Future<std::vector<
+    typename std::iterator_traits<InputIterator>::value_type::value_type>>
+collect(InputIterator first, InputIterator last) {
+  return collectSemiFuture(first, last).toUnsafeFuture();
 }

 // collect (variadic)

 // TODO(T26439406): Make return SemiFuture
 template <typename... Fs>
-Future<std::tuple<typename remove_cvref_t<Fs>::value_type...>> collect(
-    Fs&&... fs) {
+SemiFuture<std::tuple<typename remove_cvref_t<Fs>::value_type...>>
+collectSemiFuture(Fs&&... fs) {
   using Result = std::tuple<typename remove_cvref_t<Fs>::value_type...>;
   struct Context {
     ~Context() {
@@ -1646,7 +1653,13 @@
         });
       },
       static_cast<Fs&&>(fs)...);
-  return ctx->p.getSemiFuture().via(&InlineExecutor::instance());
+  return ctx->p.getSemiFuture();
+}
+
+template <typename... Fs>
+Future<std::tuple<typename remove_cvref_t<Fs>::value_type...>> collect(
+    Fs&&... fs) {
+  return collectSemiFuture(std::forward<Fs>(fs)...).toUnsafeFuture();
 }

 // collectAny (iterator)


Fix build breakage in sample_packages.h.
This was broken by the earlier change whic switched GetXlsRunfilePath to
returning StatusOr.

PiperOrigin-RevId: 335979279

--- xls/examples/sample_packages.inc.h
+++ xls/examples/sample_packages.inc.h
@@ -26,11 +26,12 @@
 namespace xls {

 inline absl::StatusOr<std::vector<std::string>> GetExamplePaths() {
-  std::filesystem::path example_file_list_path =
-      GetXlsRunfilePath("xls/examples/ir_example_file_list.txt");
+  XLS_ASSIGN_OR_RETURN(
+      std::filesystem::path example_file_list_path,
+      GetXlsRunfilePath("xls/examples/ir_example_file_list.txt"));
   XLS_ASSIGN_OR_RETURN(std::string example_paths_string,
                        GetFileContents(example_file_list_path));
-  return absl::StrSplit(example_paths_string, '\n'_);
+  return absl::StrSplit(example_paths_string, '\n');
 }

 }  // namespace xls


Add necessary include file to get definition of struct sockaddr
- It seems that the Linux headers pull this in as a side effect

git-svn-id: 33ed6c3feaacb64944efc691d1ae8e09b17f2bf9@1405944 13f79535-47bb-0310-9956-ffa450edef68

--- proton-c/src/driver.c
+++ proton-c/src/driver.c
@@ -26,6 +26,7 @@
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <netdb.h>
 #include <unistd.h>
 #include <fcntl.h>


Play nice w/ small resolutions.

Play nice w/ small resolutions.

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

--- src/modules/conf_profiles/e_int_config_profiles.c
+++ src/modules/conf_profiles/e_int_config_profiles.c
@@ -1,8 +1,8 @@
 #include "e.h"

 static void *_create_data(E_Config_Dialog *cfd);
-static void  _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
-static int   _apply_cfdata(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static int _apply_cfdata(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
 static Evas_Object *_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
 static void _ilist_fill(E_Config_Dialog_Data *cfdata);
 static void _ilist_cb_selected(void *data);
@@ -17,7 +17,6 @@
 static void _new_profile_cb_ok(void *data, E_Dialog *dia);
 static void _new_profile_cb_dia_del(void *obj);

-
 struct _E_Config_Dialog_Data
 {
    E_Config_Dialog *cfd;
@@ -52,9 +51,8 @@
    v->basic.apply_cfdata = _apply_cfdata;
    v->basic.create_widgets = _create_widgets;

-   cfd = e_config_dialog_new(con,
-			     _("Profile Selector"),
-			     "E", "settings/profiles",
+   cfd = e_config_dialog_new(con, _("Profile Selector"),
+                             "E", "settings/profiles",
 			     "preferences-profiles", 0, v, NULL);
    e_config_dialog_changed_auto_set(cfd, 0);
    return cfd;
@@ -107,7 +105,7 @@

    of = e_widget_framelist_add(evas, _("Available Profiles"), 0);
    cfdata->o_list = e_widget_ilist_add(evas, 24, 24, &(cfdata->sel_profile));
-   e_widget_size_min_set(cfdata->o_list, 140 * e_scale, 100 * e_scale);
+   e_widget_size_min_set(cfdata->o_list, 140 * e_scale, 80 * e_scale);
    e_widget_framelist_object_append(of, cfdata->o_list);

    cfdata->o_textlabel = e_widget_label_add(evas, "");
@@ -127,16 +125,18 @@
 					 1, 1, /* fill */
 					 1, 0, /* expand */
 					 0.5, 0.5, /* align */
-					 140 * e_scale, 80 * e_scale, /* min */
+					 140 * e_scale, 60 * e_scale, /* min */
 					 99999, 99999 /* max */
 					 );

    ot = e_widget_table_add(evas, 0);
    ob = e_widget_button_add(evas, _("Add"), "list-add", _cb_add, cfdata, NULL);
    e_widget_table_object_append(ot, ob, 0, 0, 1, 1, 1, 1, 0, 0);
-   cfdata->o_delete = e_widget_button_add(evas, _("Delete"), "list-remove", _cb_delete, cfdata, NULL);
+   cfdata->o_delete = e_widget_button_add(evas, _("Delete"), "list-remove",
+                                          _cb_delete, cfdata, NULL);
    e_widget_table_object_append(ot, cfdata->o_delete, 1, 0, 1, 1, 1, 1, 0, 0);
-   cfdata->o_reset = e_widget_button_add(evas, _("Reset"), "system-restart", _cb_reset, cfdata, NULL);
+   cfdata->o_reset = e_widget_button_add(evas, _("Reset"), "system-restart",
+                                         _cb_reset, cfdata, NULL);
    e_widget_table_object_align_append(ot, cfdata->o_reset, 2, 0, 1, 1, 0, 1, 1, 1, 1.0, 0.5);

    e_widget_list_object_append(o, of, 1, 1, 0.5);


Batterytech - fixed android GL1 build issue

--- src/batterytech/src/batterytech/platform/platformgl.h
+++ src/batterytech/src/batterytech/platform/platformgl.h
@@ -15,92 +15,92 @@
 	#include <GLES2/gl2ext.h>
 	#ifdef NO_GLES2_LIB
 		// If NO_GLES2_LIB is defined, we have all of the GLES2 functions link to empty functions in boot since they won't be called anyway
-		extern          glAttachShader (GLuint program, GLuint shader);
-		extern          glBindAttribLocation (GLuint program, GLuint index, const char* name);
-		extern          glBindFramebuffer (GLenum target, GLuint framebuffer);
-		extern          glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-		extern          glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-		extern          glBlendEquation ( GLenum mode );
-		extern          glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-		extern          glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-		extern          glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage);
-		extern          glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
+		extern void     glAttachShader (GLuint program, GLuint shader);
+		extern void     glBindAttribLocation (GLuint program, GLuint index, const char* name);
+		extern void     glBindFramebuffer (GLenum target, GLuint framebuffer);
+		extern void     glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+		extern void     glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+		extern void     glBlendEquation ( GLenum mode );
+		extern void     glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+		extern void     glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+		extern void     glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage);
+		extern void     glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
 		extern GLenum   glCheckFramebufferStatus (GLenum target);
-		extern          glCompileShader (GLuint shader);
+		extern void     glCompileShader (GLuint shader);
 		extern GLuint   glCreateProgram (void);
 		extern GLuint   glCreateShader (GLenum type);
-		extern          glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
-		extern          glDeleteProgram (GLuint program);
-		extern          glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
-		extern          glDeleteShader (GLuint shader);
-		extern          glDetachShader (GLuint program, GLuint shader);
-		extern          glDisableVertexAttribArray (GLuint index);
-		extern          glEnableVertexAttribArray (GLuint index);
-		extern          glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-		extern          glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-		extern          glGenFramebuffers (GLsizei n, GLuint* framebuffers);
-		extern          glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
-		extern          glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
-		extern          glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
-		extern          glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+		extern void     glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
+		extern void     glDeleteProgram (GLuint program);
+		extern void     glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
+		extern void     glDeleteShader (GLuint shader);
+		extern void     glDetachShader (GLuint program, GLuint shader);
+		extern void     glDisableVertexAttribArray (GLuint index);
+		extern void     glEnableVertexAttribArray (GLuint index);
+		extern void     glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+		extern void     glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+		extern void     glGenFramebuffers (GLsizei n, GLuint* framebuffers);
+		extern void     glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
+		extern void     glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+		extern void     glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+		extern void     glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
 		extern int      glGetAttribLocation (GLuint program, const char* name);
-		extern          glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
-		extern          glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-		extern          glGetProgramiv (GLuint program, GLenum pname, GLint* params);
-		extern          glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
-		extern          glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
-		extern          glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
-		extern          glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
-		extern          glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
-		extern          glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
-		extern          glGetUniformfv (GLuint program, GLint location, GLfloat* params);
-		extern          glGetUniformiv (GLuint program, GLint location, GLint* params);
+		extern void     glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
+		extern void     glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+		extern void     glGetProgramiv (GLuint program, GLenum pname, GLint* params);
+		extern void     glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
+		extern void     glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
+		extern void     glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
+		extern void     glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
+		extern void     glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+		extern void     glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
+		extern void     glGetUniformfv (GLuint program, GLint location, GLfloat* params);
+		extern void     glGetUniformiv (GLuint program, GLint location, GLint* params);
 		extern int      glGetUniformLocation (GLuint program, const char* name);
-		extern          glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
-		extern          glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
-		extern          glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer);
+		extern void     glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
+		extern void     glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
+		extern void     glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer);
 		extern GLboolean     glIsFramebuffer (GLuint framebuffer);
 		extern GLboolean     glIsProgram (GLuint program);
 		extern GLboolean     glIsRenderbuffer (GLuint renderbuffer);
 		extern GLboolean     glIsShader (GLuint shader);
-		extern          glLinkProgram (GLuint program);
-		extern          glReleaseShaderCompiler (void);
-		extern          glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-		extern          glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
-		extern          glShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length);
-		extern          glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-		extern          glStencilMaskSeparate (GLenum face, GLuint mask);
-		extern          glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
-		extern          glUniform1f (GLint location, GLfloat x);
-		extern          glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
-		extern          glUniform1i (GLint location, GLint x);
-		extern          glUniform1iv (GLint location, GLsizei count, const GLint* v);
-		extern          glUniform2f (GLint location, GLfloat x, GLfloat y);
-		extern          glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
-		extern          glUniform2i (GLint location, GLint x, GLint y);
-		extern          glUniform2iv (GLint location, GLsizei count, const GLint* v);
-		extern          glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
-		extern          glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
-		extern          glUniform3i (GLint location, GLint x, GLint y, GLint z);
-		extern          glUniform3iv (GLint location, GLsizei count, const GLint* v);
-		extern          glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-		extern          glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
-		extern          glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
-		extern          glUniform4iv (GLint location, GLsizei count, const GLint* v);
-		extern          glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-		extern          glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-		extern          glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-		extern          glUseProgram (GLuint program);
-		extern          glValidateProgram (GLuint program);
-		extern          glVertexAttrib1f (GLuint indx, GLfloat x);
-		extern          glVertexAttrib1fv (GLuint indx, const GLfloat* values);
-		extern          glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
-		extern          glVertexAttrib2fv (GLuint indx, const GLfloat* values);
-		extern          glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
-		extern          glVertexAttrib3fv (GLuint indx, const GLfloat* values);
-		extern          glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-		extern          glVertexAttrib4fv (GLuint indx, const GLfloat* values);
-		extern          glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
+		extern void     glLinkProgram (GLuint program);
+		extern void     glReleaseShaderCompiler (void);
+		extern void     glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+		extern void     glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
+		extern void     glShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length);
+		extern void     glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+		extern void     glStencilMaskSeparate (GLenum face, GLuint mask);
+		extern void     glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+		extern void     glUniform1f (GLint location, GLfloat x);
+		extern void     glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
+		extern void     glUniform1i (GLint location, GLint x);
+		extern void     glUniform1iv (GLint location, GLsizei count, const GLint* v);
+		extern void     glUniform2f (GLint location, GLfloat x, GLfloat y);
+		extern void     glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
+		extern void     glUniform2i (GLint location, GLint x, GLint y);
+		extern void     glUniform2iv (GLint location, GLsizei count, const GLint* v);
+		extern void     glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
+		extern void     glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
+		extern void     glUniform3i (GLint location, GLint x, GLint y, GLint z);
+		extern void     glUniform3iv (GLint location, GLsizei count, const GLint* v);
+		extern void     glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+		extern void     glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
+		extern void     glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
+		extern void     glUniform4iv (GLint location, GLsizei count, const GLint* v);
+		extern void     glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+		extern void     glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+		extern void     glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+		extern void     glUseProgram (GLuint program);
+		extern void     glValidateProgram (GLuint program);
+		extern void     glVertexAttrib1f (GLuint indx, GLfloat x);
+		extern void     glVertexAttrib1fv (GLuint indx, const GLfloat* values);
+		extern void     glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
+		extern void     glVertexAttrib2fv (GLuint indx, const GLfloat* values);
+		extern void     glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+		extern void     glVertexAttrib3fv (GLuint indx, const GLfloat* values);
+		extern void     glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+		extern void     glVertexAttrib4fv (GLuint indx, const GLfloat* values);
+		extern void     glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
 	#endif /* NO_GLES2_LIB */
 #endif /* ANDROID_NDK */


Bugfix (#53)

Bugfix (#53)

--- vkFFT/vkFFT.h
+++ vkFFT/vkFFT.h
@@ -20970,8 +20970,6 @@
 				app->configuration.kernelOffset = launchParams->kernelOffset;
 				performOffsetUpdate = 1;
 			}
-			if (app->configuration.inputBufferOffset == 0) app->configuration.inputBufferOffset = app->configuration.bufferOffset;
-			if (app->configuration.outputBufferOffset == 0) app->configuration.outputBufferOffset = app->configuration.bufferOffset;
 		}
 	}
 	if (planStage) {


brcmfmac: Fix set and get tx-power functions.

Implementation of tx-power (get and set) related functions are
still assuming mW interface. This is wrong as functions use dbm
(or mbm) nowadays. As a result a tx power configuration could
result in wrong power configuration.

Reviewed-by: Arend Van Spriel <06447fbe43693466d3293d0b5eaeeb2efd3d7d3a@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <c740ae0f5dfc9bd2203ae1a0d3155a31e94c745d@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <d101f7ec36e185d305862a92a05a9a0c1b62aa38@broadcom.com>
Signed-off-by: Hante Meuleman <31ca5aa57e9f47a38c33f2797b138069dfa82656@broadcom.com>
Signed-off-by: Arend van Spriel <06447fbe43693466d3293d0b5eaeeb2efd3d7d3a@broadcom.com>
Signed-off-by: Kalle Valo <7081a7d99b8c74c0698a728df19e3915a995d7e1@codeaurora.org>


Add more docs

Add more docs

--- src/lib/renderer/enesim_renderer_shape.c
+++ src/lib/renderer/enesim_renderer_shape.c
@@ -644,6 +644,11 @@
 /*============================================================================*
  *                                   API                                      *
  *============================================================================*/
+/**
+ * Sets the stroke weight of a shape renderer
+ * @param[in] r The shape renderer to set the stroke weight on
+ * @param[in] weight The stroke weight to set
+ */
 EAPI void enesim_renderer_shape_stroke_weight_set(Enesim_Renderer *r, double weight)
 {
 	Enesim_Renderer_Shape *thiz;
@@ -655,6 +660,11 @@
 	thiz->state.changed = EINA_TRUE;
 }

+/**
+ * Gets the stroke weight of a shape renderer
+ * @param[in] r The shape renderer to get the stroke weight from
+ * @return The stroke weight
+ */
 EAPI double enesim_renderer_shape_stroke_weight_get(Enesim_Renderer *r)
 {
 	Enesim_Renderer_Shape *thiz;


layers: Delete some dead structs in CV

layers: Delete some dead structs in CV

Signed-off-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

--- layers/core_validation.h
+++ layers/core_validation.h
@@ -110,23 +110,7 @@
     VkImage image;
     VkDeviceMemory mem;
 };
-
-struct MT_DESCRIPTOR_SET_INFO {
-    std::vector<VkImageView> images;
-    std::vector<VkBuffer> buffers;
-};
-
-// Track Swapchain Information
-struct MT_SWAP_CHAIN_INFO {
-    VkSwapchainCreateInfoKHR createInfo;
-    std::vector<VkImage> images;
-};
-#endif
-
-struct SHADER_DS_MAPPING {
-    uint32_t slotCount;
-    VkDescriptorSetLayoutCreateInfo *pShaderMappingSlot;
-};
+#endif

 struct GENERIC_HEADER {
     VkStructureType sType;
@@ -197,12 +181,6 @@
     FRAMEBUFFER_NODE(VkFramebuffer fb, const VkFramebufferCreateInfo *pCreateInfo, const VkRenderPassCreateInfo *pRPCI)
         : framebuffer(fb), createInfo(pCreateInfo), renderPassCreateInfo(pRPCI){};
 };
-
-typedef struct stencil_data {
-    uint32_t compareMask;
-    uint32_t writeMask;
-    uint32_t reference;
-} CBStencilData;

 // Track command pools and their command buffers
 struct COMMAND_POOL_NODE : public BASE_NODE {


updated comment

updated comment

--- sequential/pr.h
+++ sequential/pr.h
@@ -7,6 +7,7 @@
 /*
     Calculates the page rank of all the verticies in the given graph, returning
     a map of Nodes to their PageRank value. Assumes that the graph is directed.
+    The sum of all page ranks is 1.0.

     Reutrns 0 on success, <0 on error.
 */


...EJB

...EJB


always opstat SQL

always opstat SQL

--- slashd/mds.c
+++ slashd/mds.c
@@ -617,8 +617,8 @@
 		bml->bml_flags |= BML_ASSFAIL; // XXX bml locked?

 		r = libsl_id2res(iosid);
-		psclog_warnx("unable to contact IOS %#x (%s) for lease",
-		    iosid, r ? r->res_name : NULL);
+		psclog_warnx("unable to contact IOS %#x (pref_ios=%s) "
+		    "for lease", iosid, r ? r->res_name : NULL);

 		return (-SLERR_ION_OFFLINE);
 	}
@@ -2375,12 +2375,12 @@

 	n = sqlite3_bind_parameter_count(sth->sth_sth);
 	va_start(ap, fmt);
-	log = psc_log_getlevel(pci->pci_subsys) >= PLL_DEBUG;
+	log = psc_log_shouldlog(pci, PLL_DEBUG);
 	if (log) {
 		strlcpy(dbuf, fmt, sizeof(dbuf));
 		dbuf_off = strlen(fmt);
-		PFL_GETTIMEVAL(&tv0);
-	}
+	}
+	PFL_GETTIMEVAL(&tv0);
 	for (j = 0; j < n; j++) {
 		type = va_arg(ap, int);
 		switch (type) {
@@ -2442,14 +2442,13 @@
 	} while (rc == SQLITE_ROW || rc == SQLITE_BUSY ||
 	    rc == SQLITE_LOCKED);

-	if (log) {
-		PFL_GETTIMEVAL(&tv);
-		timersub(&tv, &tv0, &tvd);
-		OPSTAT_ADD("sql-wait-usecs",
-		    tvd.tv_sec * 1000000 + tvd.tv_usec);
+	PFL_GETTIMEVAL(&tv);
+	timersub(&tv, &tv0, &tvd);
+	OPSTAT_ADD("sql-wait-usecs",
+	    tvd.tv_sec * 1000000 + tvd.tv_usec);
+	if (log)
 		psclog_debug("ran SQL in %.2fs: %s", tvd.tv_sec +
 		    tvd.tv_usec / 1000000.0, dbuf);
-	}

 	if (rc != SQLITE_DONE)
 		psclog_errorx("SQL error: rc=%d query=%s; msg=%s", rc,


rply: Guard against locales with different decimal point separators

rply was using strtod and printf with "%g" which would mean that the
format of the PLY files would depend on the locale. This fixes it to
use g_ascii_strtod and g_ascii_formatd so that the decimal point will
be corrected to consistently use '.' as the separator.

--- mash/rply/rply.c
+++ mash/rply/rply.c
@@ -1243,13 +1243,17 @@
 }

 static int oascii_float32(p_ply ply, double value) {
+    char buf[G_ASCII_DTOSTR_BUF_SIZE];
     if (value < -FLT_MAX || value > FLT_MAX) return 0;
-    return fprintf(ply->fp, "%g ", (float) value) > 0;
+    return fprintf(ply->fp, "%s ",
+                   g_ascii_formatd(buf, sizeof (buf), "%g", (float) value)) > 0;
 }

 static int oascii_float64(p_ply ply, double value) {
+    char buf[G_ASCII_DTOSTR_BUF_SIZE];
     if (value < -DBL_MAX || value > DBL_MAX) return 0;
-    return fprintf(ply->fp, "%g ", value) > 0;
+    return fprintf(ply->fp, "%s ",
+                   g_ascii_formatd(buf, sizeof (buf), "%g", value)) > 0;
 }

 static int obinary_int8(p_ply ply, double value) {
@@ -1352,7 +1356,7 @@
 static int iascii_float32(p_ply ply, double *value) {
     char *end;
     if (!ply_read_word(ply)) return 0;
-    *value = strtod(BWORD(ply), &end);
+    *value = g_ascii_strtod(BWORD(ply), &end);
     if (*end || *value < -FLT_MAX || *value > FLT_MAX) return 0;
     return 1;
 }
@@ -1360,7 +1364,7 @@
 static int iascii_float64(p_ply ply, double *value) {
     char *end;
     if (!ply_read_word(ply)) return 0;
-    *value = strtod(BWORD(ply), &end);
+    *value = g_ascii_strtod(BWORD(ply), &end);
     if (*end || *value < -DBL_MAX || *value > DBL_MAX) return 0;
     return 1;
 }


brcmfmac: consolidate mac_descriptor related function names

Just cleaning up and being consistent in naming operations
related to struct brcmf_fws_mac_descriptor objects.

Reviewed-by: Hante Meuleman <31ca5aa57e9f47a38c33f2797b138069dfa82656@broadcom.com>
Signed-off-by: Arend van Spriel <06447fbe43693466d3293d0b5eaeeb2efd3d7d3a@broadcom.com>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>

--- drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -631,8 +631,8 @@
 			  desc->interface_id);
 }

-static void brcmf_fws_init_mac_descriptor(struct brcmf_fws_mac_descriptor *desc,
-					  u8 *addr, u8 ifidx)
+static void brcmf_fws_macdesc_init(struct brcmf_fws_mac_descriptor *desc,
+				   u8 *addr, u8 ifidx)
 {
 	brcmf_dbg(TRACE,
 		  "enter: desc %p ea=%pM, ifidx=%u\n", desc, addr, ifidx);
@@ -648,7 +648,7 @@
 }

 static
-void brcmf_fws_clear_mac_descriptor(struct brcmf_fws_mac_descriptor *desc)
+void brcmf_fws_macdesc_deinit(struct brcmf_fws_mac_descriptor *desc)
 {
 	brcmf_dbg(TRACE,
 		  "enter: ea=%pM, ifidx=%u\n", desc->ea, desc->interface_id);
@@ -659,7 +659,7 @@
 }

 static struct brcmf_fws_mac_descriptor *
-brcmf_fws_mac_descriptor_lookup(struct brcmf_fws_info *fws, u8 *ea)
+brcmf_fws_macdesc_lookup(struct brcmf_fws_info *fws, u8 *ea)
 {
 	struct brcmf_fws_mac_descriptor *entry;
 	int i;
@@ -678,8 +678,7 @@
 }

 static struct brcmf_fws_mac_descriptor*
-brcmf_fws_find_mac_desc(struct brcmf_fws_info *fws, struct brcmf_if *ifp,
-			u8 *da)
+brcmf_fws_macdesc_find(struct brcmf_fws_info *fws, struct brcmf_if *ifp, u8 *da)
 {
 	struct brcmf_fws_mac_descriptor *entry = &fws->desc.other;
 	bool multicast;
@@ -695,7 +694,7 @@
 		goto done;
 	}

-	entry = brcmf_fws_mac_descriptor_lookup(fws, da);
+	entry = brcmf_fws_macdesc_lookup(fws, da);
 	if (IS_ERR(entry))
 		entry = ifp->fws_desc;

@@ -703,9 +702,9 @@
 	return entry;
 }

-static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_info *fws,
-				      struct brcmf_fws_mac_descriptor *entry,
-				      int fifo)
+static bool brcmf_fws_macdesc_closed(struct brcmf_fws_info *fws,
+				     struct brcmf_fws_mac_descriptor *entry,
+				     int fifo)
 {
 	struct brcmf_fws_mac_descriptor *if_entry;
 	bool closed;
@@ -728,9 +727,9 @@
 	return closed || !(entry->ac_bitmap & BIT(fifo));
 }

-static void brcmf_fws_mac_desc_cleanup(struct brcmf_fws_info *fws,
-				       struct brcmf_fws_mac_descriptor *entry,
-				       int ifidx)
+static void brcmf_fws_macdesc_cleanup(struct brcmf_fws_info *fws,
+				      struct brcmf_fws_mac_descriptor *entry,
+				      int ifidx)
 {
 	if (entry->occupied && (ifidx == -1 || ifidx == entry->interface_id)) {
 		brcmf_fws_psq_flush(fws, &entry->psq, ifidx);
@@ -782,9 +781,9 @@
 	/* cleanup individual nodes */
 	table = &fws->desc.nodes[0];
 	for (i = 0; i < ARRAY_SIZE(fws->desc.nodes); i++)
-		brcmf_fws_mac_desc_cleanup(fws, &table[i], ifidx);
-
-	brcmf_fws_mac_desc_cleanup(fws, &fws->desc.other, ifidx);
+		brcmf_fws_macdesc_cleanup(fws, &table[i], ifidx);
+
+	brcmf_fws_macdesc_cleanup(fws, &fws->desc.other, ifidx);
 	brcmf_fws_bus_txq_cleanup(fws, matchfn, ifidx);
 	brcmf_fws_hanger_cleanup(fws, matchfn, ifidx);
 }
@@ -924,18 +923,18 @@
 		if (entry->occupied) {
 			brcmf_dbg(TRACE, "deleting %s mac %pM\n",
 				  entry->name, addr);
-			brcmf_fws_mac_desc_cleanup(fws, entry, -1);
-			brcmf_fws_clear_mac_descriptor(entry);
+			brcmf_fws_macdesc_cleanup(fws, entry, -1);
+			brcmf_fws_macdesc_deinit(entry);
 		} else
 			fws->stats.mac_update_failed++;
 		return 0;
 	}

-	existing = brcmf_fws_mac_descriptor_lookup(fws, addr);
+	existing = brcmf_fws_macdesc_lookup(fws, addr);
 	if (IS_ERR(existing)) {
 		if (!entry->occupied) {
 			entry->mac_handle = mac_handle;
-			brcmf_fws_init_mac_descriptor(entry, addr, ifidx);
+			brcmf_fws_macdesc_init(entry, addr, ifidx);
 			brcmf_fws_macdesc_set_name(fws, entry);
 			brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT,
 					BRCMF_FWS_PSQ_LEN);
@@ -949,7 +948,7 @@
 			memcpy(entry, existing,
 			       offsetof(struct brcmf_fws_mac_descriptor, psq));
 			entry->mac_handle = mac_handle;
-			brcmf_fws_clear_mac_descriptor(existing);
+			brcmf_fws_macdesc_deinit(existing);
 			brcmf_fws_macdesc_set_name(fws, entry);
 			brcmf_dbg(TRACE, "relocate %s mac %pM\n", entry->name,
 				  addr);
@@ -1189,7 +1188,7 @@
 	for (i = 0; i < num_nodes; i++) {
 		entry = &table[(node_pos + i) % num_nodes];
 		if (!entry->occupied ||
-		    brcmf_fws_mac_desc_closed(fws, entry, fifo))
+		    brcmf_fws_macdesc_closed(fws, entry, fifo))
 			continue;

 		if (entry->suppressed)
@@ -1810,7 +1809,7 @@

 	/* set control buffer information */
 	skcb->if_flags = 0;
-	skcb->mac = brcmf_fws_find_mac_desc(fws, ifp, eh->h_dest);
+	skcb->mac = brcmf_fws_macdesc_find(fws, ifp, eh->h_dest);
 	skcb->state = BRCMF_FWS_SKBSTATE_NEW;
 	brcmf_skb_if_flags_set_field(skb, INDEX, ifp->ifidx);
 	if (!multicast)
@@ -1828,7 +1827,7 @@

 	if (skcb->mac->suppressed ||
 	    fws->bus_flow_blocked ||
-	    brcmf_fws_mac_desc_closed(fws, skcb->mac, fifo) ||
+	    brcmf_fws_macdesc_closed(fws, skcb->mac, fifo) ||
 	    brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) ||
 	    (!multicast &&
 	     brcmf_fws_consume_credit(fws, fifo, skb) < 0)) {
@@ -1850,7 +1849,7 @@
 	if (!entry)
 		return;

-	brcmf_fws_init_mac_descriptor(entry, ifp->mac_addr, ifp->ifidx);
+	brcmf_fws_macdesc_init(entry, ifp->mac_addr, ifp->ifidx);
 }

 void brcmf_fws_add_interface(struct brcmf_if *ifp)
@@ -1863,7 +1862,7 @@

 	entry = &fws->desc.iface[ifp->ifidx];
 	ifp->fws_desc = entry;
-	brcmf_fws_init_mac_descriptor(entry, ifp->mac_addr, ifp->ifidx);
+	brcmf_fws_macdesc_init(entry, ifp->mac_addr, ifp->ifidx);
 	brcmf_fws_macdesc_set_name(fws, entry);
 	brcmu_pktq_init(&entry->psq, BRCMF_FWS_PSQ_PREC_COUNT,
 			BRCMF_FWS_PSQ_LEN);
@@ -1881,7 +1880,7 @@
 	brcmf_fws_lock(ifp->drvr, flags);
 	ifp->fws_desc = NULL;
 	brcmf_dbg(TRACE, "deleting %s\n", entry->name);
-	brcmf_fws_clear_mac_descriptor(entry);
+	brcmf_fws_macdesc_deinit(entry);
 	brcmf_fws_cleanup(ifp->drvr->fws, ifp->ifidx);
 	brcmf_fws_unlock(ifp->drvr, flags);
 }
@@ -1986,7 +1985,7 @@
 	}

 	brcmf_fws_hanger_init(&drvr->fws->hanger);
-	brcmf_fws_init_mac_descriptor(&drvr->fws->desc.other, NULL, 0);
+	brcmf_fws_macdesc_init(&drvr->fws->desc.other, NULL, 0);
 	brcmf_fws_macdesc_set_name(drvr->fws, &drvr->fws->desc.other);
 	brcmu_pktq_init(&drvr->fws->desc.other.psq, BRCMF_FWS_PSQ_PREC_COUNT,
 			BRCMF_FWS_PSQ_LEN);


layers: Fix vkCreateDescriptorPool max allocation sizes for each type

VkDescriptorPoolSize array can contain more than one of same VkDescriptorType

--- layers/core_validation.h
+++ layers/core_validation.h
@@ -690,7 +690,7 @@

     _DESCRIPTOR_POOL_NODE(const VkDescriptorPool pool, const VkDescriptorPoolCreateInfo *pCreateInfo)
         : pool(pool), maxSets(pCreateInfo->maxSets), availableSets(pCreateInfo->maxSets), createInfo(*pCreateInfo), pSets(NULL),
-          maxDescriptorTypeCount(VK_DESCRIPTOR_TYPE_RANGE_SIZE), availableDescriptorTypeCount(VK_DESCRIPTOR_TYPE_RANGE_SIZE) {
+          maxDescriptorTypeCount(VK_DESCRIPTOR_TYPE_RANGE_SIZE, 0), availableDescriptorTypeCount(VK_DESCRIPTOR_TYPE_RANGE_SIZE, 0) {
         if (createInfo.poolSizeCount) { // Shadow type struct from ptr into local struct
             size_t poolSizeCountSize = createInfo.poolSizeCount * sizeof(VkDescriptorPoolSize);
             createInfo.pPoolSizes = new VkDescriptorPoolSize[poolSizeCountSize];
@@ -699,7 +699,8 @@
             uint32_t i = 0;
             for (i = 0; i < createInfo.poolSizeCount; ++i) {
                 uint32_t typeIndex = static_cast<uint32_t>(createInfo.pPoolSizes[i].type);
-                maxDescriptorTypeCount[typeIndex] = createInfo.pPoolSizes[i].descriptorCount;
+				// Same descriptor types can appear several times
+                maxDescriptorTypeCount[typeIndex] += createInfo.pPoolSizes[i].descriptorCount;
                 availableDescriptorTypeCount[typeIndex] = maxDescriptorTypeCount[typeIndex];
             }
         } else {


Fix mxnet ctc_loss bug (#11834)

Fix mxnet ctc_loss bug (#11834)

* fix ctc_loss GPU bug

* add blank_label parameter for CTCLoss

* Revert "add blank_label parameter for CTCLoss"

This reverts commit aab11f7575580f88f5f27be14466d0deb4b4c456.

--- src/operator/contrib/ctc_include/detail/gpu_ctc.h
+++ src/operator/contrib/ctc_include/detail/gpu_ctc.h
@@ -411,12 +411,7 @@
         denoms_, out_dim_, num_elements);

     // compute denominators for softmax
-    denoms_handle = reduce_with_axis<red::sum, false>(
-        F<mxnet::op::mshadow_op::exp>(
-            log_probs_handle -
-            broadcast<0>(reduce_with_axis<red::maximum, false>(log_probs_handle, 1),
-                         log_probs_handle.shape_)),
-        1);
+    denoms_handle = reduce_with_axis<red::sum, false>(F<mxnet::op::mshadow_op::exp>(log_probs_handle), 1);

     // Kernel launch to calculate probabilities
     compute_log_probs_kernel<ProbT, VT><<<grid_size, NT, 0, stream_>>>


tidy

tidy

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@23901 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/mds.c
+++ slashd/mds.c
@@ -595,11 +595,13 @@
 		BMAP_ULOCK(b);
 		bml->bml_flags |= BML_ASSFAIL;

-		psclog_warnx("unable to contact ION %#x for lease", pios);
+		psclog_warnx("unable to contact ION %#x for lease",
+		    pios);

 		return (-SLERR_ION_OFFLINE);
-	} else
-		BMAP_ULOCK(b);
+	}
+
+	BMAP_ULOCK(b);

 	bmi->bmi_wr_ion = rmmi = resm2rmmi(resm);
 	atomic_inc(&rmmi->rmmi_refcnt);


brcmfmac: Accept only first creditmap event.

During P2P testing it turned out that the firmware sents multiple
multiple creditmap event messages. Only the first message from the
firmware should be processed. Otherwise the firmware-signalled flow
control can run haywire when it has packets outstanding in firmware.

Reviewed-by: Arend Van Spriel <06447fbe43693466d3293d0b5eaeeb2efd3d7d3a@broadcom.com>
Signed-off-by: Hante Meuleman <31ca5aa57e9f47a38c33f2797b138069dfa82656@broadcom.com>
Signed-off-by: Arend van Spriel <06447fbe43693466d3293d0b5eaeeb2efd3d7d3a@broadcom.com>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>


libtracker-data: If unable to writer journal header, delete empty file

--- src/libtracker-data/tracker-db-journal.c
+++ src/libtracker-data/tracker-db-journal.c
@@ -495,6 +495,11 @@
 		jwriter->cur_block[7] = '4';

 		if (!write_all_data (jwriter->journal, jwriter->cur_block, 8, error)) {
+			cur_block_kill (jwriter);
+			/* delete empty journal file */
+			g_unlink (jwriter->journal_filename);
+			close (jwriter->journal);
+			jwriter->journal = 0;
 			return FALSE;
 		}


dl-string.h: remove mips related guard

dl-string.h: remove mips related guard

This can't happen, __mips__ was already checked earlier

Signed-off-by: Peter S. Mazinger <1f4071d9f342c1637b13af9bc258f2ff72e96758@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <ce1ac9e9ad16abccd7821f371ad381197b4768ac@gmail.com>

--- ldso/include/dl-string.h
+++ ldso/include/dl-string.h
@@ -265,7 +265,7 @@
 /* On some arches constant strings are referenced through the GOT.
  * This requires that load_addr must already be defined... */
 #if defined(mc68000)  || defined(__arm__) || defined(__thumb__) || \
-    defined(__mips__) || defined(__sh__)  || defined(__powerpc__) || \
+    defined(__sh__) || defined(__powerpc__) || \
     defined(__avr32__) || defined(__xtensa__) || defined(__sparc__) || defined(__microblaze__)
 # define CONSTANT_STRING_GOT_FIXUP(X) \
 	if ((X) < (const char *) load_addr) (X) += load_addr


--- vpi/sys_vcd.c
+++ vpi/sys_vcd.c
@@ -17,7 +17,7 @@
  *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 #if !defined(WINNT)
-#ident "$Id: sys_vcd.c,v 1.5 2000/01/23 23:54:36 steve Exp $"
+#ident "$Id: sys_vcd.c,v 1.6 2000/02/17 06:04:30 steve Exp $"
 #endif

 /*
@@ -146,12 +146,11 @@
       return 0;
 }

-static void scan_scope(unsigned depth, vpiHandle argv)
+static unsigned scan_scope(unsigned depth, vpiHandle argv, unsigned nident)
 {
       struct t_cb_data cb;
       struct vcd_info*info;
       char ident[64];
-      unsigned nident = 0;

       vpiHandle item;
       vpiHandle sublist;
@@ -188,7 +187,7 @@
 		case vpiModule:
 		  sublist = vpi_iterate(vpiInternalScope, item);
 		  if (sublist && (depth > 0))
-			scan_scope(depth-1, sublist);
+			nident = scan_scope(depth-1, sublist, nident);
 		  break;

 		default:
@@ -196,6 +195,8 @@
 	    }

       }
+
+      return nident;
 }

 static int sys_dumpvars_calltf(char*name)
@@ -214,7 +215,7 @@

       assert(dump_file);

-      scan_scope(99, argv);
+      scan_scope(99, argv, 0);

       fprintf(dump_file, "$enddefinitions $end\n");

@@ -257,6 +258,9 @@

 /*
  * $Log: sys_vcd.c,v $
+ * Revision 1.6  2000/02/17 06:04:30  steve
+ *  Fix overlap of identifiers when multiple modules used.
+ *
  * Revision 1.5  2000/01/23 23:54:36  steve
  *  Compile time problems with vpi_user.h
  *


use simpler logic

use simpler logic

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@24308 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/rmc.c
+++ slashd/rmc.c
@@ -323,14 +323,15 @@

 	SL_RSX_ALLOCREP(rq, mq, mp);

-	if (mq->rw != SL_WRITE)
-		OPSTAT_INCR(SLM_OPST_GET_BMAP_LEASE_READ);
-	else
-		OPSTAT_INCR(SLM_OPST_GET_BMAP_LEASE_WRITE);
 	if (mq->rw != SL_READ && mq->rw != SL_WRITE) {
 		mp->rc = -EINVAL;
 		return (0);
 	}
+
+	if (mq->rw == SL_WRITE)
+		OPSTAT_INCR(SLM_OPST_GET_BMAP_LEASE_WRITE);
+	else
+		OPSTAT_INCR(SLM_OPST_GET_BMAP_LEASE_READ);

 	mp->rc = -slm_fcmh_get(&mq->fg, &f);
 	if (mp->rc)


staging: rtl8187se: Fix commend line

staging: rtl8187se: Fix commend line

Fix commend line in ieee80211/ieee80211_wx.c as the codingStyle of the
kernel recommends.

Signed-off-by: Ana Rey <f8e8e2faffc65f8cee6706477d554bda98df43c6@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


HONEYCOMB-10: Copy context identifier from request to reply

Some of the send_*_details methods did not copy context
identifier from dump request message to details response.
The context identifier is used for request<->reply matching.

Change-Id: I8a744f3817bef94d7fa8ecb7bec6ea942c1a8793
Signed-off-by: Marek Gradzki <3ca09cd7b7147613247c2a96dcdb0ba33114f8e7@cisco.com>

--- vpp/api/api.c
+++ vpp/api/api.c
@@ -1497,7 +1497,8 @@

 static void send_bridge_domain_details (unix_shared_memory_queue_t *q,
                                         l2_bridge_domain_t * bd_config,
-                                        u32 n_sw_ifs)
+                                        u32 n_sw_ifs,
+                                        u32 context)
 {
     vl_api_bridge_domain_details_t * mp;

@@ -1512,13 +1513,15 @@
     mp->arp_term = bd_feature_arp_term (bd_config);
     mp->bvi_sw_if_index = ntohl (bd_config->bvi_sw_if_index);
     mp->n_sw_ifs = ntohl (n_sw_ifs);
+    mp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&mp);
 }

 static void send_bd_sw_if_details (l2input_main_t * l2im,
                                    unix_shared_memory_queue_t *q,
-                                   l2_flood_member_t * member, u32 bd_id)
+                                   l2_flood_member_t * member, u32 bd_id,
+                                   u32 context)
 {
     vl_api_bridge_domain_sw_if_details_t * mp;
     l2_input_config_t * input_cfg;
@@ -1530,6 +1533,7 @@
     mp->sw_if_index = ntohl (member->sw_if_index);
     input_cfg = vec_elt_at_index (l2im->configs, member->sw_if_index);
     mp->shg = input_cfg->shg;
+    mp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&mp);
 }
@@ -1561,10 +1565,10 @@
             l2_flood_member_t * m;

             n_sw_ifs = vec_len (bd_config->members);
-            send_bridge_domain_details (q, bd_config, n_sw_ifs);
+            send_bridge_domain_details (q, bd_config, n_sw_ifs, mp->context);

             vec_foreach (m, bd_config->members) {
-                send_bd_sw_if_details (l2im, q, m, bd_config->bd_id);
+                send_bd_sw_if_details (l2im, q, m, bd_config->bd_id, mp->context);
             }
         }
     }
@@ -3891,7 +3895,8 @@
                                      unix_shared_memory_queue_t * q,
                                      u8 * ip,
                                      u16 prefix_length,
-                                     u8 is_ipv6)
+                                     u8 is_ipv6,
+                                     u32 context)
 {
     vl_api_ip_address_details_t * mp;

@@ -3906,6 +3911,7 @@
         *tp = ntohl(*(u32*)ip);
     }
     mp->prefix_length = prefix_length;
+    mp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&mp);
 }
@@ -3937,7 +3943,7 @@
         ({
             r6 = ip_interface_address_get_address (lm6, ia);
             u16 prefix_length = ia->address_length;
-            send_ip_address_details(am, q, (u8*)r6, prefix_length, 1);
+            send_ip_address_details(am, q, (u8*)r6, prefix_length, 1, mp->context);
         }));
     } else {
         foreach_ip_interface_address (lm4, ia, sw_if_index,
@@ -3945,14 +3951,15 @@
         ({
             r4 = ip_interface_address_get_address (lm4, ia);
             u16 prefix_length = ia->address_length;
-            send_ip_address_details(am, q, (u8*)r4, prefix_length, 0);
+            send_ip_address_details(am, q, (u8*)r4, prefix_length, 0, mp->context);
         }));
     }
 }

 static void send_ip_details (vpe_api_main_t * am,
                                unix_shared_memory_queue_t *q,
-                               u32 sw_if_index)
+                               u32 sw_if_index,
+                               u32 context)
 {
     vl_api_ip_details_t * mp;

@@ -3961,6 +3968,7 @@
     mp->_vl_msg_id = ntohs(VL_API_IP_DETAILS);

     mp->sw_if_index = ntohl(sw_if_index);
+    mp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&mp);
 }
@@ -3987,7 +3995,8 @@

 static void send_sw_interface_tap_details (vpe_api_main_t * am,
                                        unix_shared_memory_queue_t *q,
-                                       tapcli_interface_details_t *tap_if)
+                                       tapcli_interface_details_t *tap_if,
+                                       u32 context)
 {
     vl_api_sw_interface_tap_details_t * mp;
     mp = vl_msg_api_alloc (sizeof (*mp));
@@ -3996,6 +4005,7 @@
     mp->sw_if_index = ntohl(tap_if->sw_if_index);
     strncpy((char *)mp->dev_name,
             (char *)tap_if->dev_name, ARRAY_LEN(mp->dev_name)-1);
+    mp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&mp);
 }
@@ -4019,7 +4029,7 @@
         return;

     vec_foreach(tap_if, tapifs) {
-        send_sw_interface_tap_details(am, q, tap_if);
+        send_sw_interface_tap_details(am, q, tap_if, mp->context);
     }

     vec_free(tapifs);
@@ -4052,7 +4062,7 @@
                 continue;
             }
             sw_if_index = si->sw_if_index;
-            send_ip_details(am, q, sw_if_index);
+            send_ip_details(am, q, sw_if_index, mp->context);
         }
     }
 }
@@ -4337,7 +4347,7 @@
 }

 static void send_vxlan_tunnel_details
-(vxlan_tunnel_t * t, unix_shared_memory_queue_t * q)
+(vxlan_tunnel_t * t, unix_shared_memory_queue_t * q, u32 context)
 {
     vl_api_vxlan_tunnel_details_t * rmp;
     ip4_main_t * im4 = &ip4_main;
@@ -4360,6 +4370,7 @@
     rmp->decap_next_index = htonl(t->decap_next_index);
     rmp->sw_if_index = htonl(t->sw_if_index);
     rmp->is_ipv6 = is_ipv6;
+    rmp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&rmp);
 }
@@ -4382,7 +4393,7 @@
     if (~0 == sw_if_index) {
         pool_foreach (t, vxm->tunnels,
         ({
-            send_vxlan_tunnel_details(t, q);
+            send_vxlan_tunnel_details(t, q, mp->context);
         }));
     } else {
         if ((sw_if_index >= vec_len(vxm->tunnel_index_by_sw_if_index)) ||
@@ -4390,7 +4401,7 @@
             return;
         }
         t = &vxm->tunnels[vxm->tunnel_index_by_sw_if_index[sw_if_index]];
-        send_vxlan_tunnel_details(t, q);
+        send_vxlan_tunnel_details(t, q, mp->context);
     }
 }

@@ -4437,7 +4448,7 @@
 }

 static void send_gre_tunnel_details
-(gre_tunnel_t * t, unix_shared_memory_queue_t * q)
+(gre_tunnel_t * t, unix_shared_memory_queue_t * q, u32 context)
 {
     vl_api_gre_tunnel_details_t * rmp;
     ip4_main_t * im = &ip4_main;
@@ -4449,6 +4460,7 @@
     rmp->dst_address = t->tunnel_dst.data_u32;
     rmp->outer_table_id = htonl(im->fibs[t->outer_fib_index].table_id);
     rmp->sw_if_index = htonl(t->sw_if_index);
+    rmp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&rmp);
 }
@@ -4471,7 +4483,7 @@
     if (~0 == sw_if_index) {
         pool_foreach (t, gm->tunnels,
         ({
-            send_gre_tunnel_details(t, q);
+            send_gre_tunnel_details(t, q, mp->context);
         }));
     } else {
         if ((sw_if_index >= vec_len(gm->tunnel_index_by_sw_if_index)) ||
@@ -4479,7 +4491,7 @@
             return;
         }
         t = &gm->tunnels[gm->tunnel_index_by_sw_if_index[sw_if_index]];
-        send_gre_tunnel_details(t, q);
+        send_gre_tunnel_details(t, q, mp->context);
     }
 }

@@ -4943,7 +4955,8 @@
 static void
 send_lisp_locator_set_details (lisp_cp_main_t *lcm,
                                locator_set_t *lsit,
-                               unix_shared_memory_queue_t *q)
+                               unix_shared_memory_queue_t *q,
+                               u32 context)
 {
     vl_api_lisp_locator_set_details_t *rmp;
     locator_t *loc = NULL;
@@ -4959,6 +4972,7 @@
         rmp->sw_if_index = htonl(loc->sw_if_index);
         rmp->priority = loc->priority;
         rmp->weight = loc->weight;
+        rmp->context = context;

         vl_msg_api_send_shmem (q, (u8 *)&rmp);
     }
@@ -4978,13 +4992,14 @@

     pool_foreach (lsit, lcm->locator_set_pool,
         ({
-            send_lisp_locator_set_details(lcm, lsit, q);
+            send_lisp_locator_set_details(lcm, lsit, q, mp->context);
         }));
 }

 static void
 send_lisp_local_eid_table_details (mapping_t *mapit,
-                                   unix_shared_memory_queue_t *q)
+                                   unix_shared_memory_queue_t *q,
+                                   u32 context)
 {
     vl_api_lisp_local_eid_table_details_t *rmp = NULL;
     lisp_cp_main_t * lcm = vnet_lisp_cp_get_main();
@@ -5028,6 +5043,7 @@
             ASSERT(0);
     }
     rmp->eid_prefix_len = ip_prefix_len(ip_prefix);
+    rmp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&rmp);
 }
@@ -5047,13 +5063,14 @@

     pool_foreach (mapit, lcm->mapping_pool,
         ({
-            send_lisp_local_eid_table_details(mapit, q);
+            send_lisp_local_eid_table_details(mapit, q, mp->context);
         }));
 }

 static void
 send_lisp_gpe_tunnel_details (lisp_gpe_tunnel_t *tunnel,
-                              unix_shared_memory_queue_t *q)
+                              unix_shared_memory_queue_t *q,
+                              u32 context)
 {
     vl_api_lisp_gpe_tunnel_details_t *rmp;
     lisp_gpe_main_t * lgm = &lisp_gpe_main;
@@ -5077,6 +5094,7 @@
     rmp->ver_res = tunnel->ver_res;
     rmp->res = tunnel->res;
     rmp->iid = htonl(tunnel->vni);
+    rmp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&rmp);
 }
@@ -5100,13 +5118,14 @@

     pool_foreach(tunnel, lgm->tunnels,
                  ({
-                     send_lisp_gpe_tunnel_details(tunnel, q);
+                     send_lisp_gpe_tunnel_details(tunnel, q, mp->context);
                 }));
 }

 static void
 send_lisp_map_resolver_details (ip_address_t *ip,
-                                unix_shared_memory_queue_t *q)
+                                unix_shared_memory_queue_t *q,
+                                u32 context)
 {
     vl_api_lisp_map_resolver_details_t *rmp = NULL;

@@ -5128,6 +5147,7 @@
         default:
             ASSERT(0);
     }
+    rmp->context = context;

     vl_msg_api_send_shmem (q, (u8 *)&rmp);
 }
@@ -5146,7 +5166,7 @@
     }

     vec_foreach(ip, lcm->map_resolvers) {
-        send_lisp_map_resolver_details(ip, q);
+        send_lisp_map_resolver_details(ip, q, mp->context);
     }

 }


more import work

more import work

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@17463 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/rmi.c
+++ slashd/rmi.c
@@ -398,10 +398,13 @@
 	struct srm_import_rep *mp;
 	struct slash_creds cr;
 	struct bmapc_memb *b;
+	struct srt_stat sstb;
 	struct sl_resm *m;
 	void *mdsio_data;
 	sl_bmapno_t bno;
 	uint32_t pol;
+	int64_t fsiz;
+	int i;

 	SL_RSX_ALLOCREP(rq, mq, mp);

@@ -411,9 +414,9 @@
 		goto out;
 	}

-	/* Lookup the parent directory in the cache so that the
-	 *   slash2 ino can be translated into the inode for the
-	 *   underlying fs.
+	/*
+	 * Lookup the parent directory in the cache so that the slash2
+	 * inode can be translated into the inode for the underlying fs.
 	 */
 	mp->rc = slm_fcmh_get(&mq->pfg, &p);
 	if (mp->rc)
@@ -424,7 +427,7 @@
 	mds_reserve_slot(1);
 	mp->rc = mdsio_opencreate(fcmh_2_mdsio_fid(p), &rootcreds,
 	    O_CREAT | O_EXCL | O_RDWR, mq->sstb.sst_mode, mq->cpn, NULL,
-	    NULL, &mdsio_data, mdslog_namespace, slm_get_next_slashfid,
+	    &sstb, &mdsio_data, mdslog_namespace, slm_get_next_slashfid,
 	    0);
 	mds_unreserve_slot(1);

@@ -444,7 +447,7 @@
 	if (mp->rc)
 		goto out;

-	mp->rc = slm_fcmh_get(&mq->sstb.sst_fg, &c);
+	mp->rc = slm_fcmh_get(&sstb.sst_fg, &c);
 	if (mp->rc)
 		goto out;

@@ -458,14 +461,19 @@
 	fcmh_2_ino(c)->ino_repls[0].bs_id = m->resm_iosid;
 	fcmh_2_ino(c)->ino_repl_nblks[0] = mq->sstb.sst_blocks;
 	mp->rc = mds_inode_write(fcmh_2_inoh(c), mdslog_ino_repls, c);
-
-	if (mp->rc)
-		goto out;
-
-	for (bno = 0; bno < mq->sstb.sst_size / SLASH_BMAP_SIZE; bno++) {
+	FCMH_ULOCK(c);
+	if (mp->rc)
+		goto out;
+
+	fsiz = mq->sstb.sst_size;
+	for (bno = 0; bno < howmany(mq->sstb.sst_size, SLASH_BMAP_SIZE);
+	    bno++) {
 		mp->rc = mds_bmap_load(c, bno, &b);
 		if (mp->rc)
 			goto out;
+		for (i = 0; i < SLASH_SLVRS_PER_BMAP &&
+		    fsiz > 0; fsiz -= SLASH_SLVR_SIZE, i++)
+			b->bcm_crcstates[i] |= BMAP_SLVR_DATA;
 		mp->rc = mds_repl_inv_except(b, 0);
 		if (mp->rc)
 			goto out;
@@ -474,8 +482,13 @@
 		if (mp->rc)
 			goto out;
 	}
+	mp->fg = sstb.sst_fg;

  out:
+	/*
+	 * XXX if we created the file but left it in a bad state (e.g.
+	 * no repl table), then we should unlink it...
+	 */
 	if (c)
 		fcmh_op_done_type(c, FCMH_OPCNT_LOOKUP_FIDC);
 	if (p)


better

better

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@18088 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/rmi.c
+++ slashd/rmi.c
@@ -441,9 +441,6 @@
 	if (rc == EEXIST) {
 		int rc2;

-		if (S_ISDIR(sstb.sst_mode))
-			PFL_GOTOERR(out, mp->rc = -EISDIR);
-
 		rc2 = mdsio_opencreate(fcmh_2_mdsio_fid(p), &rootcreds,
 		    O_RDWR, 0, mq->cpn, NULL, &sstb, &mdsio_data, NULL,
 		    NULL, 0);
@@ -454,6 +451,10 @@

 	mdsio_release(&cr, mdsio_data);
 	mp->fg = sstb.sst_fg;
+
+	if (S_ISDIR(sstb.sst_mode))
+		PFL_GOTOERR(out, mp->rc = -EISDIR);
+
 	mp->rc = slm_fcmh_get(&sstb.sst_fg, &c);
 	if (mp->rc)
 		goto out;


Add TMCVerbose to the list of mc classes

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@6190 27541ba8-7e3a-0410-8455-c3a389f83636

--- mc/inc/LinkDef.h
+++ mc/inc/LinkDef.h
@@ -1,4 +1,4 @@
-// @(#)root/mc:$Name:  $:$Id: LinkDef.h,v 1.2 2002/04/26 08:46:10 brun Exp $
+// @(#)root/mc:$Name:  $:$Id: LinkDef.h,v 1.2 2002/04/26 09:25:02 brun Exp $
 #ifdef __CINT__

 #pragma link off all globals;
@@ -14,6 +14,7 @@
 #pragma link C++ class  TVirtualMCApplication+;
 #pragma link C++ class  TVirtualMCStack+;
 #pragma link C++ class  TVirtualMCDecayer+;
+#pragma link C++ class  TMCVerbose+;

 #endif


Adjust to changes in Formatter#round_up.

--- source/fmt.w
+++ source/fmt.w
@@ -245,8 +245,8 @@
 For \cd{:exact} rounding, all available digits are preserved
 and rounding is only necessary, in the last digit for
 inexact quantities, that may have been flagged as needing
-a round-up of the last digit by having the value \cd{:roundup}
-in the \cd{inexact} property.
+a round-up of the last digit by having one of the values \cd{:lo}, \cd{:hi}, \cd{:tie}
+in the \cd{inexact} property.g

 ~d class NeutralNum
 ~{~%
@@ -321,7 +321,8 @@
 adj = 0
 dv = :tie
 if @inexact && n==@digits.size
-  dv = @inexact==:roundup ? :hi : :lo
+  # TODO: the combination of the value true with the values of Formatter#round_up makes this ugly
+  dv = @inexact.is_a?(Symbol) ? @inexact : :lo
 else
   v = dig_value(n)
   v2 = 2*v
@@ -330,7 +331,11 @@
   elsif v2 > @base # v>(@base/2)
     dv = :hi
   else
-   ~<Look at trailing digits and try to resolve the tie~>
+    if @inexact
+      dv = :hi
+    else
+     ~<Look at trailing digits and try to resolve the tie~>
+    end
     dv = :hi if dv==:tie && @rep_pos<=n
   end
 end
@@ -2171,7 +2176,7 @@
 # rounding should be Float.context.rounding (input rounding for Float) rather than fmt.get_round (output)
 formatter = Flt::Support::Formatter.new(Float::RADIX,  Float::MIN_EXP-Float::MANT_DIG, fmt.get_base)
 formatter.format(x, f, e, rounding, Float::MANT_DIG, fmt.get_all_digits?)
-inexact = :roundup if formatter.round_up && (fmt.get_round != :truncate)
+inexact = formatter.round_up if formatter.round_up.is_a?(Symbol)
 dec_pos, digits = formatter.digits
 txt = ''
 digits.each{|d| txt << fmt.get_base_digits.digit_char(d)}
@@ -2602,7 +2607,7 @@
 # rounding should be Float.context.rounding (input rounding for Float) rather than fmt.get_round (output)
 formatter = Flt::Support::Formatter.new(num_class.radix, num_class.context.etiny, fmt.get_base)
 formatter.format(x, f, e, rounding, prc, fmt.get_all_digits?)
-inexact = :roundup if formatter.round_up && (fmt.get_round != :truncate)
+inexact = formatter.round_up if formatter.round_up.is_a?(Symbol)
 dec_pos,digits = formatter.digits
 txt = ''
 digits.each{|d| txt << fmt.get_base_digits.digit_char(d)}


fix for _IO_lock_ funcs crashing on TLS reference

--- src/glibc-2.17/nptl/sysdeps/pthread/bits/stdio-lock.h
+++ src/glibc-2.17/nptl/sysdeps/pthread/bits/stdio-lock.h
@@ -36,6 +36,8 @@
 #define _IO_lock_fini(_name) \
   ((void) 0)

+// !BAM
+#if 0
 #define _IO_lock_lock(_name) \
   do {									      \
     void *__self = THREAD_SELF;						      \
@@ -74,8 +76,10 @@
 	lll_unlock ((_name).lock, LLL_PRIVATE);				      \
       }									      \
   } while (0)
-
-
+#endif
+#define _IO_lock_lock(_name) do { } while (0)
+#define _IO_lock_trylock(_name) 0
+#define _IO_lock_unlock(_name) do { } while (0)

 #define _IO_cleanup_region_start(_fct, _fp) \
   __libc_cleanup_region_start (((_fp)->_flags & _IO_USER_LOCK) == 0, _fct, _fp)


dbox index rebuild: Fixed setting next-uid and highest-modseq.

--- src/lib-storage/index/dbox-common/dbox-sync-rebuild.c
+++ src/lib-storage/index/dbox-common/dbox-sync-rebuild.c
@@ -92,7 +92,10 @@
 static void dbox_sync_rebuild_header(struct dbox_sync_rebuild_context *ctx)
 {
 	const struct mail_index_header *hdr, *backup_hdr;
+	struct mail_index *index = mail_index_view_get_index(ctx->view);
+	struct mail_index_modseq_header modseq_hdr;
 	uint32_t uid_validity, next_uid;
+	uint64_t modseq;

 	hdr = mail_index_get_header(ctx->view);
 	backup_hdr = ctx->backup_view == NULL ? NULL :
@@ -118,16 +121,18 @@
 		next_uid = dbox_get_uidvalidity_next(ctx->box->list);
 	mail_index_update_header(ctx->trans,
 				 offsetof(struct mail_index_header, next_uid),
-				 &next_uid, sizeof(next_uid), TRUE);
+				 &next_uid, sizeof(next_uid), FALSE);

 	/* set highest-modseq */
-	mail_index_update_highest_modseq(ctx->trans,
-		mail_index_modseq_get_highest(ctx->view));
+	memset(&modseq_hdr, 0, sizeof(modseq_hdr));
+	modseq_hdr.highest_modseq = mail_index_modseq_get_highest(ctx->view);
 	if (ctx->backup_view != NULL) {
-		mail_index_update_highest_modseq(ctx->trans,
-			mail_index_modseq_get_highest(ctx->backup_view));
-
+		modseq = mail_index_modseq_get_highest(ctx->backup_view);
+		if (modseq_hdr.highest_modseq < modseq)
+			modseq_hdr.highest_modseq = modseq;
 	}
+	mail_index_update_header_ext(ctx->trans, index->modseq_ext_id,
+				     0, &modseq_hdr, sizeof(modseq_hdr));
 }

 struct dbox_sync_rebuild_context *


Add note about 0 and 1 output

Add note about 0 and 1 output

--- src/logicalimageoperator/LogicalImageOperatorHelper.h
+++ src/logicalimageoperator/LogicalImageOperatorHelper.h
@@ -249,6 +249,9 @@
 void PrintHelp( void )
 {
   std::cout << "Logical operations on one or two images." << std::endl;
+  std::cout << "NOTE: The output of this filter is an image with pixels of values 0 and 1." << std::endl;
+  std::cout << "An appropriate scaling must be performed either manually (with pxrescaleintensityimagefilter)" << std::endl;
+  std::cout << "or with the application used to view the image." << std::endl << std::endl;
   std::cout << "Usage:" << std::endl << "pxlogicalimageoperator" << std::endl;
   std::cout << "  -in      inputFilename1 [inputFilename2]" << std::endl;
   std::cout << "  [-out]   outputFilename, default in1 + <ops> + in2 + .mhd" << std::endl;


DEVEX-875 reorganize definitions to match m file

--- Branch-SDK/Branch-SDK/BranchEvent.h
+++ Branch-SDK/Branch-SDK/BranchEvent.h
@@ -23,6 +23,10 @@
 FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventAddPaymentInfo;
 FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventPurchase;
 FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventSpendCredits;
+FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventSubscribe;
+FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventStartTrial;
+FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventClickAd;
+FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventViewAd;

 ///@name Content Events

@@ -38,16 +42,9 @@
 FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventCompleteTutorial;
 FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventAchieveLevel;
 FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventUnlockAchievement;
-
-///@name TODO sort these events
-
 FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventInvite;
 FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventLogin;
 FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventReserve;
-FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventSubscribe;
-FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventStartTrial;
-FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventClickAd;
-FOUNDATION_EXPORT BranchStandardEvent _Nonnull BranchStandardEventViewAd;

 typedef NS_ENUM(NSInteger, BranchEventAdType) {
     BranchEventAdTypeBanner,


error: pathspec 'C/Array/SplitStringMoreSeparators.c' did not match any file(s) known to git

--- C/Array/SplitStringMoreSeparators.c
+++ C/Array/SplitStringMoreSeparators.c
@@ -0,0 +1,34 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+int main() {
+    char str[] = "Utilizador 1 --> Bom dia! Tudo bem contigo?\nUtilizador 2 --> Comigo tudo excelente. Que tens feito?\nUtilizador 1 --> De momento estou a trabalhar num projeto... E tu?\nUtilizador 2 --> Eu tenho estudado uma nova linguagem, Java. Bastante interessante. Devias experimentar.\nUtilizador 2 --> Talvez experimente quando tiver algum tempo livre!\n";
+    char **matriz = malloc(sizeof(char *) * 255);
+    int linha = 0;
+    matriz[linha] = malloc(255);
+    for (int caractere = 0, coluna = 0; str[caractere] != '\0'; caractere++, coluna++) {
+        matriz[linha][coluna] = str[caractere];
+        if (str[caractere] == '\n' || str[caractere] == '\0' || str[caractere] == '.' || str[caractere] == '!' || str[caractere] == '?') {
+            if (str[caractere] == '.' && str[caractere + 1] == '.' && str[caractere + 2] == '.') {
+            	matriz[linha][++coluna] = str[++caractere];
+            	matriz[linha][++coluna] = str[++caractere];
+            	matriz[linha][++coluna] = '\0';
+            }
+            if (str[caractere] == '\n' || str[caractere] == '\0') {
+            	matriz[linha][coluna] = '\0';
+            } else {
+            	matriz[linha][++coluna] = '\0';
+            	caractere++;
+            }
+            matriz[linha] = realloc(matriz[linha], coluna + 1);
+            matriz[++linha] = malloc(255);
+            coluna = -1;
+        }
+    }
+    matriz = realloc(matriz, sizeof(char *) * linha);
+    for (int i = 0; i < linha; i++) {
+        printf("%s\n", matriz[i]);
+    }
+}
+
+//https://pt.stackoverflow.com/q/254401/101


Improve readability of signal handler function pointer

Change-Id: Ie3160d5f6893815f9c5be2f4db404637a210a59a

--- Capu/include/capu/os/Posix/Signal.h
+++ Capu/include/capu/os/Posix/Signal.h
@@ -39,12 +39,13 @@
         class Signal
         {
         public:
+            typedef void (*SignalHandlerFunction)(int32_t);

             /// Registers a signal handler.
             /** @param sig The signal.
              *  @param func Signal handler function, which is called when the signal happens.
              *  @return Returns the previous installed signal handler. */
-            static void (*signal(ESignal sig, void (*func)(int32_t)))(int32_t)
+            static SignalHandlerFunction signal(ESignal sig, SignalHandlerFunction func)
             {
                 return ::signal(static_cast<int32_t>(sig), (func != 0) ? func : SIG_DFL);
             }


ENH: typedef corrected according to "Type" termination

--- Code/Common/itkImageSliceIterator.h
+++ Code/Common/itkImageSliceIterator.h
@@ -73,7 +73,7 @@
    * Constructor establishes an iterator to walk a particular image and a
    * particular region of that image.
    */
-  ImageSliceIterator( Image *ptr,
+  ImageSliceIterator( ImageType *ptr,
                       const RegionType & region)
     : ImageIteratorWithIndex<TImage>(ptr, region)
     {


Just need to finish the else statement now.

--- ContainSubstring/ContainSubstring.c
+++ ContainSubstring/ContainSubstring.c
@@ -72,12 +72,19 @@
             "%zu + 1;\n\tint i = 0;\n\tint state = 0;\n\twhile(i < cap){\n\t\t"
             "switch(state){\n\t\t\t", strlen(substring));
     int i = 0;
+    int accept_state = length - 1;
     while(i < length){
         printf("case %d:\n\t\t\t\tif(string[i] == '%c'){\n\t\t\t\t\t", i, substring[i]);
-
+        if(i == accept_state){
+            printf("return true;");
+        }
+        else{
+            printf("state = state + 1;");
+        }
         printf("\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t");

-        printf("\n\t\t\t\t}\n\t\t\t");
+        printf("\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t");
+        i = i + 1;
     }
     printf("\n\t\t}\n\t\ti = i + 1;\n\t}\n\treturn false;\n}");
 }
@@ -96,6 +103,7 @@
                 else{

                 }
+                break;
             case 1:
                 if(0){


Require that only the last reference of a writable version may be committed.

--- lib/dns/include/dns/db.h
+++ lib/dns/include/dns/db.h
@@ -364,6 +364,10 @@
  *
  *	'*versionp' refers to a valid version.
  *
+ *	If committing a writable version, then there must be no other
+ *	outstanding references to the version (e.g. an active rdataset
+ *	iterator).
+ *
  * Ensures:
  *
  *	*versionp == NULL


[NANO130] Fix lp_ticker wake-up is incorrectly disabled

--- targets/TARGET_NUVOTON/TARGET_NANO100/lp_ticker.c
+++ targets/TARGET_NUVOTON/TARGET_NANO100/lp_ticker.c
@@ -222,6 +222,6 @@
     TIMER_EnableWakeup((TIMER_T *) NU_MODBASE(timer3_modinit.modname));
     // Wait 2 cycles of engine clock to ensure previous CTL write action is finish
     wait_us(30 * 2);
-    timer3_base->CTL = ctl_timer3 | TIMER_CTL_TMR_EN_Msk;
+    timer3_base->CTL |= ctl_timer3 | TIMER_CTL_TMR_EN_Msk;
 }
 #endif


[XLA] Add select and scatter to pattern mattcher

PiperOrigin-RevId: 337497933
Change-Id: Ic8a2b1db182fa8d1d7b60650ad3773be346df9e7

--- tensorflow/compiler/xla/service/pattern_matcher.h
+++ tensorflow/compiler/xla/service/pattern_matcher.h
@@ -2125,6 +2125,7 @@
 XLA_TERNOP_PATTERN(Clamp);
 XLA_TERNOP_PATTERN(Scatter);
 XLA_TERNOP_PATTERN(Select);
+XLA_TERNOP_PATTERN(SelectAndScatter);
 #undef XLA_TERNOP_PATTERN

 namespace detail {


thp: remove wake_up_interruptible in the exit path

Add the check of kthread_should_stop() to the conditions which are used to
wakeup on khugepaged_wait, then kthread_stop is enough to let the thread
exit

Signed-off-by: Xiao Guangrong <1e0036c3819c78880ef9e9a8457e99783a5661e3@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <6cb163d975a8c4c46420677e0054b55c39bdb339@redhat.com>
Cc: Hugh Dickins <d3abdf3e2800e6cb849f11b81e6eb50b34d96431@google.com>
Cc: David Rientjes <d8cd2994e15bc61ddb2b113030bda55eebc3a0fe@google.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- mm/huge_memory.c
+++ mm/huge_memory.c
@@ -154,8 +154,6 @@

 		set_recommended_min_free_kbytes();
 	} else if (khugepaged_thread) {
-		/* wakeup to exit */
-		wake_up_interruptible(&khugepaged_wait);
 		kthread_stop(khugepaged_thread);
 		khugepaged_thread = NULL;
 	}
@@ -2221,7 +2219,7 @@
 static int khugepaged_wait_event(void)
 {
 	return !list_empty(&khugepaged_scan.mm_head) ||
-		!khugepaged_enabled();
+		kthread_should_stop();
 }

 static void khugepaged_do_scan(struct page **hpage)
@@ -2287,6 +2285,24 @@
 	return hpage;
 }
 #endif
+
+static void khugepaged_wait_work(void)
+{
+	try_to_freeze();
+
+	if (khugepaged_has_work()) {
+		if (!khugepaged_scan_sleep_millisecs)
+			return;
+
+		wait_event_freezable_timeout(khugepaged_wait,
+					     kthread_should_stop(),
+			msecs_to_jiffies(khugepaged_scan_sleep_millisecs));
+		return;
+	}
+
+	if (khugepaged_enabled())
+		wait_event_freezable(khugepaged_wait, khugepaged_wait_event());
+}

 static void khugepaged_loop(void)
 {
@@ -2312,17 +2328,8 @@
 		if (hpage)
 			put_page(hpage);
 #endif
-		try_to_freeze();
-		if (unlikely(kthread_should_stop()))
-			break;
-		if (khugepaged_has_work()) {
-			if (!khugepaged_scan_sleep_millisecs)
-				continue;
-			wait_event_freezable_timeout(khugepaged_wait, false,
-			    msecs_to_jiffies(khugepaged_scan_sleep_millisecs));
-		} else if (khugepaged_enabled())
-			wait_event_freezable(khugepaged_wait,
-					     khugepaged_wait_event());
+
+		khugepaged_wait_work();
 	}
 }


Release conf compilation fix

Release conf compilation fix

--- DEM/Src/nebula2/inc/kernel/ntypes.h
+++ DEM/Src/nebula2/inc/kernel/ntypes.h
@@ -2,6 +2,8 @@
 #define N_TYPES_H

 #include <stdio.h> //???why error if comment?
+#include <stdlib.h> // malloc, free
+#include <new> // malloc, free
 #include "StdCfg.h"

 //---------------------------------------------------------------------


call initgroups

call initgroups

--- setusergroups.c
+++ setusergroups.c
@@ -7,73 +7,33 @@
 #include <pwd.h>
 #include <grp.h>

-static void set_supp_groups(const char* username) {
-  int ngroups=0;
-  int capacity=100;
-  gid_t* gidset = malloc(sizeof(gid_t)*capacity);
-  if (gidset == NULL) {
-      printf("Out of memory\n");
-      exit(1);
-  }
-
-  while (1) {
-    struct group* grent = getgrent();
-    if (grent == NULL) {
-      break;
-    }
-
-    char **gr_mem = grent->gr_mem;
-    while (*gr_mem) {
-      if (strcmp(*gr_mem, username) == 0) {
-        if (ngroups+1 > capacity) {
-          capacity = capacity * 2;
-
-          gidset = realloc(gidset, sizeof(gid_t)*capacity);
-          if (gidset == NULL) {
-              printf("Out of memory\n");
-              exit(1);
-          }
-        }
-
-        gidset[ngroups++] = grent->gr_gid;
-        break;
-      }
-      gr_mem++;
-    }
-  }
-
-  if (setgroups(ngroups, gidset) != 0) {
-    perror("setgroups failed");
-    exit(1);
-  }
-
-  free(gidset);
-}
-
 int main(int argc, char** argv) {
   if (argc <= 2) {
     printf("Usage: %s account child\n", argv[0]);
-    return 1;
+    return 111;
   }

-  char* name = argv[1];
+  char* account = argv[1];

-  struct passwd *pwnam = getpwnam(name);
+  struct passwd *pwnam = getpwnam(account);
   if (pwnam == NULL) {
     perror("unknown user");
-    return 1;
+    return 111;
   }

   if (setgid(pwnam->pw_gid) != 0) {
     perror("setgid failed");
-    return 1;
+    return 111;
   }

-  set_supp_groups(name);
+  if (initgroups(account, pwnam->pw_gid) != 0) {
+    perror("initgroups failed");
+    return 111;
+  }

   if (setuid(pwnam->pw_uid) != 0) {
     perror("setuid failed");
-    return 1;
+    return 111;
   }

   execvp(argv[2], &(argv[2]));


новые настройки

новые настройки

git-svn-id: bd6e61130530ab01186c33a20f55445ba6f1e843@61121 954022d7-b5bf-4e40-9824-e11837661b57

--- DesktopEditor/Word_Api/Editor_Api.h
+++ DesktopEditor/Word_Api/Editor_Api.h
@@ -2308,6 +2308,11 @@

 		js_wrapper<int>		TableStyleThumbnailWidth;
 		js_wrapper<int>		TableStyleThumbnailHeight;
+
+        js_wrapper<int>		ChartStyleThumbnailWidth;
+        js_wrapper<int>		ChartStyleThumbnailHeight;
+
+        js_wrapper<bool>	ViewerMode;

 		CAscEditorSettings()
 		{
@@ -2320,6 +2325,11 @@

 			TableStyleThumbnailWidth		= oSrc.TableStyleThumbnailWidth;
 			TableStyleThumbnailHeight		= oSrc.TableStyleThumbnailHeight;
+
+            ChartStyleThumbnailWidth        = oSrc.ChartStyleThumbnailWidth;
+            ChartStyleThumbnailHeight       = oSrc.ChartStyleThumbnailHeight;
+
+            ViewerMode                      = oSrc.ViewerMode;
 		}

 		CAscEditorSettings& operator=(const CAscEditorSettings& oSrc)
@@ -2329,6 +2339,11 @@

 			TableStyleThumbnailWidth		= oSrc.TableStyleThumbnailWidth;
 			TableStyleThumbnailHeight		= oSrc.TableStyleThumbnailHeight;
+
+            ChartStyleThumbnailWidth        = oSrc.ChartStyleThumbnailWidth;
+            ChartStyleThumbnailHeight       = oSrc.ChartStyleThumbnailHeight;
+
+            ViewerMode                      = oSrc.ViewerMode;

 			return *this;
 		}


Fixed bugs in segment dir and manifest writing

git-svn-id: ab66a9de07fa9d47c5829c82992f5279466c775f@2702 63c20433-aa62-49bd-875c-5a186b69a8fb

--- applications/mp42ts/main.c
+++ applications/mp42ts/main.c
@@ -1630,7 +1630,11 @@
 			dot = strrchr(segment_prefix, '.');
 			dot[0] = 0;
 			if (segment_dir) {
-				sprintf(segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index);
+				if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
+					sprintf(segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index);
+				} else {
+					sprintf(segment_name, "%s/%s_%d.ts", segment_dir, segment_prefix, segment_index);
+				}
 			} else {
 				sprintf(segment_name, "%s_%d.ts", segment_prefix, segment_index);
 			}
@@ -1794,7 +1798,11 @@
 					fclose(ts_output_file);
 					segment_index++;
 					if (segment_dir) {
-						sprintf(segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index);
+						if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
+							sprintf(segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index);
+						} else {
+							sprintf(segment_name, "%s/%s_%d.ts", segment_dir, segment_prefix, segment_index);
+						}
 					} else {
 						sprintf(segment_name, "%s_%d.ts", segment_prefix, segment_index);
 					}
@@ -1804,17 +1812,22 @@
 						goto exit;
 					}
 					/* delete the oldest segment */
-					if (segment_number && ((s32) (segment_index - segment_number) >= 0)){
+					if (segment_number && ((s32) (segment_index - segment_number - 1) >= 0)){
 						char old_segment_name[GF_MAX_PATH];
 						if (segment_dir) {
-							sprintf(old_segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index - segment_number);
+							if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
+								sprintf(old_segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index - segment_number - 1);
+							} else {
+								sprintf(old_segment_name, "%s/%s_%d.ts", segment_dir, segment_prefix, segment_index - segment_number - 1);
+							}
 						} else {
-							sprintf(old_segment_name, "%s_%d.ts", segment_prefix, segment_index - segment_number);
+							sprintf(old_segment_name, "%s_%d.ts", segment_prefix, segment_index - segment_number - 1);
 						}
 						gf_delete_file(old_segment_name);
 					}
 					write_manifest(segment_manifest, segment_dir, segment_duration, segment_prefix, segment_http_prefix,
-								   (segment_index >= segment_number/2 ? segment_index - segment_number/2 : 0), segment_index >1 ? segment_index-1 : 0, 0);
+//								   (segment_index >= segment_number/2 ? segment_index - segment_number/2 : 0), segment_index >1 ? segment_index-1 : 0, 0);
+								   ( (segment_index > segment_number ) ? segment_index - segment_number : 0), segment_index >1 ? segment_index-1 : 0, 0);
 				}
 			}


Switch to a rpcc-based delay() implementation. From NetBSD.

--- arch/alpha/alpha/machdep.c
+++ arch/alpha/alpha/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.97 2006/03/15 21:03:33 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.98 2006/03/18 12:03:33 miod Exp $ */
 /* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */

 /*-
@@ -2044,18 +2044,39 @@
 delay(n)
 	unsigned long n;
 {
-	long N = cycles_per_usec * (n);
-
-	/*
-	 * XXX Should be written to use RPCC?
-	 */
-
-	__asm __volatile(
-		"# The 2 corresponds to the insn count\n"
-		"1:	subq	%2, %1, %0	\n"
-		"	bgt	%0, 1b"
-		: "=r" (N)
-		: "i" (2), "0" (N));
+	unsigned long pcc0, pcc1, curcycle, cycles, usec;
+
+	if (n == 0)
+		return;
+
+	pcc0 = alpha_rpcc() & 0xffffffffUL;
+	cycles = 0;
+	usec = 0;
+
+	while (usec <= n) {
+		/*
+		 * Get the next CPU cycle count - assumes that we can not
+		 * have had more than one 32 bit overflow.
+		 */
+		pcc1 = alpha_rpcc() & 0xffffffffUL;
+		if (pcc1 < pcc0)
+			curcycle = (pcc1 + 0x100000000UL) - pcc0;
+		else
+			curcycle = pcc1 - pcc0;
+
+		/*
+		 * We now have the number of processor cycles since we
+		 * last checked. Add the current cycle count to the
+		 * running total. If it's over cycles_per_usec, increment
+		 * the usec counter.
+		 */
+		cycles += curcycle;
+		while (cycles > cycles_per_usec) {
+			usec++;
+			cycles -= cycles_per_usec;
+		}
+		pcc0 = pcc1;
+	}
 }

 #if defined(COMPAT_OSF1)


from netbsd: if subdevice not configured, print something out about it.

--- arch/alpha/alpha/mainbus.c
+++ arch/alpha/alpha/mainbus.c
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.5 1995/11/23 02:34:18 cgd Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.6 1995/12/20 00:18:50 cgd Exp $	*/

 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -132,6 +132,10 @@
 	void *aux;
 	char *pnp;
 {
+	struct confargs *ca = aux;
+
+	if (pnp)
+		printf("%s at %s", ca->ca_name, pnp);

 	return (UNCONF);
 }


remove useless comment about macros being different from i386

--- arch/amd64/include/param.h
+++ arch/amd64/include/param.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: param.h,v 1.11 2005/12/13 01:56:43 martin Exp $	*/
+/*	$OpenBSD: param.h,v 1.12 2006/02/05 15:55:50 martin Exp $	*/

 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -138,9 +138,6 @@
 #define	bdbtofsb(bn)	((bn) / (BLKDEV_IOSIZE / DEV_BSIZE))

 /*
- * XXXfvdl the PD* stuff is different from i386.
- */
-/*
  * Mach derived conversion macros
  */
 #define	x86_round_pdr(x) \


ARM: pxa: hx4700: use PWM_LOOKUP to initialize struct pwm_lookup

Use the new variant of the PWM_LOOKUP macro to initialize the PWM lookup
table.

Signed-off-by: Alexandre Belloni <a7228e626ecf0022ac91fc1cd8db88e71d0e5e0e@free-electrons.com>
Acked-by: Philipp Zabel <1f94b3da04d839c1c06fd881f52fcf8011297561@gmail.com>
Signed-off-by: Thierry Reding <b75a4d02013b0e68ae2c6bb0dcfd4b7bec282dc9@gmail.com>


ARM: pxa/palm: fix ifdef around gen_nand driver registration

Reported-by: Rafael Gandolfi <9a5822476bba5f21b068d9f03a7f427bef1c6033@hotmail.fr>
Signed-off-by: Marek Vasut <b3d5c06c9586b253938d603132fac72c1df6ee3f@gmail.com>
Signed-off-by: Eric Miao <60e376623d7bcedd53f4c51cbb2c060fb40a4887@gmail.com>

--- arch/arm/mach-pxa/palmtx.c
+++ arch/arm/mach-pxa/palmtx.c
@@ -241,7 +241,8 @@
 /******************************************************************************
  * NAND Flash
  ******************************************************************************/
-#if defined(CONFIG_MTD_NAND_GPIO) || defined(CONFIG_MTD_NAND_GPIO_MODULE)
+#if defined(CONFIG_MTD_NAND_PLATFORM) || \
+	defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
 static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
 				 unsigned int ctrl)
 {


[ARM] 4638/1: pxa: use PXA3xx specific macros to define clks

PXA3xx uses its own clk_pxa3xx_cken_ops, modify the code to use the
PXA3xx specific macros to define its clocks

Signed-off-by: eric miao <e9e0335ae43eee51396737d09983d9b25d00e51e@marvell.com>
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- arch/arm/mach-pxa/pxa3xx.c
+++ arch/arm/mach-pxa/pxa3xx.c
@@ -150,22 +150,45 @@
 	local_irq_enable();
 }

+static const struct clkops clk_pxa3xx_cken_ops = {
+	.enable		= clk_pxa3xx_cken_enable,
+	.disable	= clk_pxa3xx_cken_disable,
+};
+
 static const struct clkops clk_pxa3xx_hsio_ops = {
 	.enable		= clk_pxa3xx_cken_enable,
 	.disable	= clk_pxa3xx_cken_disable,
 	.getrate	= clk_pxa3xx_hsio_getrate,
 };

+#define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev)	\
+	{						\
+		.name	= _name,			\
+		.dev	= _dev,				\
+		.ops	= &clk_pxa3xx_cken_ops,		\
+		.rate	= _rate,			\
+		.cken	= CKEN_##_cken,			\
+		.delay	= _delay,			\
+	}
+
+#define PXA3xx_CK(_name, _cken, _ops, _dev)		\
+	{						\
+		.name	= _name,			\
+		.dev	= _dev,				\
+		.ops	= _ops,				\
+		.cken	= CKEN_##_cken,			\
+	}
+
 static struct clk pxa3xx_clks[] = {
-	INIT_CK("LCDCLK", LCD,    &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
-	INIT_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
-
-	INIT_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
-	INIT_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
-	INIT_CKEN("UARTCLK", STUART, 14857000, 1, NULL),
-
-	INIT_CKEN("I2CCLK",  I2C,  32842000, 0, &pxa_device_i2c.dev),
-	INIT_CKEN("UDCCLK",  UDC,  48000000, 5, &pxa_device_udc.dev),
+	PXA3xx_CK("LCDCLK", LCD,    &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
+	PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
+
+	PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
+	PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
+	PXA3xx_CKEN("UARTCLK", STUART, 14857000, 1, NULL),
+
+	PXA3xx_CKEN("I2CCLK", I2C,  32842000, 0, &pxa_device_i2c.dev),
+	PXA3xx_CKEN("UDCCLK", UDC,  48000000, 5, &pxa_device_udc.dev),
 };

 void __init pxa3xx_init_irq(void)


Remove echo() from uart.c. Need to be in _KEY routine.

--- arch/esp8266/common/uart.c
+++ arch/esp8266/common/uart.c
@@ -26,8 +26,6 @@
 #include "freertos/FreeRTOS.h"
 #include "uart.h"

-static int echo = TRUE;
-
 LOCAL int tx_fifo_count(int uart)
 {
     uint32 fifo_cnt = READ_PERI_REG(UART_STATUS(uart)) & (UART_TXFIFO_CNT << UART_TXFIFO_CNT_S);
@@ -243,10 +241,6 @@
     while( count < bufsize && count < fifo_len )
     {
         uint8 rcvChar = READ_PERI_REG(UART_FIFO(UART0)) & 0xFF;
-        if( echo )
-        {
-            uart_tx_one_char( 0, rcvChar );
-        }
         buffer[count++] = rcvChar;
     }
     return count;


wrong place for cold

wrong place for cold

--- arch/i386/include/apmvar.h
+++ arch/i386/include/apmvar.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: apmvar.h,v 1.11 2001/06/24 20:38:06 fgsch Exp $	*/
+/*	$OpenBSD: apmvar.h,v 1.12 2001/06/24 21:17:33 mickey Exp $	*/

 /*
  *  Copyright (c) 1995 John T. Kohl
@@ -291,7 +291,6 @@
 					   if the percentage changes */

 #ifdef _KERNEL
-extern int cold;
 extern void apm_cpu_busy __P((void));
 extern void apm_cpu_idle __P((void));
 extern void apminit __P((void));


m68k/amiga: Use arch_initcall() for registering platform devices

module_init() maps to device_initcall(), opening the possibility of
race conditions between platform_driver_probe() and registering platform
devices.

Signed-off-by: Geert Uytterhoeven <0da414d9d963da4039c2a0525b1844228075aa58@linux-m68k.org>

--- arch/m68k/amiga/platform.c
+++ arch/m68k/amiga/platform.c
@@ -252,4 +252,4 @@
 	return 0;
 }

-device_initcall(amiga_init_devices);
+arch_initcall(amiga_init_devices);


MIPS: PCI: Use PCI Express Capability accessors

Use PCI Express Capability access functions to simplify MIPS PCIe code.

Signed-off-by: Jiang Liu <68ee766e574f18b34b683085865827393efe88bd@huawei.com>
Signed-off-by: Bjorn Helgaas <f10ec01be0c6b54271af5c550cd257810bdf3268@google.com>
Acked-by: David Daney <eec15f2dea0e7d114bf41a5bde8a2858b8f3e893@cavium.com>

--- arch/mips/pci/pci-octeon.c
+++ arch/mips/pci/pci-octeon.c
@@ -117,16 +117,11 @@
 	}

 	/* Enable the PCIe normal error reporting */
-	pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
-	if (pos) {
-		/* Update Device Control */
-		pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &config);
-		config |= PCI_EXP_DEVCTL_CERE; /* Correctable Error Reporting */
-		config |= PCI_EXP_DEVCTL_NFERE; /* Non-Fatal Error Reporting */
-		config |= PCI_EXP_DEVCTL_FERE;  /* Fatal Error Reporting */
-		config |= PCI_EXP_DEVCTL_URRE;  /* Unsupported Request */
-		pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, config);
-	}
+	config = PCI_EXP_DEVCTL_CERE; /* Correctable Error Reporting */
+	config |= PCI_EXP_DEVCTL_NFERE; /* Non-Fatal Error Reporting */
+	config |= PCI_EXP_DEVCTL_FERE;  /* Fatal Error Reporting */
+	config |= PCI_EXP_DEVCTL_URRE;  /* Unsupported Request */
+	pcie_capability_set_word(dev, PCI_EXP_DEVCTL, config);

 	/* Find the Advanced Error Reporting capability */
 	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);


powerpc/prom: Avoid reference to potentially freed memory

of_get_property() is used inside the loop, but then the reference to the
node is dropped before dereferencing the prop pointer, which could by then
point to junk if the node has been freed.

Instead use of_property_read_u32() to actually read the property
value before dropping the reference.

of_property_read_u32() requires at least one cell (u32) to be present,
which is stricter than the old logic which would happily dereference a
property of any size. However we believe all device trees in the wild
have at least one cell.

Skiboot may produce memory nodes with more than one cell, but that is
OK, of_property_read_u32() will return the first one.

Signed-off-by: Christophe JAILLET <aa5b4d6ac057e7b0849afbbced06a03fc6c87d45@wanadoo.fr>
[mpe: Expand change log with device tree details]
Signed-off-by: Michael Ellerman <864f124608374e06e4da1fa5d2e47ed839b95411@ellerman.id.au>


KVM: PPC: fix compilation of "dump tlbs" debug function

Missing local variable.

Signed-off-by: Hollis Blanchard <cd9c751a7d90e05d28d5b07e1a27ef2eba49db0a@mentor.com>
Signed-off-by: Alexander Graf <3ad82b0c937b9aa51276120cedd545efc822be04@suse.de>

--- arch/powerpc/kvm/44x_tlb.c
+++ arch/powerpc/kvm/44x_tlb.c
@@ -47,6 +47,7 @@
 #ifdef DEBUG
 void kvmppc_dump_tlbs(struct kvm_vcpu *vcpu)
 {
+	struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
 	struct kvmppc_44x_tlbe *tlbe;
 	int i;


KVM: PPC: Fix stbux emulation

KVM: PPC: Fix stbux emulation

Stbux writes the address it's operating on to the register specified in ra,
not into the data source register.

Signed-off-by: Alexander Graf <3ad82b0c937b9aa51276120cedd545efc822be04@suse.de>

--- arch/powerpc/kvm/emulate.c
+++ arch/powerpc/kvm/emulate.c
@@ -229,7 +229,7 @@
 			emulated = kvmppc_handle_store(run, vcpu,
 						       kvmppc_get_gpr(vcpu, rs),
 			                               1, 1);
-			kvmppc_set_gpr(vcpu, rs, vcpu->arch.vaddr_accessed);
+			kvmppc_set_gpr(vcpu, ra, vcpu->arch.vaddr_accessed);
 			break;

 		case OP_31_XOP_LHAX:


s390/uaccess: add missing page table walk range check

When translating a user space address, the address must be checked against
the ASCE limit of the process. If the address is larger than the maximum
address that is reachable with the ASCE, an ASCE type exception must be
generated.

The current code simply ignored the higher order bits. This resulted in an
address wrap around in user space instead of an exception in user space.

Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org # v3.9+
Reviewed-by: Gerald Schaefer <7a67bf9a8691f9f1ca8ce9577e14c37413ea5f58@de.ibm.com>
Signed-off-by: Heiko Carstens <8dcf0f69152f32f23184f83357a3731522e56b9c@de.ibm.com>
Signed-off-by: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>


arch/sh/mm/asids-debugfs.c: use PTR_ERR_OR_ZERO

Replace IS_ERR/PTR_ERR.

Signed-off-by: Fabian Frederick <3efd2a027b14fd890cd23a9ef6d1134b4e5ad850@skynet.be>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>


um: fix returns without va_end

um: fix returns without va_end

When using va_list ensure that va_start will be followed by va_end.

Signed-off-by: Geyslan G. Bem <f4b1cbbbea5f92f5c62d2b429aae4742785e210f@gmail.com>
Signed-off-by: Richard Weinberger <320bca71fc381a4a025636043ca86e734e31cf8b@nod.at>


x86: Avoid check hlt for newer cpus

x86: Avoid check hlt for newer cpus

Check hlt instruction was targeted for some older CPUs. It is an expensive
operation in that it takes 4 ticks to break out the check.  We can avoid
such check completely for newer x86 cpus (family >= 5).

[ hpa: corrected family > 5 to family >= 5 ]

Signed-off-by: Jacob Pan <148d80f820771051461d15e2fa9640db8055fb59@linux.intel.com>
LKML-Reference: <1273269585-14346-1-git-send-email-148d80f820771051461d15e2fa9640db8055fb59@linux.intel.com>
Signed-off-by: H. Peter Anvin <8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com>

--- arch/x86/kernel/cpu/bugs.c
+++ arch/x86/kernel/cpu/bugs.c
@@ -86,7 +86,7 @@

 static void __init check_hlt(void)
 {
-	if (paravirt_enabled())
+	if (boot_cpu_data.x86 >= 5 || paravirt_enabled())
 		return;

 	printk(KERN_INFO "Checking 'hlt' instruction... ");


x86, paravirt, 64-bit: fix compile errors with IA32_EMULATION off

Signed-off-by: Jeremy Fitzhardinge <35cfe9f678a9e9bbdcf2f6e68cd105ce06d149b1@citrix.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- arch/x86/kernel/paravirt.c
+++ arch/x86/kernel/paravirt.c
@@ -337,9 +337,13 @@
 	.write_idt_entry = native_write_idt_entry,
 	.load_sp0 = native_load_sp0,

+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
 	.irq_enable_sysexit = native_irq_enable_sysexit,
+#endif
 #ifdef CONFIG_X86_64
+#ifdef CONFIG_IA32_EMULATION
 	.usergs_sysret32 = native_usergs_sysret32,
+#endif
 	.usergs_sysret64 = native_usergs_sysret64,
 #endif
 	.iret = native_iret,


i386: convert hardware exception 19 to an interrupt gate

Handle SIMD coprocessor exception with interrupt initially off.

Signed-off-by: Alexander van Heukelum <f4e6655d5c66b1f34181c4b9abd1706d7697fa85@fastmail.fm>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- arch/x86/kernel/traps_32.c
+++ arch/x86/kernel/traps_32.c
@@ -1144,6 +1144,8 @@

 void do_simd_coprocessor_error(struct pt_regs *regs, long error_code)
 {
+	conditional_sti(regs);
+
 	if (cpu_has_xmm) {
 		/* Handle SIMD FPU exceptions on PIII+ processors. */
 		ignore_fpu_irq = 1;
@@ -1294,7 +1296,7 @@
 #ifdef CONFIG_X86_MCE
 	set_intr_gate(18, &machine_check);
 #endif
-	set_trap_gate(19, &simd_coprocessor_error);
+	set_intr_gate(19, &simd_coprocessor_error);

 	if (cpu_has_fxsr) {
 		printk(KERN_INFO "Enabling fast FPU save and restore... ");


Create JES315.c

Create JES315.c

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

--- modulo2/JES315.c
+++ modulo2/JES315.c
@@ -0,0 +1,46 @@
+/* Universidade Estadual do Ceara
+Introducao a Computacao 2016.2 - Prof. Gildacio
+Jessica Cristina Cacau Patricio (1388627)
+
+Exercicio 315 */
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<strings.h>
+
+void main () {
+    char nome[50];
+    float nota1, nota2;
+
+    printf("Nome do aluno: ");
+    gets(nome);
+    printf("Nota da primeira prova: ");
+    scanf("%f", &nota1);
+    printf("Nota da segunda prova: ");
+    scanf("%f", &nota2);
+    if (nota1>nota2)
+        printf("\nRefaca a segunda prova.\n");
+    else {
+        nota1 = nota2;
+        printf("Nota da terceira prova: ");
+        scanf("%f", &nota2);
+        if (nota1>nota2)
+            printf("\nRefaca a terceira prova.\n");
+        else {
+            nota1 = nota2;
+            printf("Nota da quarta prova: ");
+            scanf("%f", &nota2);
+            if (nota1>nota2)
+                printf("\nRefaca a quarta prova.\n");
+            else {
+                nota1 = nota2;
+                printf("Nota da quinta prova: ");
+                scanf("%f", &nota2);
+                if (nota1>nota2)
+                    printf("\nRefaca a quinta prova.\n");
+                else
+                    printf("\nNao eh necessario refazer nenhuma prova.\n");
+            }
+        }
+    }
+}


KVM: x86 emulator: fix sparse warnings in x86_emulate.c

Nesting __emulate_2op_nobyte inside__emulate_2op produces many shadowed
variable warnings on the internal variable _tmp used by both macros.

Change the outer macro to use __tmp.

Avoids a sparse warning like the following at every call site of __emulate_2op
arch/x86/kvm/x86_emulate.c:1091:3: warning: symbol '_tmp' shadows an earlier one
arch/x86/kvm/x86_emulate.c:1091:3: originally declared here
[18 more warnings suppressed]

Signed-off-by: Harvey Harrison <eadbd6b462bf3c97df0300a934c12bc2e5d1fe51@gmail.com>
Signed-off-by: Avi Kivity <8f920f22884d6fea9df883843c4a8095a2e5ac6f@qumranet.com>

--- arch/x86/kvm/x86_emulate.c
+++ arch/x86/kvm/x86_emulate.c
@@ -371,7 +371,7 @@

 #define __emulate_2op(_op,_src,_dst,_eflags,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \
 	do {								     \
-		unsigned long _tmp;					     \
+		unsigned long __tmp;					     \
 		switch ((_dst).bytes) {				             \
 		case 1:							     \
 			__asm__ __volatile__ (				     \
@@ -379,7 +379,7 @@
 				_op"b %"_bx"3,%1; "			     \
 				_POST_EFLAGS("0", "4", "2")		     \
 				: "=m" (_eflags), "=m" ((_dst).val),	     \
-				  "=&r" (_tmp)				     \
+				  "=&r" (__tmp)				     \
 				: _by ((_src).val), "i" (EFLAGS_MASK));      \
 			break;						     \
 		default:						     \