ffs why wasn't this here

ffs why wasn't this here

praise travis

error: pathspec 'source/libs/libsftd/include/sf2d.h' did not match any file(s) known to git

--- source/libs/libsftd/include/sf2d.h
+++ source/libs/libsftd/include/sf2d.h
@@ -0,0 +1,627 @@
+/**
+ * @file sf2d.h
+ * @author Sergi Granell (xerpi)
+ * @date 22 March 2015
+ * @brief sf2dlib header
+ */
+
+#ifndef SF2D_H
+#define SF2D_H
+
+#include <3ds.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Defines
+
+/**
+ * @brief Creates a new RGBA8 color
+ * @param r the red component of the color to create
+ * @param g the green component of the color to create
+ * @param b the blue component of the color to create
+ * @param a the alpha component of the color to create
+ */
+#define RGBA8(r, g, b, a) ((((a)&0xFF)<<24) | (((b)&0xFF)<<16) | (((g)&0xFF)<<8) | (((r)&0xFF)<<0))
+
+#define RGBA8_GET_R(c) (((c) >>  0) & 0xFF)
+#define RGBA8_GET_G(c) (((c) >>  8) & 0xFF)
+#define RGBA8_GET_B(c) (((c) >> 16) & 0xFF)
+#define RGBA8_GET_A(c) (((c) >> 24) & 0xFF)
+
+/**
+ * @brief Default size of the GPU commands FIFO buffer
+ */
+#define SF2D_GPUCMD_DEFAULT_SIZE 0x80000
+
+/**
+ * @brief Default size of the temporary memory pool
+ */
+#define SF2D_TEMPPOOL_DEFAULT_SIZE 0x80000
+
+/**
+ * @brief Default depth (Z coordinate) to draw the textures to
+ */
+#define SF2D_DEFAULT_DEPTH 0.5f
+
+// Enums
+
+/**
+ * @brief Represents a texture format
+ */
+
+typedef enum {
+	TEXFMT_RGBA8  =  0,
+	TEXFMT_RGB8   =  1,
+	TEXFMT_RGB5A1 =  2,
+	TEXFMT_RGB565 =  3,
+	TEXFMT_RGBA4  =  4,
+	TEXFMT_IA8    =  5,
+
+	TEXFMT_I8     =  7,
+	TEXFMT_A8     =  8,
+	TEXFMT_IA4    =  9,
+	TEXFMT_I4     = 10,
+	TEXFMT_A4     = 11,
+	TEXFMT_ETC1   = 12,
+	TEXFMT_ETC1A4 = 13
+} sf2d_texfmt;
+
+
+/**
+ * @brief Data allocated on the RAM or VRAM
+ */
+
+typedef enum {
+	SF2D_PLACE_RAM,  /**< RAM allocated */
+	SF2D_PLACE_VRAM, /**< VRAM allocated */
+	SF2D_PLACE_TEMP  /**< Temporary memory pool allocated */
+} sf2d_place;
+
+// Structs
+
+/**
+ * @brief Represents a two dimensional float vector
+ */
+
+typedef struct {
+	float u;  /**< First component of the vector */
+	float v;  /**< Second component of the vector */
+} sf2d_vector_2f;
+
+/**
+ * @brief Represents a three dimensional float vector
+ */
+
+typedef struct {
+	float x;  /**< First component of the vector */
+	float y;  /**< Second component of the vector */
+	float z;  /**< Third component of the vector */
+} sf2d_vector_3f;
+
+/**
+ * @brief Represents a vertex containing position (float)
+ *        and color (unsigned int)
+ */
+
+typedef struct {
+	sf2d_vector_3f position;  /**< Position of the vertex */
+	u32 color;                /**< Color of the vertex */
+} sf2d_vertex_pos_col;
+
+/**
+ * @brief Represents a vertex containing position and texture coordinates
+ */
+
+typedef struct {
+	sf2d_vector_3f position;  /**< Position of the vertex */
+	sf2d_vector_2f texcoord;  /**< Texture coordinates of the vertex */
+} sf2d_vertex_pos_tex;
+
+/**
+ * @brief Represents a texture
+ */
+
+typedef struct {
+	sf2d_place place;          /**< Where the texture data resides, RAM or VRAM */
+	int tiled;                 /**< Whether the tetxure is tiled or not */
+	sf2d_texfmt pixel_format;  /**< Pixel format */
+	u32 params;                /**< Texture filters and wrapping */
+	int width;                 /**< Texture width */
+	int height;                /**< Texture height */
+	int pow2_w;                /**< Nearest power of 2 >= width */
+	int pow2_h;                /**< Nearest power of 2 >= height */
+	int data_size;             /**< Size of the raw texture data */
+	void *data;                /**< Pointer to the data */
+} sf2d_texture;
+
+// Basic functions
+
+/**
+ * @brief Initializates the library
+ * @return Whether the initialization has been successful or not
+ */
+int sf2d_init();
+
+/**
+ * @brief Initializates the library (with advanced settings)
+ * @param gpucmd_size the size of the GPU FIFO
+ * @param temppool_size the size of the temporary pool
+ * @return Whether the initialization has been successful or not
+ */
+int sf2d_init_advanced(int gpucmd_size, int temppool_size);
+
+/**
+ * @brief Finishes the library
+ * @return Whether the finalization has been successful or not
+ */
+int sf2d_fini();
+
+/**
+ * @brief Enables or disables the 3D
+ * @param enable whether to enable or disable the 3D
+ */
+void sf2d_set_3D(int enable);
+
+/**
+ * @brief Starts a frame
+ * @param screen target screen
+ * @param side target eye (only for top screen)
+ */
+void sf2d_start_frame(gfxScreen_t screen, gfx3dSide_t side);
+
+/**
+ * @brief Ends a frame, should be called on pair with sf2d_start_frame
+ */
+void sf2d_end_frame();
+
+/**
+ * @brief Swaps the framebuffers, should be called once after all the frames have been finished
+ */
+void sf2d_swapbuffers();
+
+/**
+ * @brief Enables or disables the VBlank waiting
+ * @param enable whether to enable or disable the VBlank waiting
+ */
+void sf2d_set_vblank_wait(int enable);
+
+/**
+ * @brief Returns the FPS (frames per second)
+ * @return the current FPS
+ */
+float sf2d_get_fps();
+
+/**
+ * @brief Allocates memory from a temporary pool. The pool will be emptied after a sf2d_swapbuffers call
+ * @param size the number of bytes to allocate
+ */
+void *sf2d_pool_malloc(u32 size);
+
+/**
+ * @brief Allocates aligned memory from a temporary pool. Works as sf2d_pool_malloc
+ * @param size the number of bytes to allocate
+ * @param alignment the alignment to where allocate the memory
+ */
+void *sf2d_pool_memalign(u32 size, u32 alignment);
+
+/**
+ * @brief Allocates aligned memory for an array from a temporary pool. Works as sf2d_pool_malloc
+ * @param nmemb the number of elements to allocate
+ * @param size the size (and alignment) of each element to allocate
+ * @note Unlike libc's calloc, this function does not initialize to 0,
+ *       and returns a pointer aligned to size.
+ */
+void *sf2d_pool_calloc(u32 nmemb, u32 size);
+
+/**
+ * @brief Returns the temporary pool's free space
+ * @return the temporary pool's free space
+ */
+unsigned int sf2d_pool_space_free();
+
+/**
+ * @brief Empties the temporary pool
+ */
+void sf2d_pool_reset();
+
+/**
+ * @brief Sets the screen clear color
+ * @param color the color
+ */
+void sf2d_set_clear_color(u32 color);
+
+// Draw functions
+/**
+ * @brief Draws a line
+ * @param x0 x coordinate of the first dot
+ * @param y0 y coordinate of the first dot
+ * @param x1 x coordinate of the second dot
+ * @param y1 y coordinate of the sceond dot
+ * @param color the color to draw the line
+ */
+void sf2d_draw_line(int x0, int y0, int x1, int y1, u32 color);
+
+/**
+ * @brief Draws a rectangle
+ * @param x x coordinate of the top left corner of the rectangle
+ * @param y y coordinate of the top left corner of the rectangle
+ * @param w rectangle width
+ * @param h rectangle height
+ * @param color the color to draw the rectangle
+ */
+void sf2d_draw_rectangle(int x, int y, int w, int h, u32 color);
+
+/**
+ * @brief Draws a rotated rectangle
+ * @param x x coordinate of the top left corner of the rectangle
+ * @param y y coordinate of the top left corner of the rectangle
+ * @param w rectangle width
+ * @param h rectangle height
+ * @param color the color to draw the rectangle
+ * @param rad rotation (in radians) to draw the rectangle
+ */
+void sf2d_draw_rectangle_rotate(int x, int y, int w, int h, u32 color, float rad);
+
+/**
+ * @brief Draws a filled circle
+ * @param x x coordinate of the center of the circle
+ * @param y y coordinate of the center of the circle
+ * @param radius the radius of the circle
+ * @param color the color to draw the circle
+ */
+void sf2d_draw_fill_circle(int x, int y, int radius, u32 color);
+
+// Texture
+
+/**
+ * @brief Creates an empty texture.
+ * The returned texture has the data allocated,
+ * this means that the raw pixel data can be filled
+ * just after the return.
+ * @param width the width of the texture
+ * @param height the height of the texture
+ * @param pixel_format the pixel_format of the texture
+ * @param place where to allocate the texture
+ * @return a pointer to the newly created texture
+ * @note Before drawing the texture, it needs to be tiled
+ *       by calling sf2d_texture_tile32.
+ *       The default texture params are both min and mag filters
+ *       GPU_NEAREST, and both S and T wrappings GPU_CLAMP_TO_BORDER.
+ */
+sf2d_texture *sf2d_create_texture(int width, int height, sf2d_texfmt pixel_format, sf2d_place place);
+
+/**
+ * @brief Frees a texture
+ * @param texture pointer to the texture to freeze
+ */
+void sf2d_free_texture(sf2d_texture *texture);
+
+/**
+ * @brief Fills an already allocated texture from a RGBA8 source
+ * @param dst pointer to the destination texture to fill
+ * @param rgba8 pointer to the RGBA8 data to fill from
+ * @param source_w width (in pixels) of the RGAB8 source
+ * @param source_h height (in pixels) of the RGAB8 source
+ */
+void sf2d_fill_texture_from_RGBA8(sf2d_texture *dst, const void *rgba8, int source_w, int source_h);
+
+/**
+ * @brief Creates a texture and fills it from a RGBA8 memory source.
+ * The returned texture is already tiled.
+ * @param src_buffer pointer to the RGBA8 data to fill from
+ * @param src_w width (in pixels) of the RGAB8 source
+ * @param src_h height (in pixels) of the RGAB8 source
+ * @param pixel_format the pixel_format of the texture to create
+ * @param place where to allocate the texture
+ * @return a pointer to the newly created, filled, and tiled texture
+ */
+
+sf2d_texture *sf2d_create_texture_mem_RGBA8(const void *src_buffer, int src_w, int src_h, sf2d_texfmt pixel_format, sf2d_place place);
+
+/**
+ * @brief Binds a texture to a GPU texture unit
+ * @param texture the texture to bind
+ * @param unit GPU texture unit to bind to
+ */
+void sf2d_bind_texture(const sf2d_texture *texture, GPU_TEXUNIT unit);
+
+/**
+ * @brief Binds a texture to a GPU texture unit with a constant color
+ * @param texture the texture to bind
+ * @param unit GPU texture unit to bind to
+ * @param color the color the bind with the texture
+ */
+void sf2d_bind_texture_color(const sf2d_texture *texture, GPU_TEXUNIT unit, u32 color);
+
+/**
+ * @brief Binds a texture to a GPU texture unit with custom parameters
+ * @param texture the texture to bind
+ * @param unit GPU texture unit to bind to
+ * @param params the parameters the bind with the texture
+ */
+void sf2d_bind_texture_parameters(const sf2d_texture *texture, GPU_TEXUNIT unit, unsigned int params);
+
+/**
+ * @brief Changes the texture params (filters and wrapping)
+ * @param texture the texture to change the params
+ * @param params the new texture params to use. You can use the
+ *        GPU_TEXTURE_[MIN,MAG]_FILTER and GPU_TEXTURE_WRAP_[S,T]
+ *        macros as helpers.
+ */
+void sf2d_texture_set_params(sf2d_texture *texture, u32 params);
+
+/**
+ * @brief Returns the texture params
+ * @param texture the texture to get the params
+ * @return the current texture params of texture
+ */
+int sf2d_texture_get_params(const sf2d_texture *texture);
+
+/**
+ * @brief Draws a texture
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ */
+void sf2d_draw_texture(const sf2d_texture *texture, int x, int y);
+
+/**
+ * @brief Draws a texture blended with a color
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param color the color to blend with the texture
+ */
+void sf2d_draw_texture_blend(const sf2d_texture *texture, int x, int y, u32 color);
+
+/**
+ * @brief Draws a texture with rotation around a hotspot
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param rad rotation (in radians) to draw the texture
+ * @param center_x the x position of the hotspot
+ * @param center_y the y position of the hotspot
+ */
+void sf2d_draw_texture_rotate_hotspot(const sf2d_texture *texture, int x, int y, float rad, float center_x, float center_y);
+
+/**
+ * @brief Draws a texture with rotation around a hotspot with a color
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param rad rotation (in radians) to draw the texture
+ * @param center_x the x position of the hotspot
+ * @param center_y the y position of the hotspot
+ * @param color the color to blend with the texture
+ */
+void sf2d_draw_texture_rotate_hotspot_blend(const sf2d_texture *texture, int x, int y, float rad, float center_x, float center_y, u32 color);
+
+
+/**
+ * @brief Draws a texture with rotation around its center
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param rad rotation (in radians) to draw the texture
+ */
+void sf2d_draw_texture_rotate(const sf2d_texture *texture, int x, int y, float rad);
+
+/**
+ * @brief Draws a texture with rotation around its center with color
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param rad rotation (in radians) to draw the texture
+ * @param color the color to blend with the texture
+ */
+void sf2d_draw_texture_rotate_blend(const sf2d_texture *texture, int x, int y, float rad, u32 color);
+
+/**
+ * @brief Draws a part of a texture
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param tex_x the starting point (x coordinate) where to start drawing
+ * @param tex_y the starting point (y coordinate) where to start drawing
+ * @param tex_w the width to draw from the starting point
+ * @param tex_h the height to draw from the starting point
+ */
+void sf2d_draw_texture_part(const sf2d_texture *texture, int x, int y, int tex_x, int tex_y, int tex_w, int tex_h);
+
+/**
+ * @brief Draws a part of a texture with color
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param tex_x the starting point (x coordinate) where to start drawing
+ * @param tex_y the starting point (y coordinate) where to start drawing
+ * @param tex_w the width to draw from the starting point
+ * @param tex_h the height to draw from the starting point
+ * @param color the color to blend with the texture
+ */
+void sf2d_draw_texture_part_blend(const sf2d_texture *texture, int x, int y, int tex_x, int tex_y, int tex_w, int tex_h, u32 color);
+
+/**
+ * @brief Draws a texture with scaling
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param x_scale the x scale
+ * @param y_scale the y scale
+ */
+void sf2d_draw_texture_scale(const sf2d_texture *texture, int x, int y, float x_scale, float y_scale);
+
+/**
+ * @brief Draws a texture with scaling with color
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param x_scale the x scale
+ * @param y_scale the y scale
+ * @param color the color to blend with the texture
+ */
+void sf2d_draw_texture_scale_blend(const sf2d_texture *texture, int x, int y, float x_scale, float y_scale, u32 color);
+
+/**
+ * @brief Draws a part of a texture, with scaling
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param tex_x the starting point (x coordinate) where to start drawing
+ * @param tex_y the starting point (y coordinate) where to start drawing
+ * @param tex_w the width to draw from the starting point
+ * @param tex_h the height to draw from the starting point
+ * @param x_scale the x scale
+ * @param y_scale the y scale
+ */
+void sf2d_draw_texture_part_scale(const sf2d_texture *texture, float x, float y, float tex_x, float tex_y, float tex_w, float tex_h, float x_scale, float y_scale);
+
+/**
+ * @brief Draws a part of a texture, with scaling, with color
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param tex_x the starting point (x coordinate) where to start drawing
+ * @param tex_y the starting point (y coordinate) where to start drawing
+ * @param tex_w the width to draw from the starting point
+ * @param tex_h the height to draw from the starting point
+ * @param x_scale the x scale
+ * @param y_scale the y scale
+ * @param color the color to blend with the texture
+ */
+void sf2d_draw_texture_part_scale_blend(const sf2d_texture *texture, float x, float y, float tex_x, float tex_y, float tex_w, float tex_h, float x_scale, float y_scale, u32 color);
+
+/**
+ * @brief Draws a part of a texture, with rotation and scaling
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param rad rotation (in radians) to draw the texture
+ * @param tex_x the starting point (x coordinate) where to start drawing
+ * @param tex_y the starting point (y coordinate) where to start drawing
+ * @param tex_w the width to draw from the starting point
+ * @param tex_h the height to draw from the starting point
+ * @param x_scale the x scale
+ * @param y_scale the y scale
+ */
+void sf2d_draw_texture_part_rotate_scale(const sf2d_texture *texture, int x, int y, float rad, int tex_x, int tex_y, int tex_w, int tex_h, float x_scale, float y_scale);
+
+/**
+ * @brief Draws a part of a texture, with rotation, scaling and color
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param rad rotation (in radians) to draw the texture
+ * @param tex_x the starting point (x coordinate) where to start drawing
+ * @param tex_y the starting point (y coordinate) where to start drawing
+ * @param tex_w the width to draw from the starting point
+ * @param tex_h the height to draw from the starting point
+ * @param x_scale the x scale
+ * @param y_scale the y scale
+ * @param color the color to blend with the texture
+ */
+void sf2d_draw_texture_part_rotate_scale_blend(const sf2d_texture *texture, int x, int y, float rad, int tex_x, int tex_y, int tex_w, int tex_h, float x_scale, float y_scale, u32 color);
+
+/**
+ * @brief Draws a texture blended in a certain depth
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param z the depth to draw the texture to
+ * @note The z parameter is a value in the [-32768, +32767] range,
+ *       where -32768 is the deepest and +32767 the toppest.
+ *       By default, the textures are drawn at z = 0.
+ *       Keep in mind that this function won't do
+ *       Order-independent transparency (OIT), so you should use fully
+ *       opaque textures to get good results.
+ */
+void sf2d_draw_texture_depth(const sf2d_texture *texture, int x, int y, signed short z);
+
+/**
+ * @brief Draws a texture blended in a certain depth
+ * @param texture the texture to draw
+ * @param x the x coordinate to draw the texture to
+ * @param y the y coordinate to draw the texture to
+ * @param z the depth to draw the texture to
+ * @param color the color to blend with the texture
+ * @note The z parameter is a value in the [-32768, +32767] range,
+ *       where -32768 is the deepest and +32767 the toppest.
+ *       By default, the textures are drawn at z = 0.
+ *       Keep in mind that this function won't do
+ *       Order-independent transparency (OIT), so you should use fully
+ *       opaque textures to get good results.
+ */
+void sf2d_draw_texture_depth_blend(const sf2d_texture *texture, int x, int y, signed short z, u32 color);
+
+/**
+ * @brief Draws a texture using custom texture coordinates and parameters
+ * @param texture the texture to draw
+ * @param left the left coordinate of the texture to start drawing
+ * @param top the top coordinate of the texture to start drawing
+ * @param width the width to draw from the starting left coordinate
+ * @param height the height to draw from the starting top coordinate
+ * @param u0 the U texture coordinate of the left vertices
+ * @param v0 the V texture coordinate of the top vertices
+ * @param u1 the U texture coordinate of the right vertices
+ * @param v1 the V texture coordinate of the bottom vertices
+ * @param params the parameters to draw the texture with
+ */
+void sf2d_draw_quad_uv(const sf2d_texture *texture, float left, float top, float right, float bottom,
+	float u0, float v0, float u1, float v1, unsigned int params);
+
+/**
+ * @brief Changes a pixel of the texture
+ * @param texture the texture to change the pixel
+ * @param x the x coordinate to change the pixel
+ * @param y the y coordinate to change the pixel
+ * @param new_color the new color to set to the pixel at (x, y)
+ */
+void sf2d_set_pixel(sf2d_texture *texture, int x, int y, u32 new_color);
+
+/**
+ * @brief Gets a pixel of the texture
+ * @param texture the texture to get the pixel
+ * @param x the x coordinate to get the pixel
+ * @param y the y coordinate to get the pixel
+ * @return the pixel at (x, y)
+ */
+u32 sf2d_get_pixel(sf2d_texture *texture, int x, int y);
+
+/**
+ * @brief Tiles a texture
+ * @param texture the texture to tile
+ */
+void sf2d_texture_tile32(sf2d_texture *texture);
+
+/**
+ * @brief Sets the scissor test
+ * @param mode the test mode (disable, invert or normal)
+ * @param x the starting x coordinate of the scissor
+ * @param y the starting y coordinate of the scissor
+ * @param w the width of the scissor rectangle
+ * @param h the height of the scissor rectangle
+ * @note This function should be called after sf2d_start_frame.
+ *       The scissor will remain active until the sf2d_end_frame call.
+ */
+void sf2d_set_scissor_test(GPU_SCISSORMODE mode, u32 x, u32 y, u32 w, u32 h);
+
+/**
+ * @brief Returns the current screen (latest call to sf2d_start_frame)
+ * @note The returned value can be GFX_TOP or GFX_BOTTOM.
+ */
+gfxScreen_t sf2d_get_current_screen();
+
+/**
+ * @brief Returns the current screen side (latest call to sf2d_start_frame)
+ * @note The returned value can be GFX_LEFT or GFX_RIGHT.
+ */
+gfx3dSide_t sf2d_get_current_side();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif


Avoid an additional warning with Gtk+ 3

Avoid an additional warning with Gtk+ 3

--- src/browser.c
+++ src/browser.c
@@ -452,7 +452,11 @@
 	gtk_box_pack_start(GTK_BOX(vbox), browser->infobar, FALSE, TRUE, 0);
 #endif
 	/* paned */
+#if GTK_CHECK_VERSION(3, 0, 0)
+	hpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
+#else
 	hpaned = gtk_hpaned_new();
+#endif
 	gtk_paned_set_position(GTK_PANED(hpaned), 200);
 	/* plug-ins */
 #if GTK_CHECK_VERSION(3, 0, 0)


recorderendpoint: Fix bug in set_profile_to_encodebin method

Change-Id: I60eec248d93436d146a09e86f232c5b9259793bf

--- kmsrecorderendpoint.c
+++ kmsrecorderendpoint.c
@@ -376,7 +376,7 @@
   GstEncodingContainerProfile *cprof;

   has_video = kms_element_get_video_valve (KMS_ELEMENT (self)) != NULL;
-  has_audio = kms_element_get_video_valve (KMS_ELEMENT (self)) != NULL;
+  has_audio = kms_element_get_audio_valve (KMS_ELEMENT (self)) != NULL;

   // TODO: Add a property to select the profile, by now webm is used
   if (has_video)


Add command option for triggering dedicated bonding

--- test/l2test.c
+++ test/l2test.c
@@ -60,7 +60,8 @@
 	LSEND,
 	SENDDUMP,
 	LSENDDUMP,
-	INFOREQ
+	INFOREQ,
+	PAIRING,
 };

 static unsigned char *buf;
@@ -840,6 +841,48 @@
 	close(sk);
 }

+static void do_pairing(char *svr)
+{
+	struct sockaddr_l2 addr;
+	int sk, opt;
+
+	sk = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_L2CAP);
+	if (sk < 0) {
+		perror("Can't create socket");
+		return;
+	}
+
+	memset(&addr, 0, sizeof(addr));
+	addr.l2_family = AF_BLUETOOTH;
+	bacpy(&addr.l2_bdaddr, &bdaddr);
+
+	if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+		perror("Can't bind socket");
+		goto failed;
+	}
+
+	opt = L2CAP_LM_SECURE;
+
+	if (setsockopt(sk, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) {
+		perror("Can't set link mode");
+		goto failed;
+	}
+
+	memset(&addr, 0, sizeof(addr));
+	addr.l2_family = AF_BLUETOOTH;
+	str2ba(svr, &addr.l2_bdaddr);
+
+	if (connect(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0 ) {
+		perror("Can't connect socket");
+		goto failed;
+	}
+
+	printf("Pairing successful\n");
+
+failed:
+	close(sk);
+}
+
 static void usage(void)
 {
 	printf("l2test - L2CAP testing\n"
@@ -856,6 +899,7 @@
 		"\t-y connect, then send, then dump incoming data\n"
 		"\t-c connect, disconnect, connect, ...\n"
 		"\t-m multiple connects\n"
+		"\t-p trigger dedicated bonding\n"
 		"\t-z information request\n");

 	printf("Options:\n"
@@ -883,7 +927,7 @@

 	bacpy(&bdaddr, BDADDR_ANY);

-	while ((opt=getopt(argc,argv,"rdscuwmnxyzb:i:P:I:O:B:N:L:C:D:X:RGAESMT")) != EOF) {
+	while ((opt=getopt(argc,argv,"rdscuwmnxyzpb:i:P:I:O:B:N:L:C:D:X:RGAESMT")) != EOF) {
 		switch(opt) {
 		case 'r':
 			mode = RECV;
@@ -932,6 +976,11 @@

 		case 'z':
 			mode = INFOREQ;
+			need_addr = 1;
+			break;
+
+		case 'p':
+			mode = PAIRING;
 			need_addr = 1;
 			break;

@@ -1094,6 +1143,10 @@
 		case INFOREQ:
 			info_request(argv[optind]);
 			exit(0);
+
+		case PAIRING:
+			do_pairing(argv[optind]);
+			exit(0);
 	}

 	syslog(LOG_INFO, "Exit");


ocfs2: Make transaction extend more efficient.

In ocfs2_extend_rotate_transaction, op_credits is the orignal
credits in the handle and we only want to extend the credits
for the rotation, but the old solution always double it. It
is harmless for some minor operations, but for actions like
reflink we may rotate tree many times and cause the credits
increase dramatically. So this patch try to only increase
the desired credits.

Signed-off-by: Tao Ma <0490dca64807924fd58df0b0ee32b99ba7004a61@oracle.com>

--- fs/ocfs2/alloc.c
+++ fs/ocfs2/alloc.c
@@ -2326,10 +2326,18 @@
 					   int op_credits,
 					   struct ocfs2_path *path)
 {
+	int ret;
 	int credits = (path->p_tree_depth - subtree_depth) * 2 + 1 + op_credits;

-	if (handle->h_buffer_credits < credits)
-		return ocfs2_extend_trans(handle, credits);
+	if (handle->h_buffer_credits < credits) {
+		ret = ocfs2_extend_trans(handle,
+					 credits - handle->h_buffer_credits);
+		if (ret)
+			return ret;
+
+		if (unlikely(handle->h_buffer_credits < credits))
+			return ocfs2_extend_trans(handle, credits);
+	}

 	return 0;
 }


bsd olsrdport fix (2nd try)

bsd olsrdport fix (2nd try)

--- src/bsd/net.c
+++ src/bsd/net.c
@@ -441,7 +441,7 @@

   memset(&sin, 0, sizeof(sin));
   sin.sin6_family = AF_INET6;
-  sin.sin6_port = htons(DEF_OLSRPORT);
+  sin.sin6_port = htons(olsr_cnf->olsrport);
   if (bind(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
     perror("bind");
     syslog(LOG_ERR, "bind: %m");
@@ -591,10 +591,10 @@
     ip_id = (u_int16_t) (arc4random() & 0xffff);
   }

-  udp_tag = libnet_build_udp(698,       /* src port */
-                             698,       /* dest port */
+  udp_tag = libnet_build_udp(olsr_cnf->olsrport,        /* src port */
+                             olsr_cnf->olsrport,        /* dest port */
                              LIBNET_UDP_H + len,        /* length */
-                             0, /* checksum */
+                             0,         /* checksum */
                              buf,       /* payload */
                              len,       /* payload size */
                              context,   /* context */


pqueue_dequeue implementation correctness confirmed.

--- knapsack/src/pqueue.c
+++ knapsack/src/pqueue.c
@@ -92,23 +92,27 @@

         int k, level;
         /* If queue is empty, return null pointer. */
-        if (pq->nElements <= 1) return;
+        if (pq->nElements <= 1 && data) *data = NULL;
+        else if (pq->nElements <= 1) return;

         if (data) *data = pq->elements[1].data;
         if (priority) *priority = pq->elements[1].priority;

         /* Re-order queue. */
+        pq->nElements--;
         k = 1;
-        while (1) {
-                level = k * 2;
-                if (level + 1 < pq->nElements &&
-                    pq->elements[level+1].priority <
-                        pq->elements[level].priority) level ++;
+        while ((level = k * 2) < pq->nElements) {
+                if (level+1 < pq->nElements &&
+                    (pq->elements[level].priority >
+                     pq->elements[level+1].priority))
+                        level++;

-                if (pq->elements[pq->nElements].priority <=
+                if (pq->elements[pq->nElements].priority <=
                     pq->elements[level].priority) break;

-                pq->elements[k] = pq->elements[level];
+                pq->elements[k].data = pq->elements[level].data;
+                pq->elements[k].priority = pq->elements[level].priority;
+
                 k = level;
         }
         pq->elements[k] = pq->elements[pq->nElements];


Fix typo pointed out by Jordan.

Fix typo pointed out by Jordan.

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

--- include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h
+++ include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h
@@ -71,7 +71,7 @@
   StopTracking,

   /// All typestate tracking of the object ceases.  Unlike StopTracking,
-  /// this is also enforced when the method body cannot be inlined.
+  /// this is also enforced when the method body is inlined.
   ///
   /// In some cases, we obtain a better summary for this checker
   /// by looking at the call site than by inlining the function.


devicetree: make sure DT_INVALID_NODE docstring appears

Move the definition to a within a doxygengroup, so its documentation
appears in the reference page.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- include/devicetree.h
+++ include/devicetree.h
@@ -27,15 +27,6 @@
  * @{
  * @}
  */
-
-/**
- * @brief Name for an invalid node identifier
- *
- * This supports cases where factored macros can be invoked from paths where
- * devicetree data may or may not be available.  It is a preprocessor identifier
- * that does not match any valid devicetree node identifier.
- */
-#define DT_INVALID_NODE _

 /*
  * Property suffixes
@@ -71,6 +62,15 @@
  */

 /**
+ * @brief Name for an invalid node identifier
+ *
+ * This supports cases where factored macros can be invoked from paths where
+ * devicetree data may or may not be available.  It is a preprocessor identifier
+ * that does not match any valid devicetree node identifier.
+ */
+#define DT_INVALID_NODE _
+
+/**
  * @brief Node identifier for the root node in the devicetree
  */
 #define DT_ROOT DT_N


ocfs2: Use filemap_write_and_wait() instead of write_inode_now()

Since ocfs2 has no ->write_inode method, there's no point in calling
write_inode_now() from ocfs2_cleanup_delete_inode().  Use
filemap_write_and_wait() instead. This helps us to cleanup inode writing
interfaces...

Signed-off-by: Jan Kara <596727c8a0ea4db3ba2ceceedccbacd3d7b371b8@suse.cz>
Signed-off-by: Joel Becker <9d3d88cacb47f143c6cf36b9a61c09b528b2c49a@evilplan.org>

--- fs/ocfs2/inode.c
+++ fs/ocfs2/inode.c
@@ -951,7 +951,7 @@
 	trace_ocfs2_cleanup_delete_inode(
 		(unsigned long long)OCFS2_I(inode)->ip_blkno, sync_data);
 	if (sync_data)
-		write_inode_now(inode, 1);
+		filemap_write_and_wait(inode->i_mapping);
 	truncate_inode_pages(&inode->i_data, 0);
 }


Fix freopen() misconfiguration

Fix freopen() misconfiguration

--- examples/6lbr/apps/6lbr-webserver/webserver-log.c
+++ examples/6lbr/apps/6lbr-webserver/webserver-log.c
@@ -128,8 +128,10 @@
 {
   char *  log_file = getenv("LOG_6LBR_OUT");
   if ( log_file && strcmp(log_file, "-") != 0 ) {
-    fclose(stdin);
-    freopen(log_file, "w", stdin);
+    fclose(stdout);
+    if(freopen(log_file, "w", stdout) == NULL) {
+      fprintf(stderr, "Could not reopen stdout");
+    }
   }
   webserver_result_title = "Logs";
   webserver_result_text = "Logs cleared";


include: devicetree.h: Remove deprecated macros

These macros were deprecated in V2.6.0 release.
Remove them now.

Signed-off-by: Erwan Gouriou <de4d967452b83bb0e37525652734e7d9163b6a4c@linaro.org>

--- include/devicetree.h
+++ include/devicetree.h
@@ -820,131 +820,6 @@
 #define DT_STRING_UPPER_TOKEN(node_id, prop) \
 	DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN)

-/**
- * @brief Get an enumeration property's value as a token.
- *
- * This allows you to "remove the quotes" from some string-valued
- * properties. That can be useful, for example, when pasting the
- * values onto some other token to form an enum in C using the @p ##
- * preprocessor operator.
- *
- * DT_ENUM_TOKEN() can only be used for properties with string type
- * whose binding has an "enum:". The values in the binding's "enum:"
- * list must be unique after converting non-alphanumeric characters to
- * underscores.
- *
- * It is an error to use DT_ENUM_TOKEN() in other circumstances.
- *
- * Example devicetree fragment:
- *
- *     n1: node-1 {
- *             prop = "foo";
- *     };
- *     n2: node-2 {
- *             prop = "FOO";
- *     }
- *     n3: node-3 {
- *             prop = "123 foo";
- *     };
- *
- * Example bindings fragment:
- *
- *     properties:
- *       prop:
- *         type: string
- *         enum:
- *            - "foo"
- *            - "FOO"
- *            - "123 foo"
- *
- * Example usage:
- *
- *     DT_ENUM_TOKEN(DT_NODELABEL(n1), prop) // foo
- *     DT_ENUM_TOKEN(DT_NODELABEL(n2), prop) // FOO
- *     DT_ENUM_TOKEN(DT_NODELABEL(n3), prop) // 123_foo
- *
- * Notice how:
- *
- * - Unlike C identifiers, the property values may begin with a
- *   number. It's the user's responsibility not to use such values as
- *   the name of a C identifier.
- *
- * - The uppercased "FOO" in the DTS remains @p FOO as a token. It is
-     *not* converted to @p foo.
- *
- * - The whitespace in the DTS "123 foo" string is converted to @p
- *   123_foo as a token.
- *
- * @param node_id node identifier
- * @param prop lowercase-and-underscores property name with suitable
- *             enumeration of values in its binding
- * @return the value of @p prop as a token, i.e. without any quotes
- *         and with special characters converted to underscores
- */
-#define DT_ENUM_TOKEN(node_id, prop) \
-	__DEPRECATED_MACRO \
-	DT_CAT4(node_id, _P_, prop, _ENUM_TOKEN)
-
-/**
- * @brief Like DT_ENUM_TOKEN(), but uppercased
- *
- * This allows you to "remove the quotes and capitalize" some string-valued
- * properties.
- *
- * DT_ENUM_UPPER_TOKEN() can only be used for properties with string type
- * whose binding has an "enum:". The values in the binding's "enum:"
- * list must be unique after converting non-alphanumeric characters to
- * underscores and capitalizating any letters.
- *
- * It is an error to use DT_ENUM_UPPER_TOKEN() in other circumstances.
- *
- * Example devicetree fragment:
- *
- *     n1: node-1 {
- *             prop = "foo";
- *     };
- *     n2: node-2 {
- *             prop = "123 foo";
- *     };
- *
- * Example bindings fragment:
- *
- *     properties:
- *       prop:
- *         type: string
- *         enum:
- *            - "foo"
- *            - "123 foo"
- *
- * Example usage:
- *
- *     DT_ENUM_TOKEN((DT_NODELABEL(n1), prop) // FOO
- *     DT_ENUM_TOKEN((DT_NODELABEL(n2), prop) // 123_FOO
- *
- * Notice how:
- *
- * - Unlike C identifiers, the property values may begin with a
- *   number. It's the user's responsibility not to use such values as
- *   the name of a C identifier.
- *
- * - The lowercased "foo" in the DTS becomes @p FOO as a token, i.e.
- *   it is uppercased.
- *
- * - The whitespace in the DTS "123 foo" string is converted to @p
- *   123_FOO as a token, i.e. it is uppercased and whitespace becomes
- *   an underscore.
- *
- * @param node_id node identifier
- * @param prop lowercase-and-underscores property name with suitable
- *             enumeration of values in its binding
- * @return the value of @p prop as a capitalized token, i.e. upper case,
- *         without any quotes, and with special characters converted to
- *         underscores
- */
-#define DT_ENUM_UPPER_TOKEN(node_id, prop) \
-	__DEPRECATED_MACRO \
-	DT_CAT4(node_id, _P_, prop, _ENUM_UPPER_TOKEN)
-
 /*
  * phandle properties
  *


ocfs2: Make xattr reflink work with new local alloc reservation.

The new reservation code in local alloc has add the limitation
that the caller should handle the case that the local alloc
doesn't give use enough contiguous clusters. It make the old
xattr reflink code broken.

So this patch udpate the xattr reflink code so that it can
handle the case that local alloc give us one cluster at a time.

Signed-off-by: Tao Ma <0490dca64807924fd58df0b0ee32b99ba7004a61@oracle.com>
Signed-off-by: Joel Becker <823d0e2e55da83c1616b20ae9a15f9456fa076e5@oracle.com>

--- fs/ocfs2/xattr.c
+++ fs/ocfs2/xattr.c
@@ -6804,16 +6804,15 @@
 	return ret;
 }

-static int ocfs2_reflink_xattr_buckets(handle_t *handle,
+static int ocfs2_reflink_xattr_bucket(handle_t *handle,
 				u64 blkno, u64 new_blkno, u32 clusters,
+				u32 *cpos, int num_buckets,
 				struct ocfs2_alloc_context *meta_ac,
 				struct ocfs2_alloc_context *data_ac,
 				struct ocfs2_reflink_xattr_tree_args *args)
 {
 	int i, j, ret = 0;
 	struct super_block *sb = args->reflink->old_inode->i_sb;
-	u32 bpc = ocfs2_xattr_buckets_per_cluster(OCFS2_SB(sb));
-	u32 num_buckets = clusters * bpc;
 	int bpb = args->old_bucket->bu_blocks;
 	struct ocfs2_xattr_value_buf vb = {
 		.vb_access = ocfs2_journal_access,
@@ -6831,14 +6830,6 @@
 			mlog_errno(ret);
 			break;
 		}
-
-		/*
-		 * The real bucket num in this series of blocks is stored
-		 * in the 1st bucket.
-		 */
-		if (i == 0)
-			num_buckets = le16_to_cpu(
-				bucket_xh(args->old_bucket)->xh_num_buckets);

 		ret = ocfs2_xattr_bucket_journal_access(handle,
 						args->new_bucket,
@@ -6852,6 +6843,18 @@
 			memcpy(bucket_block(args->new_bucket, j),
 			       bucket_block(args->old_bucket, j),
 			       sb->s_blocksize);
+
+		/*
+		 * Record the start cpos so that we can use it to initialize
+		 * our xattr tree we also set the xh_num_bucket for the new
+		 * bucket.
+		 */
+		if (i == 0) {
+			*cpos = le32_to_cpu(bucket_xh(args->new_bucket)->
+					    xh_entries[0].xe_name_hash);
+			bucket_xh(args->new_bucket)->xh_num_buckets =
+				cpu_to_le16(num_buckets);
+		}

 		ocfs2_xattr_bucket_journal_dirty(handle, args->new_bucket);

@@ -6882,6 +6885,7 @@
 		}

 		ocfs2_xattr_bucket_journal_dirty(handle, args->new_bucket);
+
 		ocfs2_xattr_bucket_relse(args->old_bucket);
 		ocfs2_xattr_bucket_relse(args->new_bucket);
 	}
@@ -6890,6 +6894,75 @@
 	ocfs2_xattr_bucket_relse(args->new_bucket);
 	return ret;
 }
+
+static int ocfs2_reflink_xattr_buckets(handle_t *handle,
+				struct inode *inode,
+				struct ocfs2_reflink_xattr_tree_args *args,
+				struct ocfs2_extent_tree *et,
+				struct ocfs2_alloc_context *meta_ac,
+				struct ocfs2_alloc_context *data_ac,
+				u64 blkno, u32 cpos, u32 len)
+{
+	int ret, first_inserted = 0;
+	u32 p_cluster, num_clusters, reflink_cpos = 0;
+	u64 new_blkno;
+	unsigned int num_buckets, reflink_buckets;
+	unsigned int bpc =
+		ocfs2_xattr_buckets_per_cluster(OCFS2_SB(inode->i_sb));
+
+	ret = ocfs2_read_xattr_bucket(args->old_bucket, blkno);
+	if (ret) {
+		mlog_errno(ret);
+		goto out;
+	}
+	num_buckets = le16_to_cpu(bucket_xh(args->old_bucket)->xh_num_buckets);
+	ocfs2_xattr_bucket_relse(args->old_bucket);
+
+	while (len && num_buckets) {
+		ret = ocfs2_claim_clusters(handle, data_ac,
+					   1, &p_cluster, &num_clusters);
+		if (ret) {
+			mlog_errno(ret);
+			goto out;
+		}
+
+		new_blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster);
+		reflink_buckets = min(num_buckets, bpc * num_clusters);
+
+		ret = ocfs2_reflink_xattr_bucket(handle, blkno,
+						 new_blkno, num_clusters,
+						 &reflink_cpos, reflink_buckets,
+						 meta_ac, data_ac, args);
+		if (ret) {
+			mlog_errno(ret);
+			goto out;
+		}
+
+		/*
+		 * For the 1st allocated cluster, we make it use the same cpos
+		 * so that the xattr tree looks the same as the original one
+		 * in the most case.
+		 */
+		if (!first_inserted) {
+			reflink_cpos = cpos;
+			first_inserted = 1;
+		}
+		ret = ocfs2_insert_extent(handle, et, reflink_cpos, new_blkno,
+					  num_clusters, 0, meta_ac);
+		if (ret)
+			mlog_errno(ret);
+
+		mlog(0, "insert new xattr extent rec start %llu len %u to %u\n",
+		     (unsigned long long)new_blkno, num_clusters, reflink_cpos);
+
+		len -= num_clusters;
+		blkno += ocfs2_clusters_to_blocks(inode->i_sb, num_clusters);
+		num_buckets -= reflink_buckets;
+	}
+out:
+	return ret;
+}
+
 /*
  * Create the same xattr extent record in the new inode's xattr tree.
  */
@@ -6901,8 +6974,6 @@
 				   void *para)
 {
 	int ret, credits = 0;
-	u32 p_cluster, num_clusters;
-	u64 new_blkno;
 	handle_t *handle;
 	struct ocfs2_reflink_xattr_tree_args *args =
 			(struct ocfs2_reflink_xattr_tree_args *)para;
@@ -6911,6 +6982,9 @@
 	struct ocfs2_alloc_context *data_ac = NULL;
 	struct ocfs2_extent_tree et;

+	mlog(0, "reflink xattr buckets %llu len %u\n",
+	     (unsigned long long)blkno, len);
+
 	ocfs2_init_xattr_tree_extent_tree(&et,
 					  INODE_CACHE(args->reflink->new_inode),
 					  args->new_blk_bh);
@@ -6930,32 +7004,12 @@
 		goto out;
 	}

-	ret = ocfs2_claim_clusters(handle, data_ac,
-				   len, &p_cluster, &num_clusters);
-	if (ret) {
-		mlog_errno(ret);
-		goto out_commit;
-	}
-
-	new_blkno = ocfs2_clusters_to_blocks(osb->sb, p_cluster);
-
-	mlog(0, "reflink xattr buckets %llu to %llu, len %u\n",
-	     (unsigned long long)blkno, (unsigned long long)new_blkno, len);
-	ret = ocfs2_reflink_xattr_buckets(handle, blkno, new_blkno, len,
-					  meta_ac, data_ac, args);
-	if (ret) {
-		mlog_errno(ret);
-		goto out_commit;
-	}
-
-	mlog(0, "insert new xattr extent rec start %llu len %u to %u\n",
-	     (unsigned long long)new_blkno, len, cpos);
-	ret = ocfs2_insert_extent(handle, &et, cpos, new_blkno,
-				  len, 0, meta_ac);
+	ret = ocfs2_reflink_xattr_buckets(handle, inode, args, &et,
+					  meta_ac, data_ac,
+					  blkno, cpos, len);
 	if (ret)
 		mlog_errno(ret);

-out_commit:
 	ocfs2_commit_trans(osb, handle);

 out:


[FIX] std::forward in lambda with auto parameters [icpc bug]

--- include/seqan/align_parallel/parallel_align_interface.h
+++ include/seqan/align_parallel/parallel_align_interface.h
@@ -175,7 +175,11 @@
             auto it = begin(zipCont, Standard()) + splitter[job];
             auto itEnd = begin(zipCont, Standard()) + splitter[job + 1];

-            std::for_each(it, itEnd, [&](auto && seqPair)
+            // NOTE(marehr): auto && seqPair does not work, thus declaring the
+            // type explicitly, s.t. <=icpc 18.0.1 can compile the code (ticket
+            // #03204483)
+            using TSeqPair = decltype(*it);
+            std::for_each(it, itEnd, [&](TSeqPair && seqPair)
             {
                 std::get<2>(seqPair) = kernel(std::get<0>(seqPair), std::get<1>(seqPair), std::forward<TArgs>(args)...);
             });


Fix indent

Fix indent

--- examples/Export_Demo/Template_MKR1000/Indicator.h
+++ examples/Export_Demo/Template_MKR1000/Indicator.h
@@ -33,7 +33,7 @@
     COLOR_RED     = RGB(0xFF, 0x10, 0x08),
     COLOR_MAGENTA = RGB(0xA7, 0x00, 0xFF),
   };
-
+
   Indicator() {
     m_Counter = 0;
     initLED();
@@ -98,7 +98,7 @@
     analogWrite(BOARD_LED_PIN_B, b);
 #endif
   }
-
+
 #endif

   template<typename T>
@@ -114,18 +114,18 @@
     uint8_t redMax = (colorMax & 0xFF0000) >> 16;
     uint8_t greenMax = (colorMax & 0x00FF00) >> 8;
     uint8_t blueMax = (colorMax & 0x0000FF);
-
+
     // Brightness will rise from 0 to 128, then fall back to 0
     uint8_t brightness = (m_Counter < 128) ? m_Counter : 255 - m_Counter;
-
+
     // Multiply our three colors by the brightness:
     redMax *= ((float)brightness / 128.0);
     greenMax *= ((float)brightness / 128.0);
     blueMax *= ((float)brightness / 128.0);
     // And turn the LED to that color:
     setRGB((redMax << 16) | (greenMax << 8) | blueMax);
-
-    // This function relies on the 8-bit, unsigned m_Counter rolling over.
+
+    // This function relies on the 8-bit, unsigned m_Counter rolling over.
     m_Counter = (m_Counter+1) % 256;
     return breathePeriod / 256;
   }
@@ -153,12 +153,12 @@
     return next;
   }

-  uint32_t waveLED(uint32_t, unsigned breathePeriod) {
+  uint32_t waveLED(uint32_t, unsigned breathePeriod) {
     uint8_t brightness = (m_Counter < 128) ? m_Counter : 255 - m_Counter;

     setLED(BOARD_PWM_MAX * ((float)brightness / (BOARD_PWM_MAX/2)));

-    // This function relies on the 8-bit, unsigned m_Counter rolling over.
+    // This function relies on the 8-bit, unsigned m_Counter rolling over.
     m_Counter = (m_Counter+1) % 256;
     return breathePeriod / 256;
   }
@@ -167,7 +167,7 @@

   #warning Invalid LED configuration.

-#endif
+#endif

 private:
   uint8_t m_Counter;
@@ -186,7 +186,7 @@
       blinker.attach_ms(returnTime, indicator_run);
     }
   }
-
+
   void indicator_init() {
     blinker.attach_ms(100, indicator_run);
   }
@@ -225,7 +225,7 @@

 #elif defined(USE_TIMER_FIVE)

-  #include "Timer5.h"
+  #include <Timer5.h>

   int indicator_counter = -1;
   void indicator_run() {


Update PWGHFhfeLinkDef.h

Update PWGHFhfeLinkDef.h

--- PWGHF/hfe/PWGHFhfeLinkDef.h
+++ PWGHF/hfe/PWGHFhfeLinkDef.h
@@ -116,5 +116,6 @@
 #pragma link C++ class  AliAnalysisTaskTPCCalBeauty+;
 #pragma link C++ class  AliAnalysisHFETPCTOFNew+;
 #pragma link C++ class  AliAnalysisHFETPCTOFBeauty+;
+#pragma link C++ class  AliAnalysisTaskHFEmultTPCTOF+;

 #endif


add ckeck_mod builtin func

add ckeck_mod builtin func

--- src/builtin.c
+++ src/builtin.c
@@ -501,6 +501,19 @@
   return 1;
 }

+static int builtin_check_mod(lua_State* L)
+{
+  const char* accelerator = luaL_checkstring(L, 1);
+  unsigned key;
+  GdkModifierType mod;
+  gtk_accelerator_parse(accelerator, &key, &mod);
+  GdkDisplay* display = gdk_display_get_default();
+  GdkKeymap* kmap = gdk_keymap_get_for_display(display);
+  unsigned current_mod = gdk_keymap_get_modifier_state(kmap);
+  lua_pushboolean(L, mod & current_mod);
+  return 1;
+}
+
 static int builtin_get_monitor_model(lua_State* L)
 {
   Context* context = (Context*)lua_touserdata(L, lua_upvalueindex(1));
@@ -565,6 +578,7 @@
     { "increase_font_scale" , builtin_increase_font_scale  },
     { "decrease_font_scale" , builtin_decrease_font_scale  },
     { "reset_font_scale"    , builtin_reset_font_scale     },
+    { "check_mod"           , builtin_check_mod            },
     { "color_to_rgba"       , builtin_color_to_rgba        },
     { "rgba_to_color"       , builtin_rgba_to_color        },
     { "rgb_to_hex"          , builtin_rgb_to_hex           },


load the first default file, not the last

--- lib/configlib/configlib.c
+++ lib/configlib/configlib.c
@@ -131,6 +131,7 @@
         if (access(default_filenames[i], R_OK) == 0)
         {
             default_filename = default_filenames[i];
+            break;
         }
         else if (errno == ENOENT)
         {


Made sure that map->start_time and map->end_time when new files are read in

--- source/unemap/analysis_work_area.c
+++ source/unemap/analysis_work_area.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 FILE : analysis_work_area.c

-LAST MODIFIED : 26 November 2003
+LAST MODIFIED : 3 December 2003

 DESCRIPTION :
 ???DB.  Everything or nothing should be using the datum_time_object.  Currently
@@ -2395,17 +2395,17 @@
 	{
 		return_code=0;
 		display_message(ERROR_MESSAGE,
-			"clean_Analysis_work_area_before_load .Invalid arguments");
+			"clean_Analysis_work_area_before_load.  Invalid arguments");
 	}
 	LEAVE;

 	return (return_code);
-}/* clean_Analysis_work_area_before_load()*/
+} /* clean_Analysis_work_area_before_load */

 static int analysis_work_area_read_signal_file(char *file_name,
 	void *analysis_work_area)
 /*******************************************************************************
-LAST MODIFIED : 8 June 2003
+LAST MODIFIED : 3 December 2003

 DESCRIPTION :
 Sets up the analysis work area for analysing a set of signals.
@@ -2421,6 +2421,7 @@
 		minimum_separation,number_of_events,potential_time,return_code,
 		start_search_interval,threshold;
 	struct Analysis_work_area *analysis;
+	struct Map *map;
 	struct Rig *rig;
 	struct Signal_buffer *buffer;
 	struct Trace_window *trace;
@@ -2743,6 +2744,22 @@
 			return_code=0;
 			display_message(ERROR_MESSAGE,
 				"analysis_work_area_read_signal_file.  Invalid file: %s",file_name);
+		}
+		/* set the start and end frame times based on the potential time */
+		if ((analysis->rig)&&(analysis->rig->devices)&&
+			(*(analysis->rig->devices))&&
+			(buffer=get_Device_signal_buffer(*(analysis->rig->devices)))&&
+			(analysis->mapping_window)&&(map=analysis->mapping_window->map))
+		{
+			map->start_time=
+				(float)((buffer->times)[analysis->potential_time])*1000./
+				(buffer->frequency);
+			map->end_time=map->start_time;
+		}
+		else
+		{
+			map->start_time=0;
+			map->end_time=0;
 		}
 #if defined (UNEMAP_USE_3D)
 		/* convert the loaded rig to nodes/elements/fields */
@@ -3023,7 +3040,7 @@

 static int read_event_times_file(char *file_name,void *analysis_work_area)
 /*******************************************************************************
-LAST MODIFIED : 8 June 2003
+LAST MODIFIED : 3 December 2003

 DESCRIPTION :
 Sets up the analysis work area for analysing a previously analysed set of
@@ -3044,6 +3061,7 @@
 	struct Analysis_work_area *analysis;
 	struct Event *event,**event_next,*next_event;
 	struct Device **device;
+	struct Map *map;
 	struct Rig *rig;
 	struct Signal_buffer *buffer;
 	XmString new_dialog_title,old_dialog_title,value_xmstring;
@@ -3065,14 +3083,6 @@
 #endif /* defined (UNEMAP_USE_3D) */
 	if (file_name&&(analysis=(struct Analysis_work_area *)analysis_work_area))
 	{
-		clean_Analysis_work_area_before_load(analysis);
-		/* initialize the new analysis */
-		analysis->datum=0;
-		analysis->potential_time=0;
-		analysis->highlight=(struct Device **)NULL;
-		/* get the analysis window title */
-		XtVaGetValues(analysis->window->window,XmNdialogTitle,&old_dialog_title,
-			NULL);
 		if (input_file=fopen(file_name,"r"))
 		{
 			/* read the signal file name */
@@ -3080,6 +3090,14 @@
 			if (read_string(input_file,"[^ \n]",&signal_file_name))
 			{
 				fscanf(input_file,"\n");
+				clean_Analysis_work_area_before_load(analysis);
+				/* initialize the new analysis */
+				analysis->datum=0;
+				analysis->potential_time=0;
+				analysis->highlight=(struct Device **)NULL;
+				/* get the analysis window title */
+				XtVaGetValues(analysis->window->window,XmNdialogTitle,&old_dialog_title,
+					NULL);
 				if ((signal_input_file=fopen(signal_file_name,"rb"))&&
 					read_signal_file(signal_input_file,&(analysis->rig)
 #if defined (UNEMAP_USE_3D)
@@ -4057,6 +4075,22 @@
 #endif /* defined (UNEMAP_USE_3D) */

 				mapping_window_set_animation_buttons(analysis->mapping_window);
+				/* set the start and end frame times based on the potential time */
+				if ((analysis->rig)&&(analysis->rig->devices)&&
+					(*(analysis->rig->devices))&&
+					(buffer=get_Device_signal_buffer(*(analysis->rig->devices)))&&
+					(analysis->mapping_window)&&(map=analysis->mapping_window->map))
+				{
+					map->start_time=
+						(float)((buffer->times)[analysis->potential_time])*1000./
+						(buffer->frequency);
+					map->end_time=map->start_time;
+				}
+				else
+				{
+					map->start_time=0;
+					map->end_time=0;
+				}
 			}
 			else
 			{
@@ -4087,7 +4121,7 @@
 static int analysis_read_bard_signal_file(char *file_name,
 	void *analysis_work_area)
 /*******************************************************************************
-LAST MODIFIED : 3 January 2000
+LAST MODIFIED : 3 December 2003

 DESCRIPTION :
 Reads in the signals from the Bard file and sets up the analysis work area for
@@ -4107,25 +4141,7 @@
 	{
 		if (return_code=read_bard_signal_file(file_name,(void *)bard_rig))
 		{
-			/* clear the old analysis */
-			if (analysis->raw_rig)
-			{
-				if ((*(analysis->raw_rig->devices))&&
-					(buffer=get_Device_signal_buffer(*(analysis->raw_rig->devices))))
-				{
-					destroy_Signal_buffer(&buffer);
-				}
-				destroy_Rig(&(analysis->raw_rig));
-			}
-			if (analysis->rig)
-			{
-				if ((*(analysis->rig->devices))&&
-					(buffer=get_Device_signal_buffer(*(analysis->rig->devices))))
-				{
-					destroy_Signal_buffer(&buffer);
-				}
-				destroy_Rig(&(analysis->rig));
-			}
+			clean_Analysis_work_area_before_load(analysis);
 			/* initialize the new analysis */
 			analysis->rig=bard_rig;
 			bard_rig=(struct Rig *)NULL;
@@ -4195,6 +4211,22 @@
 					/* initialize datum */
 					analysis->datum=2*(analysis->potential_time);
 				}
+			}
+			/* set the start and end frame times based on the potential time */
+			if ((analysis->rig)&&(analysis->rig->devices)&&
+				(*(analysis->rig->devices))&&
+				(buffer=get_Device_signal_buffer(*(analysis->rig->devices)))&&
+				(analysis->mapping_window)&&(map=analysis->mapping_window->map))
+			{
+				map->start_time=
+					(float)((buffer->times)[analysis->potential_time])*1000./
+					(buffer->frequency);
+				map->end_time=map->start_time;
+			}
+			else
+			{
+				map->start_time=0;
+				map->end_time=0;
 			}
 			trace_change_rig(analysis->trace);
 			/* open the trace window */
@@ -4300,7 +4332,7 @@
 static int analysis_read_beekeeper_eeg_fil(char *file_name,
 	void *analysis_work_area)
 /*******************************************************************************
-LAST MODIFIED : 3 January 2000
+LAST MODIFIED : 3 December 2003

 DESCRIPTION :
 Reads in the signals from the Beekeeper file and sets up the analysis work area
@@ -4320,25 +4352,7 @@
 	{
 		if (return_code=read_beekeeper_eeg_file(file_name,(void *)&rig))
 		{
-			/* clear the old analysis */
-			if (analysis->raw_rig)
-			{
-				if ((*(analysis->raw_rig->devices))&&
-					(buffer=get_Device_signal_buffer(*(analysis->raw_rig->devices))))
-				{
-					destroy_Signal_buffer(&buffer);
-				}
-				destroy_Rig(&(analysis->raw_rig));
-			}
-			if (analysis->rig)
-			{
-				if ((*(analysis->rig->devices))&&
-					(buffer=get_Device_signal_buffer(*(analysis->rig->devices))))
-				{
-					destroy_Signal_buffer(&buffer);
-				}
-				destroy_Rig(&(analysis->rig));
-			}
+			clean_Analysis_work_area_before_load(analysis);
 			/* initialize the new analysis */
 			analysis->rig=rig;
 			analysis->datum=0;
@@ -4407,6 +4421,22 @@
 					/* initialize datum */
 					analysis->datum=2*(analysis->potential_time);
 				}
+			}
+			/* set the start and end frame times based on the potential time */
+			if ((analysis->rig)&&(analysis->rig->devices)&&
+				(*(analysis->rig->devices))&&
+				(buffer=get_Device_signal_buffer(*(analysis->rig->devices)))&&
+				(analysis->mapping_window)&&(map=analysis->mapping_window->map))
+			{
+				map->start_time=
+					(float)((buffer->times)[analysis->potential_time])*1000./
+					(buffer->frequency);
+				map->end_time=map->start_time;
+			}
+			else
+			{
+				map->start_time=0;
+				map->end_time=0;
 			}
 			trace_change_rig(analysis->trace);
 			/* open the trace window */
@@ -4455,7 +4485,7 @@
 static int analysis_read_bdf_or_edf_file(struct Analysis_work_area *analysis,
 	int bdf)
 /*******************************************************************************
-LAST MODIFIED : 8 June 2003
+LAST MODIFIED : 3 December 2003

 DESCRIPTION :
 Reads in the signals from the bdf or edf file and sets up the analysis work area
@@ -4464,6 +4494,7 @@
 {
 	char *file_name,*temp_string,ext_str[5];
 	int buffer_end,buffer_start,return_code;
+	struct Map *map;
 	struct Rig *rig;
 	struct Signal_buffer *buffer;
 	XmString new_dialog_title,old_dialog_title;
@@ -4550,6 +4581,22 @@
 				return_code=0;
 				display_message(ERROR_MESSAGE,"analysis_read_bdf_or_edf_file.  "
 					"Invalid edf file: %s or cnfg file ",file_name);
+			}
+			/* set the start and end frame times based on the potential time */
+			if ((analysis->rig)&&(analysis->rig->devices)&&
+				(*(analysis->rig->devices))&&
+				(buffer=get_Device_signal_buffer(*(analysis->rig->devices)))&&
+				(analysis->mapping_window)&&(map=analysis->mapping_window->map))
+			{
+				map->start_time=
+					(float)((buffer->times)[analysis->potential_time])*1000./
+					(buffer->frequency);
+				map->end_time=map->start_time;
+			}
+			else
+			{
+				map->start_time=0;
+				map->end_time=0;
 			}
 #if defined (UNEMAP_USE_3D)
 			/* put the rig into nodes */
@@ -4823,7 +4870,7 @@
 static int analysis_read_neurosoft_sig_fil(char *file_name,
 	void *analysis_work_area)
 /*******************************************************************************
-LAST MODIFIED : 3 January 2000
+LAST MODIFIED : 3 December 2003

 DESCRIPTION :
 Reads in the signals from the Neurosoft file and sets up the analysis work area
@@ -4844,25 +4891,7 @@
 		if (return_code=read_neurosoft_row_points_file(file_name,
 			(void *)neurosoft_rig))
 		{
-			/* clear the old analysis */
-			if (analysis->raw_rig)
-			{
-				if ((*(analysis->raw_rig->devices))&&
-					(buffer=get_Device_signal_buffer(*(analysis->raw_rig->devices))))
-				{
-					destroy_Signal_buffer(&buffer);
-				}
-				destroy_Rig(&(analysis->raw_rig));
-			}
-			if (analysis->rig)
-			{
-				if ((*(analysis->rig->devices))&&
-					(buffer=get_Device_signal_buffer(*(analysis->rig->devices))))
-				{
-					destroy_Signal_buffer(&buffer);
-				}
-				destroy_Rig(&(analysis->rig));
-			}
+			clean_Analysis_work_area_before_load(analysis);
 			/* initialize the new analysis */
 			analysis->rig=neurosoft_rig;
 			neurosoft_rig=(struct Rig *)NULL;
@@ -4932,6 +4961,22 @@
 					/* initialize datum */
 					analysis->datum=2*(analysis->potential_time);
 				}
+			}
+			/* set the start and end frame times based on the potential time */
+			if ((analysis->rig)&&(analysis->rig->devices)&&
+				(*(analysis->rig->devices))&&
+				(buffer=get_Device_signal_buffer(*(analysis->rig->devices)))&&
+				(analysis->mapping_window)&&(map=analysis->mapping_window->map))
+			{
+				map->start_time=
+					(float)((buffer->times)[analysis->potential_time])*1000./
+					(buffer->frequency);
+				map->end_time=map->start_time;
+			}
+			else
+			{
+				map->start_time=0;
+				map->end_time=0;
 			}
 			trace_change_rig(analysis->trace);
 			/* open the trace window */
@@ -5041,7 +5086,7 @@
 static int analysis_read_cardiomapp_sig_fi(char *file_name,
 	void *analysis_work_area)
 /*******************************************************************************
-LAST MODIFIED : 30 November 1999
+LAST MODIFIED : 3 December 2003

 DESCRIPTION :
 Reads in the signals from the CardioMapp file and sets up the analysis work area
@@ -5061,25 +5106,7 @@
 	{
 		if (return_code=read_cardiomapp_file(file_name,(void *)cardiomapp_rig))
 		{
-			/* clear the old analysis */
-			if (analysis->raw_rig)
-			{
-				if ((*(analysis->raw_rig->devices))&&
-					(buffer=get_Device_signal_buffer(*(analysis->raw_rig->devices))))
-				{
-					destroy_Signal_buffer(&buffer);
-				}
-				destroy_Rig(&(analysis->raw_rig));
-			}
-			if (analysis->rig)
-			{
-				if ((*(analysis->rig->devices))&&
-					(buffer=get_Device_signal_buffer(*(analysis->rig->devices))))
-				{
-					destroy_Signal_buffer(&buffer);
-				}
-				destroy_Rig(&(analysis->rig));
-			}
+			clean_Analysis_work_area_before_load(analysis);
 			/* initialize the new analysis */
 			analysis->rig=cardiomapp_rig;
 			cardiomapp_rig=(struct Rig *)NULL;
@@ -5149,6 +5176,22 @@
 					/* initialize datum */
 					analysis->datum=2*(analysis->potential_time);
 				}
+			}
+			/* set the start and end frame times based on the potential time */
+			if ((analysis->rig)&&(analysis->rig->devices)&&
+				(*(analysis->rig->devices))&&
+				(buffer=get_Device_signal_buffer(*(analysis->rig->devices)))&&
+				(analysis->mapping_window)&&(map=analysis->mapping_window->map))
+			{
+				map->start_time=
+					(float)((buffer->times)[analysis->potential_time])*1000./
+					(buffer->frequency);
+				map->end_time=map->start_time;
+			}
+			else
+			{
+				map->start_time=0;
+				map->end_time=0;
 			}
 			trace_change_rig(analysis->trace);
 			/* open the trace window */


Squashfs: uid/gid lookup operations

Squashfs: uid/gid lookup operations

Signed-off-by: Phillip Lougher <21542e38a0b82113edef7e33c378f247e235fb75@lougher.demon.co.uk>

error: pathspec 'fs/squashfs/id.c' did not match any file(s) known to git

--- fs/squashfs/id.c
+++ fs/squashfs/id.c
@@ -0,0 +1,94 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
+ *
+ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ * Phillip Lougher <phillip@lougher.demon.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * id.c
+ */
+
+/*
+ * This file implements code to handle uids and gids.
+ *
+ * For space efficiency regular files store uid and gid indexes, which are
+ * converted to 32-bit uids/gids using an id look up table.  This table is
+ * stored compressed into metadata blocks.  A second index table is used to
+ * locate these.  This second index table for speed of access (and because it
+ * is small) is read at mount time and cached in memory.
+ */
+
+#include <linux/fs.h>
+#include <linux/vfs.h>
+#include <linux/slab.h>
+#include <linux/zlib.h>
+
+#include "squashfs_fs.h"
+#include "squashfs_fs_sb.h"
+#include "squashfs_fs_i.h"
+#include "squashfs.h"
+
+/*
+ * Map uid/gid index into real 32-bit uid/gid using the id look up table
+ */
+int squashfs_get_id(struct super_block *sb, unsigned int index,
+					unsigned int *id)
+{
+	struct squashfs_sb_info *msblk = sb->s_fs_info;
+	int block = SQUASHFS_ID_BLOCK(index);
+	int offset = SQUASHFS_ID_BLOCK_OFFSET(index);
+	u64 start_block = le64_to_cpu(msblk->id_table[block]);
+	__le32 disk_id;
+	int err;
+
+	err = squashfs_read_metadata(sb, &disk_id, &start_block, &offset,
+							sizeof(disk_id));
+	if (err < 0)
+		return err;
+
+	*id = le32_to_cpu(disk_id);
+	return 0;
+}
+
+
+/*
+ * Read uncompressed id lookup table indexes from disk into memory
+ */
+__le64 *squashfs_read_id_index_table(struct super_block *sb,
+			u64 id_table_start, unsigned short no_ids)
+{
+	unsigned int length = SQUASHFS_ID_BLOCK_BYTES(no_ids);
+	__le64 *id_table;
+	int err;
+
+	TRACE("In read_id_index_table, length %d\n", length);
+
+	/* Allocate id lookup table indexes */
+	id_table = kmalloc(length, GFP_KERNEL);
+	if (id_table == NULL) {
+		ERROR("Failed to allocate id index table\n");
+		return ERR_PTR(-ENOMEM);
+	}
+
+	err = squashfs_read_table(sb, id_table, id_table_start, length);
+	if (err < 0) {
+		ERROR("unable to read id index table\n");
+		kfree(id_table);
+		return ERR_PTR(err);
+	}
+
+	return id_table;
+}


API: Add width() and height() to DFBRegion

--- include/directfb++.h
+++ include/directfb++.h
@@ -265,6 +265,14 @@
           y2 = y1 + dimension.h - 1;
      }

+     int width() const {
+          return x2 - x1 + 1;
+     }
+
+     int height() const {
+          return y2 - y1 + 1;
+     }
+
      bool operator== ( const DFBRegion &ref ) const {
           return ref.x1 == x1 && ref.y1 == y1 && ref.x2 == x2 && ref.y2 == y2;
      }


test: add missing delimiters ':' in load commands

--- test/unit/core/test-log.c
+++ test/unit/core/test-log.c
@@ -90,7 +90,7 @@
   assert_send_command("column_create Users desc COLUMN_SCALAR ShortText");
   grn_collect_logger_clear_messages(logger);
   assert_send_command("load --table Users --input_type json\n"
-                      "{\"name\": \"groonga\" @ \"desc\" \"search engine\"}\n"
+                      "{\"name\": \"groonga\" @ \"desc\": \"search engine\"}\n"
                       "");
   log = (GList *)grn_collect_logger_get_messages(logger);
   cut_assert_equal_string("ignored invalid char('@') at",
@@ -110,7 +110,7 @@
   assert_send_command("column_create Users desc COLUMN_SCALAR ShortText");
   grn_collect_logger_clear_messages(logger);
   assert_send_command("load --table Users --input_type json\n"
-                      "{\"info\" \"search engine\"}\n"
+                      "{\"info\": \"search engine\"}\n"
                       "");
   log = (GList *)grn_collect_logger_get_messages(logger);
   cut_assert_equal_string("neither _key nor _id is assigned",
@@ -142,7 +142,7 @@
   assert_send_command("column_create Users desc COLUMN_SCALAR ShortText");
   grn_collect_logger_clear_messages(logger);
   assert_send_command("load --table Users --input_type json\n"
-                      "{\"_key\": \"groonga\", \"info\" \"search engine\"}\n"
+                      "{\"_key\": \"groonga\", \"info\": \"search engine\"}\n"
                       "");
   log = (GList *)grn_collect_logger_get_messages(logger);
   cut_assert_equal_string("invalid column('info')", g_list_nth_data(log, 0));


Fixed the name of the syscall.h header guard to fit in with the general convention.

--- kernel/arc/proc/syscall.h
+++ kernel/arc/proc/syscall.h
@@ -14,8 +14,8 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */

-#ifndef ARC_SMP_SYSCALL_H
-#define ARC_SMP_SYSCALL_H
+#ifndef ARC_PROC_SYSCALL_H
+#define ARC_PROC_SYSCALL_H

 void syscall_init(void);
 void syscall_stub(void);


input: Don't print an error for missing conf file

--- profiles/input/manager.c
+++ profiles/input/manager.c
@@ -119,7 +119,8 @@
 	keyfile = g_key_file_new();

 	if (!g_key_file_load_from_file(keyfile, file, 0, &err)) {
-		error("Parsing %s failed: %s", file, err->message);
+		if (!g_error_matches(err, G_FILE_ERROR, G_FILE_ERROR_NOENT))
+			error("Parsing %s failed: %s", file, err->message);
 		g_error_free(err);
 		g_key_file_free(keyfile);
 		return NULL;


Increased unimrcp version number to be able to differentiate trunk and 0.9.0 release.

--- build/uni_version.h
+++ build/uni_version.h
@@ -39,7 +39,7 @@
  * Minor API changes that do not cause binary compatibility problems.
  * Reset to 0 when upgrading UNI_MAJOR_VERSION
  */
-#define UNI_MINOR_VERSION   9
+#define UNI_MINOR_VERSION   10

 /** patch level
  * The Patch Level never includes API changes, simply bug fixes.


Fixed the Exception::what() function

Fixed the Exception::what() function

--- include/exceptions.h
+++ include/exceptions.h
@@ -61,16 +61,19 @@
 	class Exception: public std::exception {
 	public:
 		Exception(int line_, int column_, const std::string& msg_)
-			: line(line_), column(column_), msg(msg_) {}
+			: line(line_), column(column_), msg(msg_) {
+				std::stringstream output;
+				output << "Error at line " << line+1 << ", column " << column+1 << ": " << msg;
+				what_ = output.str();
+			}
 		virtual ~Exception() throw() {}
-		virtual const char *what() const throw() {
-			std::stringstream output;
-			output << "Error at line " << line+1 << ", column " << column+1 << ": " << msg;
-			return output.str().c_str();
-		}
+		virtual const char *what() const throw() { return what_.c_str(); }

 		int line, column;
 		std::string msg;
+
+	private:
+		std::string what_;
 	};

 	class ParserException: public Exception {


Re-added terminal wrapping

Re-added terminal wrapping

--- kernel/drivers/terminal.c
+++ kernel/drivers/terminal.c
@@ -46,6 +46,11 @@
         return c;
     }

+    if(term_column >= VGA_WIDTH) {
+        term_color = 0;
+        term_row++;
+    }
+
     term_putentryat(c, term_color, term_column, term_row);
     if (++term_column == VGA_WIDTH) {
         term_column = 0;


more LST cooking

more LST cooking

--- prog/prog_filling/main.c
+++ prog/prog_filling/main.c
@@ -6,14 +6,16 @@

 #define MAXFILES 7000

-//NODATA, Top and Bottom Boundary conditions
-#define NODATA -28768
 //For MODIS NDVI
 //#define TBC 10000
 //#define BBC -2000
+//NODATA, Top and Bottom Boundary conditions
+//#define NODATA -28768
 //For MODIS LST
 #define TBC 20000
-#define BBC 0
+#define BBC 5000
+//NODATA, Top and Bottom Boundary conditions
+#define NODATA 0

 void usage()
 {


Fix Microsoft Visual Studio 14.0 build

Fix Microsoft Visual Studio 14.0 build

--- include/fmt/chrono.h
+++ include/fmt/chrono.h
@@ -1714,11 +1714,11 @@
   }

   // '}' - for detail::parse_chrono_format.
-  static constexpr Char default_specs[] = {'%', 'F', ' ', '%', 'T', '}'};
+  static constexpr const Char default_specs[] = {'%', 'F', ' ', '%', 'T', '}'};
 };

 template <typename Char, typename Duration>
-constexpr Char
+constexpr const Char
     formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
               Char>::default_specs[];


posix-timers: Cleanup reaped target handling

When a timer's target is seen to be buried, for example on calls
to timer_gettime(), the posix cpu timers code behaves a bit
like a garbage collector and releases early the reference to the
task.

Then again, this optimization complicates the code for no much
value: it's up to the user to release the timer and its associated
ressources by calling timer_delete() after it buries the target
tasks.

Remove this to simplify the code.

Signed-off-by: Frederic Weisbecker <e8a1bf9163cb25e93cfd6540f223b3872ea7ee55@gmail.com>
Cc: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Cc: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>
Cc: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Cc: Oleg Nesterov <20b70f0af00562e63758b9ee42012ecc96c58590@redhat.com>
Cc: Kosaki Motohiro <70a1d3ef3e17a2bb0f09a1b2e6c86f607ed1d6d9@jp.fujitsu.com>
Cc: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>


cert_req now supports key_usage and ns_cert_type command line options

--- programs/x509/cert_req.c
+++ programs/x509/cert_req.c
@@ -44,6 +44,8 @@
 #define DFL_DEBUG_LEVEL         0
 #define DFL_OUTPUT_FILENAME     "cert.req"
 #define DFL_SUBJECT_NAME        "CN=Cert,O=PolarSSL,C=NL"
+#define DFL_KEY_USAGE           0
+#define DFL_NS_CERT_TYPE        0

 /*
  * global options
@@ -54,16 +56,9 @@
     int debug_level;            /* level of debugging                   */
     char *output_file;          /* where to store the constructed key file  */
     char *subject_name;         /* subject name for certificate request */
+    unsigned char key_usage;    /* key usage flags                      */
+    unsigned char ns_cert_type; /* NS cert type                         */
 } opt;
-
-void my_debug( void *ctx, int level, const char *str )
-{
-    if( level < opt.debug_level )
-    {
-        fprintf( (FILE *) ctx, "%s", str );
-        fflush(  (FILE *) ctx  );
-    }
-}

 int write_certificate_request( x509_csr *req, char *output_file )
 {
@@ -114,6 +109,24 @@
     "    debug_level=%%d      default: 0 (disabled)\n"  \
     "    output_file=%%s      default: cert.req\n"      \
     "    subject_name=%%s     default: CN=Cert,O=PolarSSL,C=NL\n"   \
+    "    key_usage=%%s        default: (empty)\n"       \
+    "                        Comma-separated-list of values:\n"     \
+    "                          digital_signature\n"     \
+    "                          non_repudiation\n"       \
+    "                          key_encipherment\n"      \
+    "                          data_encipherment\n"     \
+    "                          key_agreement\n"         \
+    "                          key_certificate_sign\n"  \
+    "                          crl_sign\n"              \
+    "    ns_cert_type=%%s     default: (empty)\n"       \
+    "                        Comma-separated-list of values:\n"     \
+    "                          ssl_client\n"            \
+    "                          ssl_server\n"            \
+    "                          email\n"                 \
+    "                          object_signing\n"        \
+    "                          ssl_ca\n"                \
+    "                          email_ca\n"              \
+    "                          object_signing_ca\n"     \
     "\n"

 #if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) ||         \
@@ -134,7 +147,7 @@
     rsa_context rsa;
     char buf[1024];
     int i, j, n;
-    char *p, *q;
+    char *p, *q, *r;
     x509_csr req;

     /*
@@ -149,6 +162,7 @@
     {
     usage:
         printf( USAGE );
+        ret = 1;
         goto exit;
     }

@@ -156,6 +170,8 @@
     opt.debug_level         = DFL_DEBUG_LEVEL;
     opt.output_file         = DFL_OUTPUT_FILENAME;
     opt.subject_name        = DFL_SUBJECT_NAME;
+    opt.key_usage           = DFL_KEY_USAGE;
+    opt.ns_cert_type        = DFL_NS_CERT_TYPE;

     for( i = 1; i < argc; i++ )
     {
@@ -186,9 +202,69 @@
         {
             opt.subject_name = q;
         }
+        else if( strcmp( p, "key_usage" ) == 0 )
+        {
+            while( q != NULL )
+            {
+                if( ( r = strchr( q, ',' ) ) != NULL )
+                    *r++ = '\0';
+
+                if( strcmp( q, "digital_signature" ) == 0 )
+                    opt.key_usage |= KU_DIGITAL_SIGNATURE;
+                else if( strcmp( q, "non_repudiation" ) == 0 )
+                    opt.key_usage |= KU_NON_REPUDIATION;
+                else if( strcmp( q, "key_encipherment" ) == 0 )
+                    opt.key_usage |= KU_KEY_ENCIPHERMENT;
+                else if( strcmp( q, "data_encipherment" ) == 0 )
+                    opt.key_usage |= KU_DATA_ENCIPHERMENT;
+                else if( strcmp( q, "key_agreement" ) == 0 )
+                    opt.key_usage |= KU_KEY_AGREEMENT;
+                else if( strcmp( q, "key_cert_sign" ) == 0 )
+                    opt.key_usage |= KU_KEY_CERT_SIGN;
+                else if( strcmp( q, "crl_sign" ) == 0 )
+                    opt.key_usage |= KU_CRL_SIGN;
+                else
+                    goto usage;
+
+                q = r;
+            }
+        }
+        else if( strcmp( p, "ns_cert_type" ) == 0 )
+        {
+            while( q != NULL )
+            {
+                if( ( r = strchr( q, ',' ) ) != NULL )
+                    *r++ = '\0';
+
+                if( strcmp( q, "ssl_client" ) == 0 )
+                    opt.ns_cert_type |= NS_CERT_TYPE_SSL_CLIENT;
+                else if( strcmp( q, "ssl_server" ) == 0 )
+                    opt.ns_cert_type |= NS_CERT_TYPE_SSL_SERVER;
+                else if( strcmp( q, "email" ) == 0 )
+                    opt.ns_cert_type |= NS_CERT_TYPE_EMAIL;
+                else if( strcmp( q, "object_signing" ) == 0 )
+                    opt.ns_cert_type |= NS_CERT_TYPE_OBJECT_SIGNING;
+                else if( strcmp( q, "ssl_ca" ) == 0 )
+                    opt.ns_cert_type |= NS_CERT_TYPE_SSL_CA;
+                else if( strcmp( q, "email_ca" ) == 0 )
+                    opt.ns_cert_type |= NS_CERT_TYPE_EMAIL_CA;
+                else if( strcmp( q, "object_signing_ca" ) == 0 )
+                    opt.ns_cert_type |= NS_CERT_TYPE_OBJECT_SIGNING_CA;
+                else
+                    goto usage;
+
+                q = r;
+            }
+        }
         else
             goto usage;
     }
+
+    if( opt.key_usage )
+        x509write_csr_set_key_usage( &req, opt.key_usage );
+
+    if( opt.ns_cert_type )
+        x509write_csr_set_ns_cert_type( &req, opt.ns_cert_type );

     /*
      * 1.0. Check the subject name for validity


-Wattributes visibility warning with some GCC versions (#1975)

--- include/fmt/format.h
+++ include/fmt/format.h
@@ -67,6 +67,13 @@
 #  define FMT_NOINLINE __attribute__((noinline))
 #else
 #  define FMT_NOINLINE
+#endif
+
+// Special definition specific to GCC only
+#if FMT_GCC_VERSION
+#  define FMT_GCC_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#else
+#  define FMT_GCC_VISIBILITY_HIDDEN
 #endif

 #if __cplusplus == 201103L || __cplusplus == 201402L
@@ -3200,8 +3207,10 @@

 #define FMT_STRING_IMPL(s, base)                                  \
   [] {                                                            \
+    /* Use a hidden visibility as workaround for some GCC, see */ \
+    /* https://github.com/fmtlib/fmt/issues/1973 for details */   \
     /* Use a macro-like name to avoid shadowing warnings. */      \
-    struct FMT_COMPILE_STRING : base {                            \
+    struct FMT_GCC_VISIBILITY_HIDDEN FMT_COMPILE_STRING : base {  \
       using char_type = fmt::remove_cvref_t<decltype(s[0])>;      \
       FMT_MAYBE_UNUSED FMT_CONSTEXPR                              \
       operator fmt::basic_string_view<char_type>() const {        \


time: Add timekeeper lock

time: Add timekeeper lock

Now that all the timekeeping variables are stored in
the timekeeper structure, add a new lock to protect the
structure.

For now, this lock nests under the xtime_lock for writes.

For readers, we don't need to take xtime_lock anymore.

CC: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
CC: Eric Dumazet <a0baddf32b28d2f9429941ed4af2fe636e210591@gmail.com>
CC: Richard Cochran <e27030aebe9cad8817d34b8c31dbaf301fb798b9@gmail.com>
Signed-off-by: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>

--- kernel/time/timekeeping.c
+++ kernel/time/timekeeping.c
@@ -69,6 +69,9 @@
 	struct timespec total_sleep_time;
 	/* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */
 	struct timespec raw_time;
+
+	/* Seqlock for all timekeeper values */
+	seqlock_t lock;
 };

 static struct timekeeper timekeeper;
@@ -172,10 +175,17 @@
 /* must hold xtime_lock */
 void timekeeping_leap_insert(int leapsecond)
 {
+	unsigned long flags;
+
+	write_seqlock_irqsave(&timekeeper.lock, flags);
+
 	timekeeper.xtime.tv_sec += leapsecond;
 	timekeeper.wall_to_monotonic.tv_sec -= leapsecond;
 	update_vsyscall(&timekeeper.xtime, &timekeeper.wall_to_monotonic,
 			 timekeeper.clock, timekeeper.mult);
+
+	write_sequnlock_irqrestore(&timekeeper.lock, flags);
+
 }

 /**
@@ -222,7 +232,7 @@
 	WARN_ON(timekeeping_suspended);

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);

 		*ts = timekeeper.xtime;
 		nsecs = timekeeping_get_ns();
@@ -230,7 +240,7 @@
 		/* If arch requires, add in gettimeoffset() */
 		nsecs += arch_gettimeoffset();

-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));

 	timespec_add_ns(ts, nsecs);
 }
@@ -245,7 +255,7 @@
 	WARN_ON(timekeeping_suspended);

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);
 		secs = timekeeper.xtime.tv_sec +
 				timekeeper.wall_to_monotonic.tv_sec;
 		nsecs = timekeeper.xtime.tv_nsec +
@@ -254,7 +264,7 @@
 		/* If arch requires, add in gettimeoffset() */
 		nsecs += arch_gettimeoffset();

-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));
 	/*
 	 * Use ktime_set/ktime_add_ns to create a proper ktime on
 	 * 32-bit architectures without CONFIG_KTIME_SCALAR.
@@ -280,14 +290,14 @@
 	WARN_ON(timekeeping_suspended);

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);
 		*ts = timekeeper.xtime;
 		tomono = timekeeper.wall_to_monotonic;
 		nsecs = timekeeping_get_ns();
 		/* If arch requires, add in gettimeoffset() */
 		nsecs += arch_gettimeoffset();

-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));

 	set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec,
 				ts->tv_nsec + tomono.tv_nsec + nsecs);
@@ -315,7 +325,7 @@
 	do {
 		u32 arch_offset;

-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);

 		*ts_raw = timekeeper.raw_time;
 		*ts_real = timekeeper.xtime;
@@ -328,7 +338,7 @@
 		nsecs_raw += arch_offset;
 		nsecs_real += arch_offset;

-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));

 	timespec_add_ns(ts_raw, nsecs_raw);
 	timespec_add_ns(ts_real, nsecs_real);
@@ -362,12 +372,13 @@
 int do_settimeofday(const struct timespec *tv)
 {
 	struct timespec ts_delta;
-	unsigned long flags;
+	unsigned long flags1,flags2;

 	if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
 		return -EINVAL;

-	write_seqlock_irqsave(&xtime_lock, flags);
+	write_seqlock_irqsave(&xtime_lock, flags1);
+	write_seqlock_irqsave(&timekeeper.lock, flags2);

 	timekeeping_forward_now();

@@ -384,7 +395,8 @@
 	update_vsyscall(&timekeeper.xtime, &timekeeper.wall_to_monotonic,
 			timekeeper.clock, timekeeper.mult);

-	write_sequnlock_irqrestore(&xtime_lock, flags);
+	write_sequnlock_irqrestore(&timekeeper.lock, flags2);
+	write_sequnlock_irqrestore(&xtime_lock, flags1);

 	/* signal hrtimers about time change */
 	clock_was_set();
@@ -403,12 +415,13 @@
  */
 int timekeeping_inject_offset(struct timespec *ts)
 {
-	unsigned long flags;
+	unsigned long flags1,flags2;

 	if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC)
 		return -EINVAL;

-	write_seqlock_irqsave(&xtime_lock, flags);
+	write_seqlock_irqsave(&xtime_lock, flags1);
+	write_seqlock_irqsave(&timekeeper.lock, flags2);

 	timekeeping_forward_now();

@@ -422,7 +435,8 @@
 	update_vsyscall(&timekeeper.xtime, &timekeeper.wall_to_monotonic,
 			timekeeper.clock, timekeeper.mult);

-	write_sequnlock_irqrestore(&xtime_lock, flags);
+	write_sequnlock_irqrestore(&timekeeper.lock, flags2);
+	write_sequnlock_irqrestore(&xtime_lock, flags1);

 	/* signal hrtimers about time change */
 	clock_was_set();
@@ -494,11 +508,11 @@
 	s64 nsecs;

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);
 		nsecs = timekeeping_get_ns_raw();
 		*ts = timekeeper.raw_time;

-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));

 	timespec_add_ns(ts, nsecs);
 }
@@ -514,24 +528,30 @@
 	int ret;

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);

 		ret = timekeeper.clock->flags & CLOCK_SOURCE_VALID_FOR_HRES;

-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));

 	return ret;
 }

 /**
  * timekeeping_max_deferment - Returns max time the clocksource can be deferred
- *
- * Caller must observe xtime_lock via read_seqbegin/read_seqretry to
- * ensure that the clocksource does not change!
  */
 u64 timekeeping_max_deferment(void)
 {
-	return timekeeper.clock->max_idle_ns;
+	unsigned long seq;
+	u64 ret;
+	do {
+		seq = read_seqbegin(&timekeeper.lock);
+
+		ret = timekeeper.clock->max_idle_ns;
+
+	} while (read_seqretry(&timekeeper.lock, seq));
+
+	return ret;
 }

 /**
@@ -576,10 +596,13 @@
 	read_persistent_clock(&now);
 	read_boot_clock(&boot);

+	seqlock_init(&timekeeper.lock);
+
 	write_seqlock_irqsave(&xtime_lock, flags);
-
 	ntp_init();
-
+	write_sequnlock_irqrestore(&xtime_lock, flags);
+
+	write_seqlock_irqsave(&timekeeper.lock, flags);
 	clock = clocksource_default_clock();
 	if (clock->enable)
 		clock->enable(clock);
@@ -597,7 +620,7 @@
 				-boot.tv_sec, -boot.tv_nsec);
 	timekeeper.total_sleep_time.tv_sec = 0;
 	timekeeper.total_sleep_time.tv_nsec = 0;
-	write_sequnlock_irqrestore(&xtime_lock, flags);
+	write_sequnlock_irqrestore(&timekeeper.lock, flags);
 }

 /* time in seconds when suspend began */
@@ -638,7 +661,7 @@
  */
 void timekeeping_inject_sleeptime(struct timespec *delta)
 {
-	unsigned long flags;
+	unsigned long flags1,flags2;
 	struct timespec ts;

 	/* Make sure we don't set the clock twice */
@@ -646,7 +669,9 @@
 	if (!(ts.tv_sec == 0 && ts.tv_nsec == 0))
 		return;

-	write_seqlock_irqsave(&xtime_lock, flags);
+	write_seqlock_irqsave(&xtime_lock, flags1);
+	write_seqlock_irqsave(&timekeeper.lock, flags2);
+
 	timekeeping_forward_now();

 	__timekeeping_inject_sleeptime(delta);
@@ -656,7 +681,8 @@
 	update_vsyscall(&timekeeper.xtime, &timekeeper.wall_to_monotonic,
 			timekeeper.clock, timekeeper.mult);

-	write_sequnlock_irqrestore(&xtime_lock, flags);
+	write_sequnlock_irqrestore(&timekeeper.lock, flags2);
+	write_sequnlock_irqrestore(&xtime_lock, flags1);

 	/* signal hrtimers about time change */
 	clock_was_set();
@@ -672,14 +698,15 @@
  */
 static void timekeeping_resume(void)
 {
-	unsigned long flags;
+	unsigned long flags1,flags2;
 	struct timespec ts;

 	read_persistent_clock(&ts);

 	clocksource_resume();

-	write_seqlock_irqsave(&xtime_lock, flags);
+	write_seqlock_irqsave(&xtime_lock, flags1);
+	write_seqlock_irqsave(&timekeeper.lock, flags2);

 	if (timespec_compare(&ts, &timekeeping_suspend_time) > 0) {
 		ts = timespec_sub(ts, timekeeping_suspend_time);
@@ -689,7 +716,8 @@
 	timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock);
 	timekeeper.ntp_error = 0;
 	timekeeping_suspended = 0;
-	write_sequnlock_irqrestore(&xtime_lock, flags);
+	write_sequnlock_irqrestore(&timekeeper.lock, flags2);
+	write_sequnlock_irqrestore(&xtime_lock, flags1);

 	touch_softlockup_watchdog();

@@ -701,13 +729,14 @@

 static int timekeeping_suspend(void)
 {
-	unsigned long flags;
+	unsigned long flags1,flags2;
 	struct timespec		delta, delta_delta;
 	static struct timespec	old_delta;

 	read_persistent_clock(&timekeeping_suspend_time);

-	write_seqlock_irqsave(&xtime_lock, flags);
+	write_seqlock_irqsave(&xtime_lock, flags1);
+	write_seqlock_irqsave(&timekeeper.lock, flags2);
 	timekeeping_forward_now();
 	timekeeping_suspended = 1;

@@ -730,7 +759,8 @@
 		timekeeping_suspend_time =
 			timespec_add(timekeeping_suspend_time, delta_delta);
 	}
-	write_sequnlock_irqrestore(&xtime_lock, flags);
+	write_sequnlock_irqrestore(&timekeeper.lock, flags2);
+	write_sequnlock_irqrestore(&xtime_lock, flags1);

 	clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
 	clocksource_suspend();
@@ -983,10 +1013,13 @@
 	struct clocksource *clock;
 	cycle_t offset;
 	int shift = 0, maxshift;
+	unsigned long flags;
+
+	write_seqlock_irqsave(&timekeeper.lock, flags);

 	/* Make sure we're fully resumed: */
 	if (unlikely(timekeeping_suspended))
-		return;
+		goto out;

 	clock = timekeeper.clock;

@@ -1067,6 +1100,10 @@
 	/* check to see if there is a new clocksource to use */
 	update_vsyscall(&timekeeper.xtime, &timekeeper.wall_to_monotonic,
 			timekeeper.clock, timekeeper.mult);
+
+out:
+	write_sequnlock_irqrestore(&timekeeper.lock, flags);
+
 }

 /**
@@ -1112,13 +1149,13 @@
 	WARN_ON(timekeeping_suspended);

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);
 		*ts = timekeeper.xtime;
 		tomono = timekeeper.wall_to_monotonic;
 		sleep = timekeeper.total_sleep_time;
 		nsecs = timekeeping_get_ns();

-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));

 	set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec + sleep.tv_sec,
 			ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec + nsecs);
@@ -1169,10 +1206,10 @@
 	unsigned long seq;

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);

 		now = timekeeper.xtime;
-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));

 	return now;
 }
@@ -1184,11 +1221,11 @@
 	unsigned long seq;

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);

 		now = timekeeper.xtime;
 		mono = timekeeper.wall_to_monotonic;
-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));

 	set_normalized_timespec(&now, now.tv_sec + mono.tv_sec,
 				now.tv_nsec + mono.tv_nsec);
@@ -1220,11 +1257,11 @@
 	unsigned long seq;

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);
 		*xtim = timekeeper.xtime;
 		*wtom = timekeeper.wall_to_monotonic;
 		*sleep = timekeeper.total_sleep_time;
-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));
 }

 /**
@@ -1236,9 +1273,10 @@
 	struct timespec wtom;

 	do {
-		seq = read_seqbegin(&xtime_lock);
+		seq = read_seqbegin(&timekeeper.lock);
 		wtom = timekeeper.wall_to_monotonic;
-	} while (read_seqretry(&xtime_lock, seq));
+	} while (read_seqretry(&timekeeper.lock, seq));
+
 	return timespec_to_ktime(wtom);
 }


staging: ath6kl: Convert BDADDR_Present uses to TRUE/FALSE bugfix

The previous uses of BDADDR_Present set the initial value to
A_ERROR (-1) when not present and A_OK (0) when present.

A later test for (!BDADDR_Present) was therefore logically inverted.
Convert the values to TRUE/FALSE and the test is now logically correct.

Signed-off-by: Joe Perches <16a9a54ddf4259952e3c118c763138e83693d7fd@perches.com>
Acked-by: Vipin Mehta <150f82917c2af27395de2168251977ce218e1db6@atheros.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c
+++ drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c
@@ -663,7 +663,7 @@
 {
     int status;
     int i;
-    A_BOOL BDADDR_Present = A_ERROR;
+    A_BOOL BDADDR_Present = FALSE;

     Tag_Count = 0;

@@ -689,7 +689,7 @@
         else{
                 for(i=0; i<Tag_Count; i++){
                         if(PsTagEntry[i].TagId == 1){
-                                BDADDR_Present = A_OK;
+                                BDADDR_Present = TRUE;
                                 AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BD ADDR is present in Patch File \r\n"));

                         }


conditionally defining M_PI

conditionally defining M_PI

--- include/gf2d_types.h
+++ include/gf2d_types.h
@@ -1,6 +1,9 @@
 #ifndef __GF2D_TYPES_H__
 #define __GF2D_TYPES_H__

+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
 #define GF2D_EPSILON   1e-6f

 #define GF2D_2PI 6.283185308


timekeeping: add arch_offset hook to ktime_get functions

ktime_get and ktime_get_ts were calling timekeeping_get_ns()
but later they were not calling arch_gettimeoffset() so architectures
using this mechanism returned 0 ns when calling these functions.

This happened for example when running Busybox's ping which calls
syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts) which eventually
calls ktime_get. As a result the returned ping travel time was zero.

CC: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org
Signed-off-by: Hector Palacios <a8c4a54ab41b1fd5344b908edc2fcb81d5f78d9f@digi.com>
Signed-off-by: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>

--- kernel/time/timekeeping.c
+++ kernel/time/timekeeping.c
@@ -249,6 +249,8 @@
 		secs = xtime.tv_sec + wall_to_monotonic.tv_sec;
 		nsecs = xtime.tv_nsec + wall_to_monotonic.tv_nsec;
 		nsecs += timekeeping_get_ns();
+		/* If arch requires, add in gettimeoffset() */
+		nsecs += arch_gettimeoffset();

 	} while (read_seqretry(&xtime_lock, seq));
 	/*
@@ -280,6 +282,8 @@
 		*ts = xtime;
 		tomono = wall_to_monotonic;
 		nsecs = timekeeping_get_ns();
+		/* If arch requires, add in gettimeoffset() */
+		nsecs += arch_gettimeoffset();

 	} while (read_seqretry(&xtime_lock, seq));


staging: comedi: change bool assignment to true

This is a minor fix that was suggested by coccinelle. When defined as a
bool, a variable should use true/false rather than 1/0.

Signed-off-by: Teodora Baluta <3cca3f0b0ba6feb1f220844a57c5bad2d1c12446@gmail.com>
Reviewed-by: Lisa Nguyen <c4ed14e2020dd45edb57b5fba2f40dd93952505e@xenapiadmin.com>
Reviewed-by: Peter P Waskiewicz Jr <019ca817bcedb2fce0c539efa1b71c24f7a6c1c1@intel.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -513,7 +513,7 @@
 	int event = 0;

 	spin_lock_irqsave(&subpriv->spinlock, flags);
-	subpriv->active = 1;
+	subpriv->active = true;

 	/* Set up end of acquisition. */
 	switch (cmd->stop_src) {


consistent naming of dimensions

consistent naming of dimensions

--- include/ghost/tsmm.h
+++ include/ghost/tsmm.h
@@ -18,11 +18,11 @@
      */
     ghost_datatype dt;
     /**
-     * @brief The first configured block size K.
+     * @brief The first configured block size N.
      */
     int xcols;
     /**
-     * @brief The second configure block size M.
+     * @brief The second configure block size K.
      */
     int vcols;
     ghost_implementation impl;
@@ -56,15 +56,15 @@
      *
      * Compute \f$ x = \alpha \cdot v \cdot w  + \beta \cdot x\f$.
      *
-     * v is NxM, distributed.
+     * v is MxK, distributed.
      *
-     * w is MxK, redundant.
+     * w is KxN, redundant.
      *
-     * x is NxK, distributed.
+     * x is MxN, distributed.
      *
      * M<<N
      *
-     * This kernel is auto-generated at compile time for given values of K and M.
+     * This kernel is auto-generated at compile time for given values of K and N.
      *
      * @return ::GHOST_SUCCESS on success or an error indicator.
      */


time: Reorder so the hot data is together

Keep all the interesting data in a single cache line.

CC: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
CC: Eric Dumazet <a0baddf32b28d2f9429941ed4af2fe636e210591@gmail.com>
CC: Richard Cochran <e27030aebe9cad8817d34b8c31dbaf301fb798b9@gmail.com>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Signed-off-by: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>

--- kernel/time/timekeeping.c
+++ kernel/time/timekeeping.c
@@ -25,6 +25,8 @@
 struct timekeeper {
 	/* Current clocksource used for timekeeping. */
 	struct clocksource *clock;
+	/* NTP adjusted clock multiplier */
+	u32	mult;
 	/* The shift value of the current clocksource. */
 	int	shift;

@@ -45,8 +47,6 @@
 	/* Shift conversion between clock shifted nano seconds and
 	 * ntp shifted nano seconds. */
 	int	ntp_error_shift;
-	/* NTP adjusted clock multiplier */
-	u32	mult;

 	/* The current time */
 	struct timespec xtime;


Staging: media: davinci_vpfe: Removed unnecessary out of memory message logging.

The following patch removes the checkpatch.pl warning:
WARNING: possible unnecessary out of memory message.

Signed-off-by: Heena Sirwani <b4775f16ef7aa9a186caa87c9d17c5adc743013e@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
+++ drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
@@ -228,10 +228,8 @@

 	vpfe_dev->clks = kzalloc(vpfe_cfg->num_clocks *
 				   sizeof(struct clock *), GFP_KERNEL);
-	if (vpfe_dev->clks == NULL) {
-		v4l2_err(vpfe_dev->pdev->driver, "Memory allocation failed\n");
+	if (vpfe_dev->clks == NULL)
 		return -ENOMEM;
-	}

 	for (i = 0; i < vpfe_cfg->num_clocks; i++) {
 		if (vpfe_cfg->clocks[i] == NULL) {
@@ -349,11 +347,8 @@
 	num_subdevs = vpfe_cfg->num_subdevs;
 	vpfe_dev->sd =
 		  kzalloc(sizeof(struct v4l2_subdev *)*num_subdevs, GFP_KERNEL);
-	if (vpfe_dev->sd == NULL) {
-		v4l2_err(&vpfe_dev->v4l2_dev,
-			"unable to allocate memory for subdevice\n");
+	if (vpfe_dev->sd == NULL)
 		return -ENOMEM;
-	}

 	for (i = 0, k = 0; i < num_subdevs; i++) {
 		sdinfo = &vpfe_cfg->sub_devs[i];
@@ -582,11 +577,8 @@
 	int ret = -ENOMEM;

 	vpfe_dev = kzalloc(sizeof(*vpfe_dev), GFP_KERNEL);
-	if (!vpfe_dev) {
-		v4l2_err(pdev->dev.driver,
-			"Failed to allocate memory for vpfe_dev\n");
+	if (!vpfe_dev)
 		return ret;
-	}

 	if (pdev->dev.platform_data == NULL) {
 		v4l2_err(pdev->dev.driver, "Unable to get vpfe config\n");


time: Move arch_gettimeoffset() usage into timekeeping_get_ns()

Since we call arch_gettimeoffset() in all the accessor
functions, move arch_gettimeoffset() calls into
timekeeping_get_ns() and timekeeping_get_ns_raw() to simplify
the code.

This also makes the code easier to maintain as we don't have to
worry about forgetting the arch_gettimeoffset() as has happened
in the past.

Signed-off-by: John Stultz <2dbbc9a029f6af74f2c2786ce8fa25d932fcaf8c@us.ibm.com>
Reviewed-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>
Cc: Peter Zijlstra <645ca7d3a8d3d4f60557176cd361ea8351edc32b@chello.nl>
Cc: Richard Cochran <e27030aebe9cad8817d34b8c31dbaf301fb798b9@gmail.com>
Cc: Prarit Bhargava <fe4655370dc87a32329d591d6e8472329333dfad@redhat.com>
Link: 392a6d548377afa6bb176f297bcc6e374f63abd5@linaro.org
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

--- kernel/time/timekeeping.c
+++ kernel/time/timekeeping.c
@@ -191,13 +191,17 @@
 	cycle_delta = (cycle_now - clock->cycle_last) & clock->mask;

 	nsec = cycle_delta * timekeeper.mult + timekeeper.xtime_nsec;
-	return nsec >> timekeeper.shift;
+	nsec >>= timekeeper.shift;
+
+	/* If arch requires, add in gettimeoffset() */
+	return nsec + arch_gettimeoffset();
 }

 static inline s64 timekeeping_get_ns_raw(void)
 {
 	cycle_t cycle_now, cycle_delta;
 	struct clocksource *clock;
+	s64 nsec;

 	/* read clocksource: */
 	clock = timekeeper.clock;
@@ -206,8 +210,11 @@
 	/* calculate the delta since the last update_wall_time: */
 	cycle_delta = (cycle_now - clock->cycle_last) & clock->mask;

-	/* return delta convert to nanoseconds. */
-	return clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift);
+	/* convert delta to nanoseconds. */
+	nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift);
+
+	/* If arch requires, add in gettimeoffset() */
+	return nsec + arch_gettimeoffset();
 }

 static void update_rt_offset(void)
@@ -282,9 +289,6 @@
 		ts->tv_sec = timekeeper.xtime_sec;
 		ts->tv_nsec = timekeeping_get_ns();

-		/* If arch requires, add in gettimeoffset() */
-		nsecs += arch_gettimeoffset();
-
 	} while (read_seqretry(&timekeeper.lock, seq));

 	timespec_add_ns(ts, nsecs);
@@ -304,8 +308,6 @@
 				timekeeper.wall_to_monotonic.tv_sec;
 		nsecs = timekeeping_get_ns() +
 				timekeeper.wall_to_monotonic.tv_nsec;
-		/* If arch requires, add in gettimeoffset() */
-		nsecs += arch_gettimeoffset();

 	} while (read_seqretry(&timekeeper.lock, seq));
 	/*
@@ -336,8 +338,6 @@
 		ts->tv_sec = timekeeper.xtime_sec;
 		ts->tv_nsec = timekeeping_get_ns();
 		tomono = timekeeper.wall_to_monotonic;
-		/* If arch requires, add in gettimeoffset() */
-		ts->tv_nsec += arch_gettimeoffset();

 	} while (read_seqretry(&timekeeper.lock, seq));

@@ -365,8 +365,6 @@
 	WARN_ON_ONCE(timekeeping_suspended);

 	do {
-		u32 arch_offset;
-
 		seq = read_seqbegin(&timekeeper.lock);

 		*ts_raw = timekeeper.raw_time;
@@ -375,11 +373,6 @@

 		nsecs_raw = timekeeping_get_ns_raw();
 		nsecs_real = timekeeping_get_ns();
-
-		/* If arch requires, add in gettimeoffset() */
-		arch_offset = arch_gettimeoffset();
-		nsecs_raw += arch_offset;
-		nsecs_real += arch_offset;

 	} while (read_seqretry(&timekeeper.lock, seq));

@@ -1338,8 +1331,6 @@

 		secs = timekeeper.xtime_sec;
 		nsecs = timekeeping_get_ns();
-		/* If arch requires, add in gettimeoffset() */
-		nsecs += arch_gettimeoffset();

 		*offs_real = timekeeper.offs_real;
 		*offs_boot = timekeeper.offs_boot;