Added equisolid projection (equal area azimuthal lambert) Also removed FOV vertical and diagonal specification because it's wrong (only works for gnomonic). Added function pointer table for maps, and created static variables for width, height, and fov - common to most functions in lens.c

--- NQ/lens.c
+++ NQ/lens.c
@@ -8,6 +8,7 @@
 #include "draw.h"
 #include "host.h"
 #include "lens.h"
+#include "mathlib.h"
 #include "quakedef.h"
 #include "screen.h"
 #include "sys.h"
@@ -49,27 +50,36 @@
 #define FOV_VERTICAL   1
 #define FOV_DIAGONAL   2

-void fisheyeMap(int width, int height, double fov, double dx, double dy, double *sx, double *sy, double *sz)
+static int width, height;
+static double fov;
+
+typedef int (*map_t)(double dx, double dy, vec3_t ray);
+
+int fisheyeMap(double dx, double dy, vec3_t ray)
 {
     double yaw = sqrt(dx*dx+dy*dy)*fov/((double)width);
     double roll = -atan2(dy,dx);

-    *sx = sin(yaw) * cos(roll);
-    *sy = sin(yaw) * sin(roll);
-    *sz = cos(yaw);
-}
-
-void cylinderMap(int width, int height, double fov, double dx, double dy, double *sx, double *sy, double *sz)
+    ray[0] = sin(yaw) * cos(roll);
+    ray[1] = sin(yaw) * sin(roll);
+    ray[2] = cos(yaw);
+
+    return 1;
+}
+
+int cylinderMap(double dx, double dy, vec3_t ray)
 {
     double az = dx*fov/(double)width;
     double el = -dy*fov/(double)width;

-    *sx = sin(az)*cos(el);
-    *sy = sin(el);
-    *sz = cos(az)*cos(el);
-}
-
-void perspectiveMap(int width, int height, double fov, double dx, double dy, double *sx, double *sy, double *sz)
+    ray[0] = sin(az)*cos(el);
+    ray[1] = sin(el);
+    ray[2] = cos(az)*cos(el);
+
+    return 1;
+}
+
+int perspectiveMap(double dx, double dy, vec3_t ray)
 {
     double a = (double)width/2/tan(fov/2);

@@ -79,41 +89,75 @@

     double len = sqrt(x*x+y*y+z*z);

-    *sx = x/len;
-    *sy = y/len;
-    *sz = z/len;
-}
-
-void stereographicMap(int width, int height, double fov, double dx, double dy, double *sx, double *sy, double *sz)
-{
-    double diam = (double)width/2 / tan(fov/4);
-    double rad = diam/2;
-
-    double t = 2*rad*diam / (dx*dx + dy*dy + diam*diam);
-
-    *sx = dx * t / rad;
-    *sy = -dy * t / rad;
-    *sz = (-rad + diam * t) / rad;
-}
-
-void lookuptable(B **buf, int width, int height, B *scrp, double fov, int map) {
+    ray[0] = x/len;
+    ray[1] = y/len;
+    ray[2] = z/len;
+
+    return 1;
+}
+
+int stereographicMap(double dx, double dy, vec3_t ray)
+{
+    double r = (double)width/(4*tan(fov/4));
+    dx /= r;
+    dy /= r;
+
+    double t = 4 / (dx*dx + dy*dy + 4);
+
+    ray[0] = dx * t;
+    ray[1] = -dy * t;
+    ray[2] = 2*t-1;
+
+    return 1;
+}
+
+int equisolidMap(double dx, double dy, vec3_t ray)
+{
+   double cfov = fov <= 2*M_PI ? fov : 2*M_PI;
+   double r = (double)width/4 / sin(cfov/4);
+   dx /= r;
+   dy /= r;
+
+   double len = sqrt(dx*dx+dy*dy);
+   if (len > 2)
+      return 0;
+
+   double a = asin(len/2);
+
+   vec3_t in = { dx, dy, 0};
+   vec3_t axis = { dy/len, -dx/len, 0};
+
+   RotatePointAroundVector(ray, axis, in, -a*180/M_PI);
+   ray[1] *= -1;
+   ray[2] += 1;
+
+   return 1;
+}
+
+static map_t maps[] = {
+   perspectiveMap,
+   fisheyeMap,
+   cylinderMap,
+   stereographicMap,
+   equisolidMap
+};
+
+void lookuptable(B **buf, B *scrp, int map) {
   int x, y;
   for(y = 0;y<height;y++) for(x = 0;x<width;x++) {
     double dx = x-width/2;
     double dy = -(y-height/2);

     // map the current window coordinate to a ray vector
-    double sx, sy, sz;
-    switch (map)
+    vec3_t ray;
+    if (!maps[map](dx,dy,ray))
     {
-       case 0: perspectiveMap(width, height, fov, dx, dy, &sx, &sy, &sz); break;
-       case 1: fisheyeMap(width, height, fov, dx, dy, &sx, &sy, &sz); break;
-       case 2: cylinderMap(width, height, fov, dx, dy, &sx, &sy, &sz); break;
-       case 3:
-       default: stereographicMap(width, height, fov, dx, dy, &sx, &sy, &sz);
+       *buf++ = 0;
+       continue;
     }

     // determine which side of the box we need
+    double sx = ray[0], sy = ray[1], sz = ray[2];
     double abs_x = fabs(sx);
     double abs_y = fabs(sy);
     double abs_z = fabs(sz);
@@ -155,7 +199,8 @@
   int x, y;
   for(y = 0;y<scr_vrect.height;y++) {
     for(x = 0;x<scr_vrect.width;x++,offs++)
-       vid.buffer[scr_vrect.x+x+(y+scr_vrect.y)*vid.rowbytes] = **offs;
+       if (*offs)
+         vid.buffer[scr_vrect.x+x+(y+scr_vrect.y)*vid.rowbytes] = **offs;
   }
 }

@@ -177,8 +222,10 @@

 //extern int istimedemo;

-void updateFovs(int width, int height)
-{
+void updateFovs()
+{
+   // TODO: fix this; vertical|diagonal FOVs rely on knowledge of the type of projection (this only applies to horizontal gnomonic)
+
    // previous FOV values
    static double ph = -1;
    static double pv = -1;
@@ -192,21 +239,24 @@
    else if (ph != hfov.value)
    {
       Cvar_SetValue("fov_anchor", FOV_HORIZONTAL);
+      Con_Printf("setting horizontal anchor");
    }
    else if (pv != vfov.value)
    {
       Cvar_SetValue("fov_anchor", FOV_VERTICAL);
+      Con_Printf("setting vertical anchor");
    }
    else if (pd != dfov.value)
    {
       Cvar_SetValue("fov_anchor", FOV_DIAGONAL);
+      Con_Printf("setting diagonal anchor");
    }

    // calculate focal length based on the fov anchor
    double diag = sqrt(width*width + height*height);
    int anchor = (int)fov_anchor.value;
    double focal_len;
-   #define FOCAL(range,fov) (double)(range)/2/tan(fov.value/360*M_PI)
+   #define FOCAL(range,f) (double)(range)/2/tan(f.value/360*M_PI)
    switch (anchor)
    {
       case FOV_VERTICAL: focal_len = FOCAL(height, vfov); break;
@@ -216,7 +266,7 @@
    }

    // update all FOVs to reflect new change
-   #define FOV(range, focal) atan2((range)/2,(focal))*360/M_PI
+   #define FOV(range, focal) atan2((double)(range)/2,(focal))*360/M_PI
    Cvar_SetValue("hfov", FOV(width, focal_len));
    Cvar_SetValue("vfov", FOV(height, focal_len));
    Cvar_SetValue("dfov", FOV(diag, focal_len));
@@ -233,25 +283,35 @@

 void L_RenderView() {

-  int width = scr_vrect.width;
-  int height = scr_vrect.height;
-  int scrsize = width*height;
-  int views = 5;
-
-  updateFovs(width, height);
-  double fov = hfov.value;
-  int map = (int)lens.value;
-
   static int pwidth = -1;
   static int pheight = -1;
   static int pmap = -1;
-  static float pfov = -1;
+  static float pfovd = -1;
   static int pviews = -1;
+
+  // update screen size
+  width = scr_vrect.width;
+  height = scr_vrect.height;
+  int scrsize = width*height;
+  int views = 5;
+
+  // update FOVs
+  fov = hfov.value * M_PI / 180;
+  double fovd = hfov.value;
+
+  // update Map
+  int map = (int)lens.value;
+  int numMaps = sizeof(maps) / sizeof(map_t);
+  if (map < 0 || map >= numMaps)
+  {
+     map = pmap == -1 ? 0 : pmap;
+     Cvar_SetValue("lens", map);
+  }

   static B *scrbufs = NULL;
   static B **offs = NULL;

-  if(pwidth!=width || pheight!=height || pfov!=fov || pmap!=map) {
+  if(pwidth!=width || pheight!=height || pfovd!=fovd || pmap!=map) {

     if(scrbufs) free(scrbufs);
     if(offs) free(offs);
@@ -260,19 +320,13 @@
     offs = (B**)malloc(scrsize*sizeof(B*));
     if(!scrbufs || !offs) exit(1); // the rude way

-    pwidth = width;
-    pheight = height;
-    pfov = fov;
-    pmap = map;
-
-    lookuptable(offs,width,height,scrbufs,fov*M_PI/180.0, map);
-  };
+    lookuptable(offs,scrbufs, map);
+  }

   if(views!=pviews) {
     int i;
-    pviews = views;
     for(i = 0;i<scrsize*6;i++) scrbufs[i] = 0;
-  };
+  }

   // get the directions of all the cube map faces
   vec3_t forward, right, up, back, left, down;
@@ -288,9 +342,16 @@
     case 3:  renderside(scrbufs+scrsize*3, BOX_LEFT, left, forward, up);
     case 2:  renderside(scrbufs+scrsize,   BOX_RIGHT, right, back, up);
     default: renderside(scrbufs,           BOX_FRONT, forward, right, up);
-  };
-
+  }
+
+  Draw_TileClear(0, 0, vid.width, vid.height);
   renderlookup(offs,scrbufs);
+
+    pwidth = width;
+    pheight = height;
+    pfovd = fovd;
+    pmap = map;
+    pviews = views;

   /*
   static int demonum = 0;
@@ -303,5 +364,5 @@
     demonum = 0;
   }
   */
-};
-
+}
+


identify both BCM-alias names as rpi1

identify both BCM-alias names as rpi1

--- sidplayer/platform-support-common.c
+++ sidplayer/platform-support-common.c
@@ -133,7 +133,7 @@
             case EOF:
                 break;
             default:
-                if (strstr(hardware, "BCM2708") != NULL) {
+                if (strstr(hardware, "BCM2708") != NULL || strstr(hardware, "BCM2835") != NULL) {
                     reveller = &rpi_platform;
                 } else if (strstr(hardware, "BCM2709") != NULL) {
                     reveller = &rpi2_platform;


fix : getCurrentTime()

fix : getCurrentTime()

--- Design/AssertTest.c
+++ Design/AssertTest.c
@@ -14,7 +14,7 @@

 int main(void) {
     Time tm = getCurrentTime();
-    printf("OuterTime:%7.2f", tm);
+    printf("OuterTime:%7.2f\n", tm);
     // PatientQueue pq;
     // InitPriorityQue(pq);
     // HeapSort(pq);


stratified

stratified


<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">      <title>403 - Forbidden</title>
403 - Forbidden


Remove Network::connect(uint32_t hostname, int port).

Unused definition.

--- Network.h
+++ Network.h
@@ -4,7 +4,7 @@
  * Purpose: Common interface for Networking implementation
  *
  *******************************************************************************
- * Copyright Monstrenyatko 2014.
+ * Copyright Oleg Kovalenko 2014,2017.
  *
  * Distributed under the MIT License.
  * (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)
@@ -23,9 +23,8 @@
 public:
 	virtual ~Network() {}
 	virtual int connect(const char* hostname, int port) = 0;
-	virtual int connect(uint32_t hostname, int port) = 0;
-	virtual int read(unsigned char* buffer, int len, int timeoutMs) = 0;
-	virtual int write(unsigned char* buffer, int len, int timeoutMs) = 0;
+	virtual int read(unsigned char* buffer, int len, unsigned long timeoutMs) = 0;
+	virtual int write(unsigned char* buffer, int len, unsigned long timeoutMs) = 0;
 	virtual int disconnect() = 0;
 };


Add Windows platform Vulkan define.

Add Windows platform Vulkan define.

--- demo/VulkanRenderer.h
+++ demo/VulkanRenderer.h
@@ -4,8 +4,11 @@

 #ifndef SDL_VIDEO_VULKAN_SURFACE

-// TODO: _WIN32
+#ifdef _WIN32
+#define VK_USE_PLATFORM_WIN32_KHR 1
+#else
 #define VK_USE_PLATFORM_XCB_KHR 1
+#endif

 #endif  // SDL_VIDEO_VULKAN_SURFACE


Re-enable Vulkan memory allocator stats, it now compiles on Linux

--- demo/VulkanRenderer.h
+++ demo/VulkanRenderer.h
@@ -39,7 +39,6 @@

 #include <limits.h>  // required but not included by vk_mem_alloc.h

-#define VMA_STATS_STRING_ENABLED 0
 #include "vk_mem_alloc.h"


Corrigindo a referencia de .h do dijkstra que tava referenciando a pasta domain/dijkstra.h. Como eu adicionei os .h nas referências do projeto, isso é desnecessário.

--- Rotas/Rotas/src/algoritmos/dijkstra.h
+++ Rotas/Rotas/src/algoritmos/dijkstra.h
@@ -1,11 +1,9 @@
 #ifndef ROTAS_ALGORITMOS_DIJKSTRA_H_
 #define ROTAS_ALGORITMOS_DIJKSTRA_H_

-#define kCidades 9
-
 #include <limits>
 #include <vector>
-#include "domain/caminho.h"
+#include "caminho.h"

 namespace rotas
 {


teemfulness

teemfulness


Tucano

Tucano


swingtree

swingtree


quiet

quiet


tranquillity

tranquillity


BUG: Fix missing brace in previous commit

--- Base/Registration/itkImageToImageAnisotropicDiffusiveDeformableRegistrationFunction.h
+++ Base/Registration/itkImageToImageAnisotropicDiffusiveDeformableRegistrationFunction.h
@@ -189,7 +189,8 @@
   void CheckTimeStepStability(
       const itk::Image< TPixel, VImageDimension > * input,
       bool useImageSpacing )
-    { m_RegularizationFunction->CheckTimeStepStability( input, useImageSpacing );
+    { m_RegularizationFunction->CheckTimeStepStability(
+        input, useImageSpacing ); }

   /** Set the object's state before each iteration. */
   virtual void InitializeIteration();


thrombogen

thrombogen


teaseler

teaseler


scimitared

scimitared


Delete unused header file in the MicroBlaze Ethernet Lite port directory.

git-svn-id: 43aea61533866f88f23079d48f4f5dc2d5288937@1519 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

--- Demo/Common/ethernet/lwip-1.4.0/ports/MicroBlaze-Ethernet-Lite/lwipcfg_EthernetLite.h
+++ Demo/Common/ethernet/lwip-1.4.0/ports/MicroBlaze-Ethernet-Lite/lwipcfg_EthernetLite.h
@@ -1,45 +0,0 @@
-/**
- * Additional settings for the win32 port.
- * Copy this to lwipcfg_msvc.h and make the config changes you need.
- */
-
-/* configuration for this port */
-#define PPP_USERNAME  "Admin"
-#define PPP_PASSWORD  "pass"
-
-/** Define this to the index of the windows network adapter to use */
-#define PACKET_LIB_ADAPTER_NR         2
-/** Define this to the GUID of the windows network adapter to use
- * or NOT define this if you want PACKET_LIB_ADAPTER_NR to be used */
-/*#define PACKET_LIB_ADAPTER_GUID       "00000000-0000-0000-0000-000000000000"*/
-/*#define PACKET_LIB_GET_ADAPTER_NETADDRESS(addr) IP4_ADDR((addr), 192,168,1,0)*/
-/*#define PACKET_LIB_QUIET*/
-
-#define LWIP_PORT_INIT_IPADDR(addr)   IP4_ADDR((addr), 192,168,0,200)
-#define LWIP_PORT_INIT_GW(addr)       IP4_ADDR((addr), 192,168,0,3)
-#define LWIP_PORT_INIT_NETMASK(addr)  IP4_ADDR((addr), 255,255,255,0)
-
-/* remember to change this MAC address to suit your needs!
-   the last octet will be increased by netif->num for each netif */
-#define LWIP_MAC_ADDR_BASE            {0x00,0x01,0x02,0x03,0x04,0x05}
-
-/* configuration for applications */
-
-#define LWIP_CHARGEN_APP              0
-#define LWIP_DNS_APP                  0
-#define LWIP_HTTPD_APP                1
-/* Set this to 1 to use the netconn http server,
- * otherwise the raw api server will be used. */
-/*#define LWIP_HTTPD_APP_NETCONN     */
-#define LWIP_NETBIOS_APP              0
-#define LWIP_NETIO_APP                0
-#define LWIP_PING_APP                 0
-#define LWIP_RTP_APP                  0
-#define LWIP_SHELL_APP                0
-#define LWIP_SNTP_APP                 0
-#define LWIP_SOCKET_EXAMPLES_APP      0
-#define LWIP_TCPECHO_APP              0
-/* Set this to 1 to use the netconn tcpecho server,
- * otherwise the raw api server will be used. */
-/*#define LWIP_TCPECHO_APP_NETCONN   */
-#define LWIP_UDPECHO_APP              0


undefectible

undefectible


circumambience

circumambience


anticaustic

anticaustic


notopodium

notopodium


proglottidean

proglottidean


test_string_bytes.c: Apply code formatter for appropriate white spacing

Signed-off-by: Imran Desai <d01faadd01d89088a38277c634ffb396f2b368f8@intel.com>

--- test/unit/test_string_bytes.c
+++ test/unit/test_string_bytes.c
@@ -12,8 +12,8 @@
 static void test_is_big_endian(void **state) {

     uint16_t test = 0xFF00;
-    uint8_t *b = (uint8_t *)&test;
-    (void)state;
+    uint8_t *b = (uint8_t *) &test;
+    (void) state;

     bool test_host_is_big_endian = b[0] == 0xFF;
     bool host_is_big_endian = tpm2_util_is_big_endian();
@@ -83,8 +83,8 @@
 bool output_enabled = true;

 int main(int argc, char* argv[]) {
-    (void)argc;
-    (void)argv;
+    (void) argc;
+    (void) argv;

     const struct CMUnitTest tests[] = {
         cmocka_unit_test(test_is_big_endian),


fix logic of ykp_get_supported_key_length()

was reporting wrong size for yubico-challenge

--- ykpers.c
+++ ykpers.c
@@ -236,11 +236,10 @@
 	/* OATH-HOTP and HMAC-SHA1 challenge response support 20 byte (160 bits)
 	 * keys, holding the last four bytes in the uid field.
 	 */
-	if ((cfg->ykcore_config.tktFlags & TKTFLAG_OATH_HOTP) == TKTFLAG_OATH_HOTP)
-		return 20;
-
-	if ((cfg->ykcore_config.tktFlags & TKTFLAG_CHAL_RESP) == TKTFLAG_CHAL_RESP &&
-	    (cfg->ykcore_config.cfgFlags & CFGFLAG_CHAL_HMAC) == CFGFLAG_CHAL_HMAC) {
+	if((ykp_get_tktflag_OATH_HOTP(cfg) &&
+				!ykp_get_cfgflag_CHAL_YUBICO(cfg)) ||
+			(ykp_get_tktflag_CHAL_RESP(cfg) &&
+			 ykp_get_cfgflag_CHAL_HMAC(cfg))) {
 		return 20;
 	}


Clean coding style

Clean coding style

--- libyaul/scu/bus/cpu/cpu/cache.h
+++ libyaul/scu/bus/cpu/cpu/cache.h
@@ -21,7 +21,7 @@

 /// Partition designated for using the cache.
 #define CPU_CACHE               0x00000000UL
-/// Partition designated for bypassing the cache.
+/// Partition designated for bypassing the cache.
 #define CPU_CACHE_THROUGH       0x20000000UL
 /// Partition designated for purging a specific line.
 #define CPU_CACHE_PURGE         0x40000000UL
@@ -140,7 +140,7 @@
 /// @brief Cache line of the specified address is purged.
 ///
 /// @details Calling this function will not pollute the cache.
-///
+///
 /// @param addr Address associated with cache line.
 extern void cpu_cache_purge_line(void *addr) __section(".uncached");


taintlessly

taintlessly


chria

chria


hyperexaltation

hyperexaltation


olfactometer

olfactometer


chytra

chytra


irrigant

irrigant


conicopoly

conicopoly


melodious

melodious


[readdir] convert adfs

[readdir] convert adfs

Signed-off-by: Al Viro <de609eb4d5d70b1d38ec6642adbfc33a2781f63c@zeniv.linux.org.uk>

--- fs/adfs/dir.c
+++ fs/adfs/dir.c
@@ -17,47 +17,43 @@
 static DEFINE_RWLOCK(adfs_dir_lock);

 static int
-adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
-{
-	struct inode *inode = file_inode(filp);
+adfs_readdir(struct file *file, struct dir_context *ctx)
+{
+	struct inode *inode = file_inode(file);
 	struct super_block *sb = inode->i_sb;
 	struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
 	struct object_info obj;
 	struct adfs_dir dir;
 	int ret = 0;

-	if (filp->f_pos >> 32)
-		goto out;
+	if (ctx->pos >> 32)
+		return 0;

 	ret = ops->read(sb, inode->i_ino, inode->i_size, &dir);
 	if (ret)
-		goto out;
-
-	switch ((unsigned long)filp->f_pos) {
-	case 0:
-		if (filldir(dirent, ".", 1, 0, inode->i_ino, DT_DIR) < 0)
+		return ret;
+
+	if (ctx->pos == 0) {
+		if (!dir_emit_dot(file, ctx))
 			goto free_out;
-		filp->f_pos += 1;
-
-	case 1:
-		if (filldir(dirent, "..", 2, 1, dir.parent_id, DT_DIR) < 0)
+		ctx->pos = 1;
+	}
+	if (ctx->pos == 1) {
+		if (!dir_emit(ctx, "..", 2, dir.parent_id, DT_DIR))
 			goto free_out;
-		filp->f_pos += 1;
-
-	default:
-		break;
+		ctx->pos = 2;
 	}

 	read_lock(&adfs_dir_lock);

-	ret = ops->setpos(&dir, filp->f_pos - 2);
+	ret = ops->setpos(&dir, ctx->pos - 2);
 	if (ret)
 		goto unlock_out;
 	while (ops->getnext(&dir, &obj) == 0) {
-		if (filldir(dirent, obj.name, obj.name_len,
-			    filp->f_pos, obj.file_id, DT_UNKNOWN) < 0)
-			goto unlock_out;
-		filp->f_pos += 1;
+		if (!dir_emit(ctx, obj.name, obj.name_len,
+			    obj.file_id, DT_UNKNOWN))
+			break;
+		ctx->pos++;
 	}

 unlock_out:
@@ -65,8 +61,6 @@

 free_out:
 	ops->free(&dir);
-
-out:
 	return ret;
 }

@@ -192,7 +186,7 @@
 const struct file_operations adfs_dir_operations = {
 	.read		= generic_read_dir,
 	.llseek		= generic_file_llseek,
-	.readdir	= adfs_readdir,
+	.iterate	= adfs_readdir,
 	.fsync		= generic_file_fsync,
 };


NFSv4.1: Deal with seqid wraparound in the pNFS return-on-close code

Signed-off-by: Trond Myklebust <6a1f9db795c9fc44be97d66ab114c53193bd3d13@netapp.com>

--- fs/nfs/pnfs.c
+++ fs/nfs/pnfs.c
@@ -801,7 +801,7 @@

 	spin_lock(&ino->i_lock);
 	lo = NFS_I(ino)->layout;
-	if ((int)(barrier - lo->plh_barrier) > 0)
+	if (pnfs_seqid_is_newer(barrier, lo->plh_barrier))
 		lo->plh_barrier = barrier;
 	spin_unlock(&ino->i_lock);
 }


Lindsey

Lindsey


nfsd: remove IS_ISMNDLCK macro

nfsd: remove IS_ISMNDLCK macro

This macro is only used in one place; in this place it seems simpler to
put open-code it and move the comment to where it's used.

Signed-off-by: J. Bruce Fields <51738506c1b2ccb0761f23bdc612c93babf738ea@citi.umich.edu>

--- fs/nfsd/vfs.c
+++ fs/nfsd/vfs.c
@@ -61,12 +61,6 @@
 #define NFSDDBG_FACILITY		NFSDDBG_FILEOP

-/* We must ignore files (but only files) which might have mandatory
- * locks on them because there is no way to know if the accesser has
- * the lock.
- */
-#define IS_ISMNDLK(i)	(S_ISREG((i)->i_mode) && mandatory_lock(i))
-
 /*
  * This is a cache of readahead params that help us choose the proper
  * readahead strategy. Initially, we set all readahead parameters to 0
@@ -680,7 +674,12 @@
 	err = nfserr_perm;
 	if (IS_APPEND(inode) && (access & MAY_WRITE))
 		goto out;
-	if (IS_ISMNDLK(inode))
+	/*
+	 * We must ignore files (but only files) which might have mandatory
+	 * locks on them because there is no way to know if the accesser has
+	 * the lock.
+	 */
+	if (S_ISREG((inode)->i_mode) && mandatory_lock(inode))
 		goto out;

 	if (!inode->i_fop)


Niquiran

Niquiran


skip ALL leading slashes :-)

skip ALL leading slashes :-)

--- build/pack.c
+++ build/pack.c
@@ -490,7 +490,9 @@
 	cpioFileList = newStringBuf();
 	while (count--) {
 	    file = *farray++;
-	    file++;  /* Skip leading "/" */
+	    while (*file == '/') {
+		file++;  /* Skip leading "/" */
+	    }
 	    appendLineStringBuf(cpioFileList, file);
 	}


Revert a patch for Bug#54334 (Double initialization of mysys mutexes). Revision ID of the patch: marc.alff@oracle.com-20100608124148-lr1ult7lwo75niev

--- mysys/my_init.c
+++ mysys/my_init.c
@@ -104,6 +104,8 @@
   mysql_stdin= & instrumented_stdin;

 #if defined(THREAD)
+  if (my_thread_global_init())
+    return 1;
 #  if defined(SAFE_MUTEX)
   safe_mutex_global_init();		/* Must be called early */
 #  endif


Add missing unref call

Add missing unref call

--- hcid/dbus.c
+++ hcid/dbus.c
@@ -103,6 +103,7 @@
 						PIN_CODE_REPLY_CP_SIZE, &pr);

 	dbus_message_unref(message);
+	dbus_pending_call_unref(call);

 	return;


Serpentarii

Serpentarii


Fix coding format in vp9_idct

Fix coding format in vp9_idct

Change-Id: If97ae16a4478717933345b6b9d5bc1b417b8dd84

--- vp9/common/vp9_idct.c
+++ vp9/common/vp9_idct.c
@@ -835,7 +835,8 @@
     ht.cols(temp_in, temp_out);
     for (j = 0; j < 16; ++j)
       dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
-                                  + dest[j * stride + i]);  }
+                                        + dest[j * stride + i]);
+  }
 }

 void vp9_idct16x16_10_add_c(const int16_t *input, uint8_t *dest, int stride) {
@@ -1276,7 +1277,7 @@
     idct32_1d(temp_in, temp_out);
     for (j = 0; j < 32; ++j)
       dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
-                                  + dest[j * stride + i]);
+                                        + dest[j * stride + i]);
   }
 }


Titanomachy

Titanomachy


spavindy

spavindy


brokerage

brokerage


cycadiform

cycadiform


snirt

snirt


prereview

prereview


Copy all format flags (not only precision) from actual output stream when calculating the maximal width

--- Eigen/src/Core/IO.h
+++ Eigen/src/Core/IO.h
@@ -189,6 +189,9 @@
     explicit_precision = fmt.precision;
   }

+  std::streamsize old_precision = 0;
+  if(explicit_precision) old_precision = s.precision(explicit_precision);
+
   bool align_cols = !(fmt.flags & DontAlignCols);
   if(align_cols)
   {
@@ -197,13 +200,11 @@
       for(Index i = 0; i < m.rows(); ++i)
       {
         std::stringstream sstr;
-        if(explicit_precision) sstr.precision(explicit_precision);
+        sstr.copyfmt(s);
         sstr << m.coeff(i,j);
         width = std::max<Index>(width, Index(sstr.str().length()));
       }
   }
-  std::streamsize old_precision = 0;
-  if(explicit_precision) old_precision = s.precision(explicit_precision);
   s << fmt.matPrefix;
   for(Index i = 0; i < m.rows(); ++i)
   {


Allow backend timeouts to be zero.

Allow backend timeouts to be zero.

Fixes #635

git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@4508 d4fa192b-c00b-0410-8231-f00ffab90ce4

--- bin/varnishd/cache_backend.c
+++ bin/varnishd/cache_backend.c
@@ -98,7 +98,6 @@
 			dst = be->tmx;		\
 		if (dst == 0.0)			\
 			dst = params->tmx;	\
-		assert(dst > 0.0);		\
 	} while (0)


nagnail

nagnail


Don't use binary address anyway, we only want the IP number part
and splitting that out of the binary part is not worth the
trouble.

git-svn-id: 7d4b18ab7d176792635d6a7a77dd8cbbea8e8daa@935 d4fa192b-c00b-0410-8231-f00ffab90ce4

--- bin/varnishd/cache_session.c
+++ bin/varnishd/cache_session.c
@@ -69,7 +69,7 @@
 	time_t now;

 	AZ(sp->srcaddr);
-	u = crc32_l(sp->sockaddr, sp->sockaddrlen);
+	u = crc32_2s(sp->addr, "");
 	v = u % CLIENT_HASH;
 	ch = &srcaddr_hash[v];
 	now = time(NULL);


cajoling

cajoling


Fix the meaning of '=' in logexpect

Fix the meaning of '=' in logexpect

Fix the meaning of '=' in logexpect to mean same value as that of the
last successfully matched log record.

--- bin/varnishtest/vtc_logexp.c
+++ bin/varnishtest/vtc_logexp.c
@@ -42,7 +42,7 @@
  * tag:  [tagname|*|=]		Tag to match against
  * regex:			regular expression to match against (optional)
  * *:				Match anything
- * =:				Match value of last examined log record
+ * =:				Match value of last successfully matched record
  */

 #include "config.h"
@@ -245,6 +245,8 @@
 			    legend, vxid, VSL_tags[tag], type, len, data);

 			if (ok) {
+				le->vxid_last = vxid;
+				le->tag_last = tag;
 				le->skip_cnt = 0;
 				logexp_next(le);
 				if (le->test == NULL)
@@ -253,9 +255,6 @@
 			}
 			if (skip)
 				le->skip_cnt++;
-
-			le->vxid_last = vxid;
-			le->tag_last = tag;
 		}
 	}


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>403 - Forbidden</title>

403 - Forbidden


Accept ECONNRESET when closing sockets during cleanup.

git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@3038 d4fa192b-c00b-0410-8231-f00ffab90ce4

--- bin/varnishtest/vtc_server.c
+++ bin/varnishtest/vtc_server.c
@@ -28,6 +28,7 @@

 #include <stdio.h>
+#include <errno.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
@@ -97,7 +98,7 @@
 		http_process(vl, s->spec, fd, 0);
 		vtc_log(vl, 3, "shutting fd %d", fd);
 		AZ(shutdown(fd, SHUT_WR));
-		AZ(close(fd));
+		assert(close(fd) == 0 || errno == ECONNRESET);
 	}
 	vtc_log(vl, 2, "Ending");
 	return (NULL);


chronogenetic

chronogenetic


possible

possible


antianthropocentric

antianthropocentric


Add missing include

Add missing include

Some X11-related system header is leaking stdlib.h, so when we disable
the X11 backend we get a compiler warning for atol().

--- clutter/clutter-settings.c
+++ clutter/clutter-settings.c
@@ -34,6 +34,8 @@
 #include "clutter-stage-private.h"
 #include "clutter-private.h"

+#include <stdlib.h>
+
 #define DEFAULT_FONT_NAME       "Sans 12"

 #define CLUTTER_SETTINGS_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_SETTINGS, ClutterSettingsClass))


oligoclase

oligoclase


Russianist

Russianist


teet

teet


aerogeologist

aerogeologist


incommunicability

incommunicability


consignificator

consignificator


detestable

detestable


subcordate

subcordate


net/route: export symbol ip_tos2prio

net/route: export symbol ip_tos2prio

Need to export this to enable drivers use rt_tos2priority()

Signed-off-by: Amir Vadai <3780882ee6ebd9d2578cec41b2fe98d5a68e15d1@mellanox.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/ipv4/route.c
+++ net/ipv4/route.c
@@ -230,7 +230,7 @@
 	TC_PRIO_INTERACTIVE_BULK,
 	ECN_OR_COST(INTERACTIVE_BULK)
 };
-
+EXPORT_SYMBOL(ip_tos2prio);

 /*
  * Route cache.


apneustic

apneustic


update config file

update config file

--- Vizzle/Vizzle/Vizzle/VizzleConfig.h
+++ Vizzle/Vizzle/Vizzle/VizzleConfig.h
@@ -8,6 +8,26 @@

 #ifndef Vizzle_VizzleConfig_h
 #define Vizzle_VizzleConfig_h
+
+#import "VZListViewDelegate.h"
+#import "VZListViewDataSource.h"
+#import "VZViewController.h"
+#import "VZListViewController.h"
+#import "VZHTTPRequest.h"
+#import "VZModel.h"
+#import "VZHTTPModel.h"
+#import "VZHTTPListModel.h"
+#import "VZListCell.h"
+#import "VZListDefaultTextCell.h"
+#import "VZListDefaultErrorCell.h"
+#import "VZListDefaultLoadingCell.h"
+#import "VZItem.h"
+#import "VZListItem.h"
+#import "VZListDefaultTextItem.h"
+#import "VZFooterViewFactory.h"
+#import "VZViewControllerLogic.h"
+
+

 #undef	VZLog
 #define VZLog(fmt,...)\


[IPV6]: Make struct ip6_prohibit_entry_template static.

This patch makes the needlessly global struct
ip6_prohibit_entry_template static.

Signed-off-by: Adrian Bunk <0b86548ef377da0031a3ff3f0c4e06f016e20105@kernel.org>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/ipv6/route.c
+++ net/ipv6/route.c
@@ -150,7 +150,7 @@
 static int ip6_pkt_prohibit(struct sk_buff *skb);
 static int ip6_pkt_prohibit_out(struct sk_buff *skb);

-struct rt6_info ip6_prohibit_entry_template = {
+static struct rt6_info ip6_prohibit_entry_template = {
 	.u = {
 		.dst = {
 			.__refcnt	= ATOMIC_INIT(1),


embarrel

embarrel


Problem 31 solved

Problem 31 solved

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

--- problem31/main.c
+++ problem31/main.c
@@ -0,0 +1,43 @@
+/*
+    In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:
+    1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).
+    It is possible to make £2 in the following way:
+    1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p
+    How many different ways can £2 be made using any number of coins?
+*/
+
+#include <stdio.h>
+
+const int coins[] = {200, 100, 50, 20, 10, 5, 2, 1};
+
+int getCombinations(int index, int sum);
+
+int main(int argc, char* argv[]) {
+    int target = 200;
+
+    printf("Result: %d\n", getCombinations(0, target));
+
+    return 0;
+}
+
+int getCombinations(int index, int sum) {
+    if(sum <= 0) {
+        return 0;
+    }
+
+    // Check if it's the last index.
+    if(index == sizeof(coins)/sizeof(const int) - 1) {
+        return 1;
+    }
+
+    int combinations = 0;
+
+    int i = 0;
+    int rest = 0;
+    do {
+        rest = sum - (i++ * coins[index]);
+        combinations += getCombinations(index + 1, rest);;
+    } while(rest > 0);
+
+    return rest == 0 ? combinations + 1 : combinations;
+}


[IPV6]: ROUTE: Copy u.dst.error for RTF_REJECT routes when cloning.

Signed-off-by: YOSHIFUJI Hideaki <948b80da4254122ea1e8973dd9930d46b7654cf3@linux-ipv6.org>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/ipv6/route.c
+++ net/ipv6/route.c
@@ -1249,6 +1249,8 @@
 		nrt->rt6i_nexthop = neigh_clone(rt->rt6i_nexthop);
 		dst_set_expires(&nrt->u.dst, ip6_rt_mtu_expires);
 		nrt->rt6i_flags |= RTF_DYNAMIC|RTF_CACHE|RTF_EXPIRES;
+		if (nrt->rt6i_flags & RTF_REJECT)
+			nrt->u.dst.error = rt->u.dst.error;
 		nrt->u.dst.metrics[RTAX_MTU-1] = pmtu;
 		if (allfrag)
 			nrt->u.dst.metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG;


splanchnolith

splanchnolith


[IPV6] NDISC: Search over all possible rules on receipt of redirect.

Split up function for finding routes for redirects.

Signed-off-by: YOSHIFUJI Hideaki <948b80da4254122ea1e8973dd9930d46b7654cf3@linux-ipv6.org>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/ipv6/route.c
+++ net/ipv6/route.c
@@ -1279,19 +1279,18 @@
 /*
  *	Handle redirects
  */
-void rt6_redirect(struct in6_addr *dest, struct in6_addr *src,
-		  struct in6_addr *saddr,
-		  struct neighbour *neigh, u8 *lladdr, int on_link)
-{
-	struct rt6_info *rt, *nrt = NULL;
+struct ip6rd_flowi {
+	struct flowi fl;
+	struct in6_addr gateway;
+};
+
+static struct rt6_info *__ip6_route_redirect(struct fib6_table *table,
+					     struct flowi *fl,
+					     int flags)
+{
+	struct ip6rd_flowi *rdfl = (struct ip6rd_flowi *)fl;
+	struct rt6_info *rt;
 	struct fib6_node *fn;
-	struct fib6_table *table;
-	struct netevent_redirect netevent;
-
-	/* TODO: Very lazy, might need to check all tables */
-	table = fib6_get_table(RT6_TABLE_MAIN);
-	if (table == NULL)
-		return;

 	/*
 	 * Get the "current" route for this destination and
@@ -1305,7 +1304,7 @@
 	 */

 	read_lock_bh(&table->tb6_lock);
-	fn = fib6_lookup(&table->tb6_root, dest, src);
+	fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
 restart:
 	for (rt = fn->leaf; rt; rt = rt->u.next) {
 		/*
@@ -1320,29 +1319,67 @@
 			continue;
 		if (!(rt->rt6i_flags & RTF_GATEWAY))
 			continue;
-		if (neigh->dev != rt->rt6i_dev)
+		if (fl->oif != rt->rt6i_dev->ifindex)
 			continue;
-		if (!ipv6_addr_equal(saddr, &rt->rt6i_gateway))
+		if (!ipv6_addr_equal(&rdfl->gateway, &rt->rt6i_gateway))
 			continue;
 		break;
 	}
-	if (rt)
-		dst_hold(&rt->u.dst);
-	else if (rt6_need_strict(dest)) {
-		while ((fn = fn->parent) != NULL) {
-			if (fn->fn_flags & RTN_ROOT)
-				break;
-			if (fn->fn_flags & RTN_RTINFO)
-				goto restart;
+
+	if (!rt) {
+		if (rt6_need_strict(&fl->fl6_dst)) {
+			while ((fn = fn->parent) != NULL) {
+				if (fn->fn_flags & RTN_ROOT)
+					break;
+				if (fn->fn_flags & RTN_RTINFO)
+					goto restart;
+			}
 		}
-	}
+		rt = &ip6_null_entry;
+	}
+	dst_hold(&rt->u.dst);
+
 	read_unlock_bh(&table->tb6_lock);

-	if (!rt) {
+	return rt;
+};
+
+static struct rt6_info *ip6_route_redirect(struct in6_addr *dest,
+					   struct in6_addr *src,
+					   struct in6_addr *gateway,
+					   struct net_device *dev)
+{
+	struct ip6rd_flowi rdfl = {
+		.fl = {
+			.oif = dev->ifindex,
+			.nl_u = {
+				.ip6_u = {
+					.daddr = *dest,
+					.saddr = *src,
+				},
+			},
+		},
+		.gateway = *gateway,
+	};
+	int flags = rt6_need_strict(dest) ? RT6_F_STRICT : 0;
+
+	return (struct rt6_info *)fib6_rule_lookup((struct flowi *)&rdfl, flags, __ip6_route_redirect);
+}
+
+void rt6_redirect(struct in6_addr *dest, struct in6_addr *src,
+		  struct in6_addr *saddr,
+		  struct neighbour *neigh, u8 *lladdr, int on_link)
+{
+	struct rt6_info *rt, *nrt = NULL;
+	struct netevent_redirect netevent;
+
+	rt = ip6_route_redirect(dest, src, saddr, neigh->dev);
+
+	if (rt == &ip6_null_entry) {
 		if (net_ratelimit())
 			printk(KERN_DEBUG "rt6_redirect: source isn't a valid nexthop "
 			       "for redirect target\n");
-		return;
+		goto out;
 	}

 	/*


ipv6: Kill useless route tracing bits in net/ipv6/route.c

RDBG() wasn't even used, and the messages printed by RT6_DEBUG() were
far from useful.  Just get rid of all this stuff, we can replace it
with something more suitable if we want.

Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/ipv6/route.c
+++ net/ipv6/route.c
@@ -62,17 +62,6 @@
 #include <linux/sysctl.h>
 #endif

-/* Set to 3 to get tracing. */
-#define RT6_DEBUG 2
-
-#if RT6_DEBUG >= 3
-#define RDBG(x) printk x
-#define RT6_TRACE(x...) printk(KERN_DEBUG x)
-#else
-#define RDBG(x)
-#define RT6_TRACE(x...) do { ; } while (0)
-#endif
-
 static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort,
 				    const struct in6_addr *dest);
 static struct dst_entry	*ip6_dst_check(struct dst_entry *dst, u32 cookie);
@@ -518,9 +507,6 @@
 	struct rt6_info *match, *rt0;
 	struct net *net;

-	RT6_TRACE("%s(fn->leaf=%p, oif=%d)\n",
-		  __func__, fn->leaf, oif);
-
 	rt0 = fn->rr_ptr;
 	if (!rt0)
 		fn->rr_ptr = rt0 = fn->leaf;
@@ -538,9 +524,6 @@
 		if (next != rt0)
 			fn->rr_ptr = next;
 	}
-
-	RT6_TRACE("%s() => %p\n",
-		  __func__, match);

 	net = dev_net(rt0->rt6i_dev);
 	return match ? match : net->ipv6.ip6_null_entry;
@@ -2173,10 +2156,9 @@
 	const struct net_device *dev = adn->dev;

 	if ((rt->rt6i_dev == dev || !dev) &&
-	    rt != adn->net->ipv6.ip6_null_entry) {
-		RT6_TRACE("deleted by ifdown %p\n", rt);
+	    rt != adn->net->ipv6.ip6_null_entry)
 		return -1;
-	}
+
 	return 0;
 }


copart

copart


[AF_KEY]: suppress a warning for 64k pages.

On PowerPC allmodconfig build we get this:

net/key/af_key.c:400: warning: comparison is always false due to limited range of data type

Signed-off-by: Stephen Rothwell <4bf0fb350827ce8d86875e76c923a478597c3cef@canb.auug.org.au>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/key/af_key.c
+++ net/key/af_key.c
@@ -395,9 +395,9 @@
 static inline int verify_sec_ctx_len(void *p)
 {
 	struct sadb_x_sec_ctx *sec_ctx = (struct sadb_x_sec_ctx *)p;
-	int len;
-
-	if (sec_ctx->sadb_x_ctx_len > PAGE_SIZE)
+	int len = sec_ctx->sadb_x_ctx_len;
+
+	if (len > PAGE_SIZE)
 		return -EINVAL;

 	len = pfkey_sec_ctx_len(sec_ctx);


<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">      <title>403 - Forbidden</title>
403 - Forbidden


dacite

dacite


deliriousness

deliriousness


polyprismatic

polyprismatic


humdrummish

humdrummish


Sphaerobolus

Sphaerobolus


바둑돌 색깔 추가, 이동 개선, 코드 가독성 강화

바둑돌 색깔 추가, 이동 개선, 코드 가독성 강화

--- 오목.c
+++ 오목.c
@@ -2,11 +2,13 @@
 #include <Windows.h>
 #include <conio.h>
 #define size 20
+
 #define LEFT 75
 #define RIGHT 77
 #define UP 72
 #define DOWN 80
 #define ENTER 13
+
 void gotoxy(int x, int y)
 {
 	/*
@@ -26,7 +28,20 @@

 	   ǥ ڷ
 	*/
+	static HANDLE hnd;
+	hnd = GetStdHandle(STD_OUTPUT_HANDLE);
+
 	*ptr = (*ptr == 'O') ? 'X' : 'O';
+
+	gotoxy(2, 0);							// ǥõǴ ǥ  ĭ ڷ ̵
+	putchar('\b');							// ĭ
+	if (*ptr == 'O')						//'O'̸
+		SetConsoleTextAttribute(hnd, 0x71);	// ڻ ٲ( ȸ, £ Ķ)
+	else									//'X'̸
+		SetConsoleTextAttribute(hnd, 0x74);	// ڻ ٲ( ȸ, £ )
+	putchar(*ptr);							//
+
+	SetConsoleTextAttribute(hnd, 0x0F);		// ڻ (, )
 }
 void ShowPlate(char(*plate)[20])
 {
@@ -144,53 +159,82 @@
 int move(char plate[][20])
 {
 	/*
-	̵  Լ
+	̵  ⸦  Լ

 	 迭 ڷ
 	  -1, ߸ ǥ ϸ 1, ̸ 0 ȯ
 	*/
+
 	char clt;
-	int x, y;
-	x = 10 * 3;							// ĭ ΰ 3̱ , 3
-	y = 10;
-	while (1)
-	{
-		clt = _getch();					//Ű Է
-		if (clt == -32 || clt == 0)		//Է¹ Ű尡 Ư Űڵ̸
-			clt = _getch();				//ѹ  о
-
-		if (clt == LEFT)				//Ű̸
-			x -= 3;						//  ĭ( )̵
-		else if (clt == RIGHT)			// Ű̸
-			x += 3;						//  ĭ( )̵
-		else if (clt == UP)				// Ű̸
-			y -= 1;						//  ĭ ̵
-		else if (clt == DOWN)			//Ʒ Ű̸
-			y += 1;						//Ʒ  ĭ ̵
-		else if (clt == ENTER)			//Ű̸
-		{
-			if (plate[y][x/3] != '.')			//ǥ
-				return 1;						//1 ȯ  ޼  Ʈ Ȱȭ
-			else								//
-				plate[y][x / 3] = plate[0][0];  //
-
-			if (WinOrNot(plate, y, x / 3))		//
-			{
-				ShowPlate(plate);				//ٵ ְ
-				Win(plate[0][0]);				//Win()
-				return -1;						//-1 ȯ
-			}
-			else								// ʾ
-			{
-				return 0;						//0 ȯ
-			}
-		}
-
-		gotoxy(0, 22);							//(0, 22) ̵ؼ
-		printf("ǥ : %-2d %-2d", x / 3, y);	//
-
-		gotoxy(x+1, y);							//ǥ ̵
-	}
+	static int x = 10 * 3;							// ĭ ΰ 3̱ , 3
+	static int y = 10;
+	static HANDLE hnd;
+	hnd = GetStdHandle(STD_OUTPUT_HANDLE);
+
+while (1)
+{
+	gotoxy(0, 22);							//(0, 22) ̵ؼ
+	printf("ǥ : %-2d %-2d", x / 3, y);	//
+
+	gotoxy(x+1, y);							// ǥ ̵
+
+	clt = _getch();					//Ű Է
+	if (clt == -32 || clt == 0)		//Է¹ Ű尡 Ư Űڵ̸
+		clt = _getch();				//ѹ  о
+
+	switch (clt)
+	{
+	case LEFT:						//Ű̸
+		x -= 3;						//  ĭ( )̵
+		break;
+	case RIGHT:						// Ű̸
+		x += 3;						//  ĭ( )̵
+		break;
+	case UP:						// Ű̸
+		y -= 1;						//  ĭ ̵
+		break;
+	case DOWN:						//Ʒ Ű̸
+		y += 1;						//Ʒ  ĭ ̵
+		break;
+	case ENTER:						//Ű̸
+		if (plate[y][x / 3] != '.')			//ǥ
+			return 1;						//1 ȯ  ޼  Ʈ Ȱȭ
+		else								//
+		{
+			plate[y][x / 3] = plate[0][0];  //
+			gotoxy(x + 2, y);				//   ĭ  ̵
+			putchar('\b');					// ĭ
+			if (plate[0][0] == 'O')			//'O' ̾
+				SetConsoleTextAttribute(hnd, 0x09);// ڻ (, Ķ)
+			else							//'X' ̾
+				SetConsoleTextAttribute(hnd, 0x0C);// ڻ (, )
+			putchar(plate[0][0]);			//
+
+			SetConsoleTextAttribute(hnd, 0x0F);// ڻ (, Ͼ)
+		}
+
+		if (WinOrNot(plate, y, x / 3))		//
+		{
+			gotoxy(0, 20);
+			Win(plate[0][0]);				//Win()
+			return -1;						//-1 ȯ
+		}
+		else								// ʾ
+		{
+			return 0;						//0 ȯ
+		}
+	}
+
+
+	if (x < 1*3)
+		x = 19 * 3;
+	else if (x > 19 * 3)
+		x = 1 * 3;
+	if (y < 1)
+		y = 19;
+	else if (y > 19)
+		y = 1;
+}
 }
 int main(void)
 {
@@ -207,21 +251,22 @@
 			plate[y][x] = '.';			//  . ä

 	plate[0][0] = 'O';					// O
-
+	ShowPlate(plate);					//
+	gotoxy(10 * 3 + 1, 10);				//(10, 10)  Ŀ ̵
 	while(1)
 	{
-		ShowPlate(plate);				//
-		if (trig == 1)					// ޼  ƮŰ Ȱȭ
-		{
+		trig = move(plate);				//Ʈſ move() ȯ
+
+		switch (trig)
+		{
+		case 1:							// ޼  ƮŰ Ȱȭ
+			gotoxy(0, 21);
 			printf("߸ ǥ Է,  Ѿ \n");// ޼
 			trig = 0;					//Ʈ Ȱȭ
-		}
-		gotoxy(10 * 3 + 1, 10);			//(10, 10)  Ŀ ̵
-		trig = move(plate);				//Ʈſ move() ȯ
-
-		if (trig == -1)					//-1 ȯǾ
+			break;
+		case -1:						//-1 ȯǾ
 			return 0;					//
-
+		}
 		TurnChange(&plate[0][0]);		// ٲ
 	}
 }


lowermost

lowermost


unapproachableness

unapproachableness


shafty

shafty


ferrihydrocyanic

ferrihydrocyanic


potentially

potentially


unattained

unattained


reappropriate

reappropriate


rename .sh_ to .sh

rename .sh_ to .sh

--- segment.c
+++ segment.c
@@ -75,7 +75,7 @@
   RELAY_ERROR(mmap_obj_load(&segment->stringpool, "wp/stringpool", fn));

   // open the string hash
-  snprintf(fn, 128, "%s.sh_", pathname_base);
+  snprintf(fn, 128, "%s.sh", pathname_base);
   RELAY_ERROR(mmap_obj_load(&segment->stringmap, "wp/stringmap", fn));

   // open the term hash
@@ -120,7 +120,7 @@
   stringpool_init(MMAP_OBJ(segment->stringpool, stringpool));

   // create the string hash
-  snprintf(fn, 128, "%s.sh_", pathname_base);
+  snprintf(fn, 128, "%s.sh", pathname_base);
   RELAY_ERROR(mmap_obj_create(&segment->stringmap, "wp/stringmap", fn, stringmap_initial_size()));
   stringmap_init(MMAP_OBJ(segment->stringmap, stringmap));

@@ -159,7 +159,7 @@
   unlink(fn);
   snprintf(fn, 128, "%s.sp", pathname_base);
   unlink(fn);
-  snprintf(fn, 128, "%s.sh_", pathname_base);
+  snprintf(fn, 128, "%s.sh", pathname_base);
   unlink(fn);
   snprintf(fn, 128, "%s.th", pathname_base);
   unlink(fn);


Create Firstcalculations.c

Create Firstcalculations.c

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

--- Firstcalculations.c
+++ Firstcalculations.c
@@ -0,0 +1,86 @@
+#ifndef simple
+#define simple
+
+void add(int MAX){
+	float x, y, sum;
+	printf("Enter 2 numbers to be added: \n ");
+	scanf("%f %f",&x, &y);
+	for(int i = 0; i < MAX; i++)
+   	{
+	sum = x + y;
+	}
+	printf("The sum is %.2f.", sum);
+				}
+
+void minus(int MAX){
+	float x, y, diff;
+	printf("Enter the number to be subtracted from: \n ");
+	scanf("%f",&x);
+	printf("Enter the second number: \n ");
+	scanf("%f",&y);
+	for(int i = 0; i < MAX; i++)
+    {
+	diff = x - y;
+	}
+	printf("The difference is %.2f", diff);
+					}
+
+void mul(int MAX){
+	float x, y, multi;
+	printf("Enter 2 numbers to be multiplied: \n");
+	scanf("%f %f",&x, &y);
+	for(int i = 0; i < MAX; i++)
+	{
+	multi = x * y;
+	}
+	printf("The result is %.2f", multi);
+				}
+
+void div(int MAX){
+	float x, y, dvs;
+	printf("Enter the dividend: \n");
+	scanf("%f",&x);
+	printf("Enter the divisor: \n");
+	scanf("%f",&y);
+    for(int i = 0; i < MAX; i++)
+	{
+	dvs = x / y;
+	}
+	printf("The answer is %.2f", dvs);
+				}
+
+void power(){
+  	int base, exp;
+  	long long int value=1;
+  	printf("Enter base number and exponent to be raised to, respectively:\n ");
+  	scanf("%d %d", &base, &exp);
+  	while (exp!=0)
+  	{
+      value*=base;
+      --exp;
+  	}
+  	printf("The answer is %d", value);
+			}
+
+void fac(){
+  	int i, n;
+    unsigned long long int fact = 1;
+    printf("Enter an integer upto 12: ");
+    scanf("%d",&n);
+    if ( n < 0)
+        printf("The factorial of %d doesn't exist.", n);
+    else if (n > 12)
+    {
+    	printf("Error!! This program can only calculate factorials of integers from 0 to 12 only.");
+    }
+	else
+    {
+       for(i = 1; i <= n; i++)    /* for loop terminates if count>n */
+       {
+          fact*=i;              /* factorial=factorial*count */
+       }
+    printf("The factorial of %d = %lu", n, fact);
+    }
+		}
+
+#endif


Fix DNS grouping

Fix DNS grouping

--- features/netsocket/DNS.h
+++ features/netsocket/DNS.h
@@ -15,7 +15,7 @@
  */

 /** @file DNS.h Domain Name Service */
-/** @\addtogroup netsocket
+/** @addtogroup netsocket
  * @{ */

 #ifndef DNS_H


transhuman

transhuman


awin

awin


titration

titration


attern

attern


richen

richen


draughts

draughts


popularity

popularity


plesiomorphic

plesiomorphic


nondegerming

nondegerming


circuiteer

circuiteer


consociational

consociational


beggarliness

beggarliness


codilla

codilla


saussuritization

saussuritization


worded

worded


rotatory

rotatory


frankhearted

frankhearted


uncouple

uncouple


prototheme

prototheme


circumaxile

circumaxile


builtin-gc.c: use new pack_keep bitfield to detect .keep file existence

Signed-off-by: Brandon Casey <77bc9a9984e6786c5799d7a71768cf023120ef76@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

--- builtin-gc.c
+++ builtin-gc.c
@@ -134,19 +134,9 @@

 	prepare_packed_git();
 	for (cnt = 0, p = packed_git; p; p = p->next) {
-		char path[PATH_MAX];
-		size_t len;
-		int keep;
-
 		if (!p->pack_local)
 			continue;
-		len = strlen(p->pack_name);
-		if (PATH_MAX <= len + 1)
-			continue; /* oops, give up */
-		memcpy(path, p->pack_name, len-5);
-		memcpy(path + len - 5, ".keep", 6);
-		keep = access(p->pack_name, F_OK) && (errno == ENOENT);
-		if (keep)
+		if (p->pack_keep)
 			continue;
 		/*
 		 * Perhaps check the size of the pack and count only


builtin-am: support and auto-detect mercurial patches

Since 0cfd112 (am: preliminary support for hg patches, 2011-08-29),
git-am.sh could convert mercurial patches to an RFC2822 mail patch
suitable for parsing with git-mailinfo, and queue them in the state
directory for application.

Since 15ced75 (git-am foreign patch support: autodetect some patch
formats, 2009-05-27), git-am.sh was able to auto-detect mercurial
patches by checking if the file begins with the line:

	# HG changeset patch

Re-implement the above in builtin/am.c.

Helped-by: Stefan Beller <a7f3b1612c245dae606b3b9617b4f52187fddb65@google.com>
Signed-off-by: Paul Tan <ca5433e1cdd25b4a4001c54525dea593b33edc0c@gmail.com>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

--- builtin/am.c
+++ builtin/am.c
@@ -81,7 +81,8 @@
 	PATCH_FORMAT_UNKNOWN = 0,
 	PATCH_FORMAT_MBOX,
 	PATCH_FORMAT_STGIT,
-	PATCH_FORMAT_STGIT_SERIES
+	PATCH_FORMAT_STGIT_SERIES,
+	PATCH_FORMAT_HG
 };

 enum keep_type {
@@ -656,6 +657,11 @@
 		goto done;
 	}

+	if (!strcmp(l1.buf, "# HG changeset patch")) {
+		ret = PATCH_FORMAT_HG;
+		goto done;
+	}
+
 	strbuf_reset(&l2);
 	strbuf_getline_crlf(&l2, fp);
 	strbuf_reset(&l3);
@@ -851,6 +857,68 @@

 	argv_array_clear(&patches);
 	return ret;
+}
+
+/**
+ * A split_patches_conv() callback that converts a mercurial patch to a RFC2822
+ * message suitable for parsing with git-mailinfo.
+ */
+static int hg_patch_to_mail(FILE *out, FILE *in, int keep_cr)
+{
+	struct strbuf sb = STRBUF_INIT;
+
+	while (!strbuf_getline(&sb, in, '\n')) {
+		const char *str;
+
+		if (skip_prefix(sb.buf, "# User ", &str))
+			fprintf(out, "From: %s\n", str);
+		else if (skip_prefix(sb.buf, "# Date ", &str)) {
+			unsigned long timestamp;
+			long tz, tz2;
+			char *end;
+
+			errno = 0;
+			timestamp = strtoul(str, &end, 10);
+			if (errno)
+				return error(_("invalid timestamp"));
+
+			if (!skip_prefix(end, " ", &str))
+				return error(_("invalid Date line"));
+
+			errno = 0;
+			tz = strtol(str, &end, 10);
+			if (errno)
+				return error(_("invalid timezone offset"));
+
+			if (*end)
+				return error(_("invalid Date line"));
+
+			/*
+			 * mercurial's timezone is in seconds west of UTC,
+			 * however git's timezone is in hours + minutes east of
+			 * UTC. Convert it.
+			 */
+			tz2 = labs(tz) / 3600 * 100 + labs(tz) % 3600 / 60;
+			if (tz > 0)
+				tz2 = -tz2;
+
+			fprintf(out, "Date: %s\n", show_date(timestamp, tz2, DATE_MODE(RFC2822)));
+		} else if (starts_with(sb.buf, "# ")) {
+			continue;
+		} else {
+			fprintf(out, "\n%s\n", sb.buf);
+			break;
+		}
+	}
+
+	strbuf_reset(&sb);
+	while (strbuf_fread(&sb, 8192, in) > 0) {
+		fwrite(sb.buf, 1, sb.len, out);
+		strbuf_reset(&sb);
+	}
+
+	strbuf_release(&sb);
+	return 0;
 }

 /**
@@ -885,6 +953,8 @@
 		return split_mail_conv(stgit_patch_to_mail, state, paths, keep_cr);
 	case PATCH_FORMAT_STGIT_SERIES:
 		return split_mail_stgit_series(state, paths, keep_cr);
+	case PATCH_FORMAT_HG:
+		return split_mail_conv(hg_patch_to_mail, state, paths, keep_cr);
 	default:
 		die("BUG: invalid patch_format");
 	}
@@ -1937,6 +2007,8 @@
 		*opt_value = PATCH_FORMAT_STGIT;
 	else if (!strcmp(arg, "stgit-series"))
 		*opt_value = PATCH_FORMAT_STGIT_SERIES;
+	else if (!strcmp(arg, "hg"))
+		*opt_value = PATCH_FORMAT_HG;
 	else
 		return error(_("Invalid value for --patch-format: %s"), arg);
 	return 0;


notorious

notorious


preincorporate

preincorporate


pistol

pistol


"unisulcate"

"unisulcate"


spermaphyte

spermaphyte


unmarginal

unmarginal


nummuloidal

nummuloidal


Sharira

Sharira


Compile fix

Compile fix

git-svn-id: 713c6ad2e4727fd7ba94fe182df363143bf1f4b5@421 2da7661c-602c-0410-9277-d9994c0c2ef1

--- bwlib/time.c
+++ bwlib/time.c
@@ -129,7 +129,7 @@
         }
 #endif	/*  STA_NANO */
     }
-#else
+#endif
 NOADJTIME:
     if( (BWLContextConfigGetV(ctx,BWLAllowUnsync))){
         allow_unsync = 1;
@@ -138,7 +138,6 @@
         BWLError(ctx,BWLErrWARNING,BWLErrUNKNOWN,
                 "NTP: Status UNSYNC (clock offset problems likely)");
     }
-#endif  /* HAVE_SYS_TIMEX_H */

     if( !(toffstr = getenv("BWCTL_DEBUG_TIMEOFFSET"))){
         timeoffset.tv_sec = 0;


tinwoman

tinwoman


inflationist

inflationist


inconsequentiality

inconsequentiality


wingmanship

wingmanship


Remove double include

Remove double include

--- tests/wocky-xmpp-readwrite-test.c
+++ tests/wocky-xmpp-readwrite-test.c
@@ -5,7 +5,6 @@
 #include <glib.h>

 #include <wocky/wocky-xmpp-reader.h>
-#include <wocky/wocky-xmpp-writer.h>
 #include <wocky/wocky-xmpp-writer.h>
 #include <wocky/wocky-utils.h>


sootylike

sootylike


undecocted

undecocted


inadmissible

inadmissible


basqued

basqued


Chelodina

Chelodina


undisreputable

undisreputable


size_t warning in gamepacketnew fixed

size_t warning in gamepacketnew fixed

--- src/common/Network/GamePacketNew.h
+++ src/common/Network/GamePacketNew.h
@@ -108,7 +108,7 @@
     uint16_t m_segmentType;

   public:
-    virtual uint32_t getContentSize()
+    virtual size_t getContentSize()
     {
       return 0;
     };
@@ -195,7 +195,7 @@
     FFXIVIpcPacket< T, T1 >( const FFXIVARR_PACKET_RAW& rawPacket )
     {
       auto ipcHdrSize = sizeof( FFXIVARR_IPC_HEADER );
-      auto copySize = std::min< uint32_t >( sizeof( T ), rawPacket.segHdr.size - ipcHdrSize );
+      auto copySize = std::min< size_t >( sizeof( T ), rawPacket.segHdr.size - ipcHdrSize );

       memcpy( &m_segHdr, &rawPacket.segHdr, sizeof( FFXIVARR_PACKET_SEGMENT_HEADER ) );
       memcpy( &m_data, &rawPacket.data[ 0 ] + ipcHdrSize, copySize );
@@ -204,7 +204,7 @@
       m_ipcHdr.type = static_cast< ServerZoneIpcType >( m_data._ServerIpcType );
     }

-    uint32_t getContentSize() override
+    size_t getContentSize() override
     {
       return sizeof( FFXIVARR_IPC_HEADER ) + sizeof( T );
     }
@@ -291,7 +291,7 @@
       memcpy( &m_segHdr, data, segmentHdrSize );
     }

-    uint32_t getContentSize() override
+    size_t getContentSize() override
     {
       return m_data.size();
     }


amaroidal

amaroidal


porphyraceous

porphyraceous


decelerate

decelerate


overtariff

overtariff


aggravating

aggravating


More complete number validation.

More complete number validation.

--- gcgen/gcgen.c
+++ gcgen/gcgen.c
@@ -77,19 +77,13 @@
 int isnum(char *str)
 {
 	size_t i;
+  size_t len = strlen(str);
 	int points = 0;
-  int neg = 0;
-  int exp = 0;
   /* TODO: Better checks. */
-	for(i = 0; i < strlen(str); i++) {
+  i = ((str[0] == '-' && len > 1) ? 1 : 0);
+	for(; i < strlen(str); i++) {
 		if((str[i] > '9' || str[i] < '0')) {
 			switch(str[i]) {
-      case '-':
-        if(neg++ != 0) {
-          return 0;
-        }
-        break;
-
       case '.':
         if(points++ != 0) {
           return 0;
@@ -98,10 +92,12 @@

       case 'e':
       case 'E':
-        if(exp++ != 0) {
-          return 0;
+        if(i < (len - 1)) {
+          return isnum(str + i + 1);
         }
+        return 0;
         break;
+
       default:
         return 0;
       }


fosterer

fosterer


Marist

Marist


knickknacked

knickknacked


gillygaupus

gillygaupus


perplex

perplex


ligurition

ligurition


noncruciform

noncruciform


formeret

formeret


more ap.c improvements

more ap.c improvements

--- gen164/6/ap.c
+++ gen164/6/ap.c
@@ -48,6 +48,29 @@
 	     u2_noun gen)
     {
       u2_weak hoc = u2_ds_look(wir_r, ter, "al");
+
+      if ( u2_none == hoc ) {
+	return u2_cm_bail(c3__fail);
+      }
+      else {
+	u2_noun gat = u2_nk_soft(wir_r, u2_rx(wir_r, ter), hoc);
+	u2_noun cor = u2_rl_molt(wir_r, gat,
+					u2_cv_sam, u2_rx(wir_r, gen),
+					0);
+
+	u2_rz(wir_r, hoc);
+	u2_rz(wir_r, gat);
+
+	return cor;
+      }
+    }
+
+    static u2_noun
+    _by_core(u2_wire wir_r,
+	     u2_noun ter,
+	     u2_noun gen)
+    {
+      u2_weak hoc = u2_ds_look(wir_r, ter, "by");

       if ( u2_none == hoc ) {
 	return u2_cm_bail(c3__fail);
@@ -309,6 +332,10 @@
 /***
 ****
 ***/
+  _open_do_pq(zpcb)    //  !_
+  {
+    return u2_rx(wir_r, q_gen);
+  }
   _open_do_p(zpgr)    //  !>
   {
     return u2_bq
@@ -637,6 +664,18 @@
       (wir_r, c3__sggr,
               u2_bq(wir_r, c3__memo, c3__dtzz, u2_blip, u2_rx(wir_r, p_gen)),
               u2_rx(wir_r, q_gen));
+  }
+  _open_do_pqr(sgpm)   //  ~&
+  {
+    return u2_bt
+      (wir_r,
+       c3__sggr,
+       u2_bt(wir_r,
+	     c3__slog,
+	     u2_bt(wir_r, c3__dtzy, u2_blip, u2_rx(wir_r, p_gen)),
+	     u2_bq(wir_r, c3__cnhp, u2_bc(wir_r, c3__cnzy, c3__cain),
+		   u2_bc(wir_r, c3__zpgr, u2_rx(wir_r, q_gen)), u2_nul)),
+       u2_rx(wir_r, r_gen));
   }
   _open_do_pqrs(sgwt)   //  ~?
   {
@@ -791,6 +830,7 @@
 	_open_pqrs(sgcn);
 	_open_pq  (sgfs);
 	_open_pq  (sgls);
+	_open_pqr (sgpm);
 	_open_pqrs(sgwt);

         _open_pq  (smcl);
@@ -814,6 +854,7 @@
         _open_pqr (wtkt);
         _open_p   (wtpm);

+	_open_pq  (zpcb);
 	_open_p   (zpgr);
       }
     }


corruptionist

corruptionist


gender

gender


Balkar

Balkar


tasting

tasting


hermodactyl

hermodactyl


feodatory

feodatory


onyxitis

onyxitis


register DIR_CACHE and DIR_USER_CACHE in path service

--- brightray/browser/brightray_paths.h
+++ brightray/browser/brightray_paths.h
@@ -13,17 +13,28 @@
 #include "base/base_paths_mac.h"
 #endif

+#if defined(OS_POSIX)
+#include "base/base_paths_posix.h"
+#endif
+
 namespace brightray {

 enum {
   PATH_START = 1000,

   DIR_USER_DATA = PATH_START,  // Directory where user data can be written.
+  DIR_USER_CACHE,  // Directory where user cache can be written.

 #if defined(OS_LINUX)
   DIR_APP_DATA,  // Application Data directory under the user profile.
 #else
   DIR_APP_DATA = base::DIR_APP_DATA,
+#endif
+
+#if defined(OS_POSIX)
+  DIR_CACHE = base::DIR_CACHE,  // Directory where to put cache data.
+#else
+  DIR_CACHE = base::DIR_APP_DATA,
 #endif

   PATH_END


[BSP][RT1050] Improve pin drive stability. | 提高PIN驱动稳定性.

1. 当先配置PIN为普通输入输出后, 再修改成中断, 不会出现无法触发中断的问题.

--- bsp/imxrt1052-evk/drivers/drv_pin.c
+++ bsp/imxrt1052-evk/drivers/drv_pin.c
@@ -436,13 +436,11 @@
     if(rt1052_pin_map[pin].gpio != GPIO5)
     {
         CLOCK_EnableClock(kCLOCK_Iomuxc);
-
         IOMUXC_SetPinMux(0x401F8010U + pin*4, 0x5U, 0, 0, 0, 1);
     }
     else
     {
         CLOCK_EnableClock(kCLOCK_IomuxcSnvs);
-
         IOMUXC_SetPinMux(0x400A8000U + (pin-125)*4, 0x5U, 0, 0, 0, 1);
     }

@@ -566,6 +564,7 @@
 {
     gpio_pin_config_t gpio;
     IRQn_Type irq_num;
+    rt_uint32_t config_value = 0x1b0a0;

     struct rt1052_pin* pin_map = RT_NULL;
     struct rt1052_irq* irq_map = RT_NULL;
@@ -639,6 +638,15 @@
             break;
         }

+        if(rt1052_pin_map[pin].gpio != GPIO5)
+        {
+            IOMUXC_SetPinConfig(0, 0, 0, 0, 0x401F8200U + pin*4, config_value);
+        }
+        else
+        {
+            IOMUXC_SetPinConfig(0, 0, 0, 0, 0x400A8018U + (pin-125)*4, config_value);
+        }
+
         irq_num = rt1052_get_irqnum(rt1052_pin_map[pin].gpio, rt1052_pin_map[pin].gpio_pin);

         NVIC_SetPriority(irq_num, NVIC_EncodePriority(NVIC_GetPriorityGrouping(), 5, 0));
@@ -675,7 +683,7 @@
     rt1052_pin_ops.pin_read        = rt1052_pin_read;
     rt1052_pin_ops.pin_write       = rt1052_pin_write;
     rt1052_pin_ops.pin_attach_irq  = rt1052_pin_attach_irq;
-    rt1052_pin_ops.pin_detach_irq = rt1052_pin_detach_irq;
+    rt1052_pin_ops.pin_detach_irq  = rt1052_pin_detach_irq;
     rt1052_pin_ops.pin_irq_enable  = rt1052_pin_irq_enable;

     ret = rt_device_pin_register("pin", &rt1052_pin_ops, RT_NULL);


underbright

underbright


tankroom

tankroom


dyeing

dyeing


uninsurable

uninsurable


Send info

Send info

--- firmware/BlynkProtocol.h
+++ firmware/BlynkProtocol.h
@@ -223,7 +223,7 @@
                 BLYNK_LOG("Ready (ping: %dms).", lastActivityIn-lastHeartbeat);
                 lastHeartbeat = lastActivityIn;
                 state = CONNECTED;
-                //TODO: this->sendInfo();
+                this->sendInfo();
 #if !defined(BLYNK_NO_YIELD)
                 yield();
 #endif


seraphina

seraphina


endosteally

endosteally


Correct waiting time.

Correct waiting time.

--- c/demod-fm.c
+++ c/demod-fm.c
@@ -444,7 +444,7 @@
         HACKRF_CHECK_STATUS(hrf, status, "hackrf_start_rx");

         // Wait 3 seconds to receive data.
-        sleep(1);
+        sleep(SECONDS);

     } else {
         FILE *fp = fopen(fname, "r");


playday

playday


welding

welding


controvertist

controvertist


chisellike

chisellike


chromoxylograph

chromoxylograph


workwomanlike

workwomanlike


poll: move lock to where it makes more sense

--- gst/gstpoll.c
+++ gst/gstpoll.c
@@ -1101,6 +1101,7 @@
 static void
 gst_poll_check_ctrl_commands (GstPoll * set, gint res, gboolean * restarting)
 {
+  g_mutex_lock (set->lock);
   /* check if the poll/select was aborted due to a command */
   if (set->controllable) {
 #ifndef G_OS_WIN32
@@ -1132,6 +1133,7 @@
     }
 #endif
   }
+  g_mutex_unlock (set->lock);
 }

 /**
@@ -1349,9 +1351,7 @@
     }

     if (!is_timer) {
-      g_mutex_lock (set->lock);
       gst_poll_check_ctrl_commands (set, res, &restarting);
-      g_mutex_unlock (set->lock);
     }

     /* update the controllable state if needed */


quincuncial

quincuncial


Apply DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION to HTMLUnknownElement

DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION supports more plenty helper functions than
manual toFoo().

BUG=309516

Review URL: https://codereview.chromium.org/98443003

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@162965 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/core/html/HTMLUnknownElement.h
+++ Source/core/html/HTMLUnknownElement.h
@@ -51,11 +51,12 @@
     }
 };

-inline HTMLUnknownElement* toHTMLUnknownElement(HTMLElement* element)
+inline bool isHTMLUnknownElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!element || element->isHTMLUnknownElement());
-    return static_cast<HTMLUnknownElement*>(element);
+    return node.isElementNode() && toHTMLElement(node).isHTMLUnknownElement();
 }
+
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLUnknownElement);

 } // namespace


gtkmain: Ignore grab for events in child popovers

Popovers may be spawn when there's GTK+ grabs somewhere else (eg.
text selection popover/handles in an entry in a modal popover). When
this happens, events go to the grab widget (in this case the modal
popover) and are effectively ignored by the event widget, even though
it's can be conceptually a child of the grab widget.

To get away with this, tweak a bit gtk_main_do_event(), so events going
to popovers that are related to grab_widget or a child of it are received,
as it would happen with regular children of grab_widget.

https://bugzilla.gnome.org/show_bug.cgi?id=750993

--- gtk/gtkmain.c
+++ gtk/gtkmain.c
@@ -1471,6 +1471,54 @@
     return NULL;
 }

+static GtkWidget *
+widget_get_popover_ancestor (GtkWidget *widget,
+                             GtkWindow *window)
+{
+  GtkWidget *parent = gtk_widget_get_parent (widget);
+
+  while (parent && parent != GTK_WIDGET (window))
+    {
+      widget = parent;
+      parent = gtk_widget_get_parent (widget);
+    }
+
+  if (!parent || parent != GTK_WIDGET (window))
+    return NULL;
+
+  if (_gtk_window_is_popover_widget (GTK_WINDOW (window), widget))
+    return widget;
+
+  return NULL;
+}
+
+static gboolean
+check_event_in_child_popover (GtkWidget *event_widget,
+                              GtkWidget *grab_widget)
+{
+  GtkWidget *window, *popover = NULL, *popover_parent = NULL;
+
+  if (grab_widget == event_widget)
+    return FALSE;
+
+  window = gtk_widget_get_ancestor (event_widget, GTK_TYPE_WINDOW);
+
+  if (!window)
+    return FALSE;
+
+  popover = widget_get_popover_ancestor (event_widget, GTK_WINDOW (window));
+
+  if (!popover)
+    return FALSE;
+
+  popover_parent = _gtk_window_get_popover_parent (GTK_WINDOW (window), popover);
+
+  if (!popover_parent)
+    return FALSE;
+
+  return (popover_parent == grab_widget || gtk_widget_is_ancestor (popover_parent, grab_widget));
+}
+
 /**
  * gtk_main_do_event:
  * @event: An event to process (normally passed by GDK)
@@ -1605,6 +1653,14 @@
   if (!grab_widget ||
       ((gtk_widget_is_sensitive (event_widget) || event->type == GDK_SCROLL) &&
        gtk_widget_is_ancestor (event_widget, grab_widget)))
+    grab_widget = event_widget;
+
+  /* popovers are not really a "child" of their "parent" in the widget/window
+   * hierarchy sense, we however want to interact with popovers spawn by widgets
+   * within grab_widget. If this is the case, we let the event go through
+   * unaffected by the grab.
+   */
+  if (check_event_in_child_popover (event_widget, grab_widget))
     grab_widget = event_widget;

   /* If the widget receiving events is actually blocked by another


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>403 - Forbidden</title>

403 - Forbidden


fringilline

fringilline


Improve multiarch condition in coredump access

--- src/coredump/_UCD_access_reg_linux.c
+++ src/coredump/_UCD_access_reg_linux.c
@@ -57,7 +57,7 @@
 #elif defined(UNW_TARGET_S390X)
   if (regnum > UNW_S390X_R15)
     goto badreg;
-#elif defined(UNW_TARGET_IA64)
+#elif defined(UNW_TARGET_IA64) || defined(UNW_TARGET_HPPA) || defined(UNW_TARGET_PPC32) || defined(UNW_TARGET_PPC64)
   if (regnum >= ARRAY_SIZE(ui->prstatus->pr_reg))
     goto badreg;
 #else


rubdown

rubdown


unintervening

unintervening


JsonUtils.h: introduce monoTimeToJson()

JsonUtils.h: introduce monoTimeToJson()

--- src/cxx_supportlib/Utils/JsonUtils.h
+++ src/cxx_supportlib/Utils/JsonUtils.h
@@ -290,6 +290,59 @@
 	return doc;
 }

+/**
+ * Encodes the given monotonic timestamp into a JSON object that
+ * describes it.
+ *
+ *     MonotonicTimeUsec t = SystemTime::getMonotonicUsec();
+ *     monoTimeToJson(t - 10000000, t);
+ *     // {
+ *     //   "timestamp": 1424887842,
+ *     //   "local": "Wed Feb 25 19:10:34 CET 2015",
+ *     //   "relative_timestamp": -10,
+ *     //   "relative": "10s ago"
+ *     // }
+ */
+inline Json::Value
+monoTimeToJson(MonotonicTimeUsec t, MonotonicTimeUsec monoNow, unsigned long long now = 0) {
+	if (t == 0) {
+		return Json::Value(Json::nullValue);
+	}
+
+	if (now == 0) {
+		now = SystemTime::getUsec();
+	}
+
+	unsigned long long wallClockTimeUsec;
+	if (monoNow > t) {
+		wallClockTimeUsec = now - (monoNow - t);
+	} else {
+		wallClockTimeUsec = now + (monoNow - t);
+	}
+
+	time_t wallClockTime = (time_t) (wallClockTimeUsec / 1000000ull);
+	char timeStr[32];
+	size_t len;
+	ctime_r(&wallClockTime, timeStr);
+	len = strlen(timeStr);
+	if (len > 0) {
+		// Get rid of trailing newline
+		timeStr[len - 1] = '\0';
+	}
+
+	Json::Value doc;
+	doc["timestamp"] = wallClockTimeUsec / 1000000.0;
+	doc["local"] = timeStr;
+	if (t > monoNow) {
+		doc["relative_timestamp"] = (t - monoNow) / 1000000.0;
+		doc["relative"] = distanceOfTimeInWords(t / 1000000ull, monoNow / 1000000ull) + " from now";
+	} else {
+		doc["relative_timestamp"] = (monoNow - t) / -1000000.0;
+		doc["relative"] = distanceOfTimeInWords(t / 1000000ull, monoNow / 1000000ull) + " ago";
+	}
+	return doc;
+}
+
 inline Json::Value
 durationToJson(unsigned long long duration) {
 	Json::Value doc;


tautometer

tautometer


needed for HAVE_MEMMEM

needed for HAVE_MEMMEM

git-svn-id: d3d46767b8f15aa15dc28b4413db96165ce057f7@7959 140774ce-b5e7-0310-ab8b-a85725594a96

--- src/daemon/https/tls/gnutls_global.h
+++ src/daemon/https/tls/gnutls_global.h
@@ -25,6 +25,7 @@
 #ifndef GNUTLS_GLOBAL_H
 #define GNUTLS_GLOBAL_H

+#include "MHD_config.h"
 #include <libtasn1.h>

 /* this mutex is used to synchronize threads attempting to call MHD__gnutls_global_init / MHD__gnutls_global_deinit */


overdoor

overdoor


irresistible

irresistible


imbibitional

imbibitional


restively

restively


colpindach

colpindach


feat<stream_decompressor>: declare class StreamDecompressor

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

--- src/decompress/stream_decompressor.h
+++ src/decompress/stream_decompressor.h
@@ -0,0 +1,42 @@
+#ifndef STREAM_DECOMPRESSOR_H
+#define STREAM_DECOMPRESSOR_H
+
+#include <nan.h>
+
+#define ZSTD_STATIC_LINKING_ONLY
+#include "zstd.h"
+#include "stream_coder.h"
+
+namespace ZSTD_NODE {
+
+  using Nan::Persistent;
+
+  using v8::Function;
+  using v8::Object;
+  using v8::Local;
+
+  class StreamDecompressor : public StreamCoder {
+  public:
+    friend class StreamDecompressWorker;
+    static NAN_MODULE_INIT(Init);
+
+  private:
+    explicit StreamDecompressor(Local<Object> userParams);
+    ~StreamDecompressor();
+
+    static NAN_METHOD(New);
+    static NAN_METHOD(GetBlockSize);
+    static NAN_METHOD(Copy);
+    static NAN_METHOD(Decode);
+
+    static inline Persistent<Function>& constructor();
+
+    ZSTD_DStream *zds;
+    size_t inputSize;
+    void *input;
+    void *dict;
+  };
+
+}
+
+#endif


distalwards

distalwards


Perseid

Perseid


heartease

heartease


gumbotil

gumbotil


Damianist

Damianist


unexplosive

unexplosive


unpersonableness

unpersonableness


Apply the listener position to the transformation matrix

--- Alc/ALu.c
+++ Alc/ALu.c
@@ -116,6 +116,49 @@
     vector[2] = temp[0]*matrix[0][2] + temp[1]*matrix[1][2] + temp[2]*matrix[2][2] + temp[3]*matrix[3][2];
 }

+
+static ALvoid CalcListenerParams(ALlistener *Listener)
+{
+    ALfloat N[3], V[3], U[3], P[3];
+
+    /* AT then UP */
+    N[0] = Listener->Forward[0];
+    N[1] = Listener->Forward[1];
+    N[2] = Listener->Forward[2];
+    aluNormalize(N);
+    V[0] = Listener->Up[0];
+    V[1] = Listener->Up[1];
+    V[2] = Listener->Up[1];
+    aluNormalize(V);
+    /* Build and normalize right-vector */
+    aluCrossproduct(N, V, U);
+    aluNormalize(U);
+
+    Listener->Params.Matrix[0][0] =  U[0];
+    Listener->Params.Matrix[0][1] =  V[0];
+    Listener->Params.Matrix[0][2] = -N[0];
+    Listener->Params.Matrix[0][3] =  0.0f;
+    Listener->Params.Matrix[1][0] =  U[1];
+    Listener->Params.Matrix[1][1] =  V[1];
+    Listener->Params.Matrix[1][2] = -N[1];
+    Listener->Params.Matrix[1][3] =  0.0f;
+    Listener->Params.Matrix[2][0] =  U[2];
+    Listener->Params.Matrix[2][1] =  V[2];
+    Listener->Params.Matrix[2][2] = -N[2];
+    Listener->Params.Matrix[2][3] =  0.0f;
+    Listener->Params.Matrix[3][0] =  0.0f;
+    Listener->Params.Matrix[3][1] =  0.0f;
+    Listener->Params.Matrix[3][2] =  0.0f;
+    Listener->Params.Matrix[3][3] =  1.0f;
+
+    P[0] = Listener->Position[0];
+    P[1] = Listener->Position[1];
+    P[2] = Listener->Position[2];
+    aluMatrixVector(P, 1.0f, Listener->Params.Matrix);
+    Listener->Params.Matrix[3][0] = -P[0];
+    Listener->Params.Matrix[3][1] = -P[1];
+    Listener->Params.Matrix[3][2] = -P[2];
+}

 ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
 {
@@ -503,11 +546,6 @@
     /* Transform source to listener space (convert to head relative) */
     if(ALSource->HeadRelative == AL_FALSE)
     {
-        /* Translate position */
-        Position[0] -= ALContext->Listener->Position[0];
-        Position[1] -= ALContext->Listener->Position[1];
-        Position[2] -= ALContext->Listener->Position[2];
-
         /* Transform source vectors */
         aluMatrixVector(Position, 1.0f, Matrix);
         aluMatrixVector(Direction, 0.0f, Matrix);
@@ -911,39 +949,7 @@
                 UpdateSources = ExchangeInt(&ctx->UpdateSources, AL_FALSE);

             if(UpdateSources)
-            {
-                ALlistener *listener = ctx->Listener;
-                ALfloat N[3], V[3], U[3];
-                /* AT then UP */
-                N[0] = listener->Forward[0];
-                N[1] = listener->Forward[1];
-                N[2] = listener->Forward[2];
-                aluNormalize(N);
-                V[0] = listener->Up[0];
-                V[1] = listener->Up[1];
-                V[2] = listener->Up[1];
-                aluNormalize(V);
-                /* Build and normalize right-vector */
-                aluCrossproduct(N, V, U);
-                aluNormalize(U);
-
-                listener->Params.Matrix[0][0] =  U[0];
-                listener->Params.Matrix[0][1] =  V[0];
-                listener->Params.Matrix[0][2] = -N[0];
-                listener->Params.Matrix[0][3] =  0.0f;
-                listener->Params.Matrix[1][0] =  U[1];
-                listener->Params.Matrix[1][1] =  V[1];
-                listener->Params.Matrix[1][2] = -N[1];
-                listener->Params.Matrix[1][3] =  0.0f;
-                listener->Params.Matrix[2][0] =  U[2];
-                listener->Params.Matrix[2][1] =  V[2];
-                listener->Params.Matrix[2][2] = -N[2];
-                listener->Params.Matrix[2][3] =  0.0f;
-                listener->Params.Matrix[3][0] =  0.0f;
-                listener->Params.Matrix[3][1] =  0.0f;
-                listener->Params.Matrix[3][2] =  0.0f;
-                listener->Params.Matrix[3][3] =  1.0f;
-            }
+                CalcListenerParams(ctx->Listener);

             /* source processing */
             src = ctx->ActiveSources;


Use the panning algorithms to build the multi-channel source matrix This prevents the stereo-duplication option from working. It should hopefully be restored soon.

--- Alc/ALu.c
+++ Alc/ALu.c
@@ -78,17 +78,20 @@

 ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
 {
+    ALCdevice *Device = ALContext->Device;
     ALfloat SourceVolume,ListenerGain,MinVolume,MaxVolume;
     ALbufferlistitem *BufferListItem;
     enum DevFmtChannels DevChans;
     enum FmtChannels Channels;
-    ALfloat SrcMatrix[MAXCHANNELS][MAXCHANNELS];
+    ALfloat (*SrcMatrix)[MAXCHANNELS];
     ALfloat DryGain, DryGainHF;
     ALfloat WetGain[MAX_SENDS];
     ALfloat WetGainHF[MAX_SENDS];
     ALint NumSends, Frequency;
+    const ALfloat *SpeakerGain;
     ALfloat Pitch;
     ALfloat cw;
+    ALuint pos;
     ALint i;

     /* Get device properties */
@@ -149,6 +152,7 @@
             break;
     }

+    SrcMatrix = ALSource->Params.DryGains;
     for(i = 0;i < MAXCHANNELS;i++)
     {
         ALuint i2;
@@ -172,12 +176,21 @@
             }
         }
         else
-            SrcMatrix[0][FRONT_CENTER] = DryGain * ListenerGain;
+        {
+            pos = aluCart2LUTpos(cos(0.0), sin(0.0));
+            SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos];
+
+            for(i = 0;i < (ALint)Device->NumChan;i++)
+            {
+                Channel chan = Device->Speaker2Chan[i];
+                SrcMatrix[0][chan] = DryGain * ListenerGain * SpeakerGain[chan];
+            }
+        }
         break;
     case FmtStereo:
         if((ALContext->Device->Flags&DEVICE_USE_HRTF))
         {
-            ALfloat angles[2] = { -30.0f, 30.0f };
+            static const ALfloat angles[2] = { -30.0f, 30.0f };
             ALint c;

             for(c = 0;c < 2;c++)
@@ -194,47 +207,23 @@
                 }
             }
         }
-        else if(!(ALContext->Device->Flags&DEVICE_DUPLICATE_STEREO))
-        {
-            SrcMatrix[0][FRONT_LEFT]  = DryGain * ListenerGain;
-            SrcMatrix[1][FRONT_RIGHT] = DryGain * ListenerGain;
-        }
         else
         {
-            switch(DevChans)
-            {
-            case DevFmtMono:
-            case DevFmtStereo:
-                SrcMatrix[0][FRONT_LEFT]  = DryGain * ListenerGain;
-                SrcMatrix[1][FRONT_RIGHT] = DryGain * ListenerGain;
-                break;
-
-            case DevFmtQuad:
-            case DevFmtX51:
-                DryGain *= aluSqrt(2.0f/4.0f);
-                SrcMatrix[0][FRONT_LEFT]  = DryGain * ListenerGain;
-                SrcMatrix[1][FRONT_RIGHT] = DryGain * ListenerGain;
-                SrcMatrix[0][BACK_LEFT]   = DryGain * ListenerGain;
-                SrcMatrix[1][BACK_RIGHT]  = DryGain * ListenerGain;
-                break;
-
-            case DevFmtX61:
-                DryGain *= aluSqrt(2.0f/4.0f);
-                SrcMatrix[0][FRONT_LEFT]  = DryGain * ListenerGain;
-                SrcMatrix[1][FRONT_RIGHT] = DryGain * ListenerGain;
-                SrcMatrix[0][SIDE_LEFT]   = DryGain * ListenerGain;
-                SrcMatrix[1][SIDE_RIGHT]  = DryGain * ListenerGain;
-                break;
-
-            case DevFmtX71:
-                DryGain *= aluSqrt(2.0f/6.0f);
-                SrcMatrix[0][FRONT_LEFT]  = DryGain * ListenerGain;
-                SrcMatrix[1][FRONT_RIGHT] = DryGain * ListenerGain;
-                SrcMatrix[0][BACK_LEFT]   = DryGain * ListenerGain;
-                SrcMatrix[1][BACK_RIGHT]  = DryGain * ListenerGain;
-                SrcMatrix[0][SIDE_LEFT]   = DryGain * ListenerGain;
-                SrcMatrix[1][SIDE_RIGHT]  = DryGain * ListenerGain;
-                break;
+            static const ALfloat angles[2] = { -30.0f, 30.0f };
+            ALint c;
+
+            for(c = 0;c < 2;c++)
+            {
+                pos = aluCart2LUTpos(cos(angles[c] * (M_PI/180.0)),
+                                     sin(angles[c] * (M_PI/180.0)));
+                SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos];
+
+                for(i = 0;i < (ALint)Device->NumChan;i++)
+                {
+                    Channel chan = Device->Speaker2Chan[i];
+                    SrcMatrix[c][chan] = DryGain * ListenerGain *
+                                         SpeakerGain[chan];
+                }
             }
         }
         break;
@@ -242,7 +231,7 @@
     case FmtRear:
         if((ALContext->Device->Flags&DEVICE_USE_HRTF))
         {
-            ALfloat angles[2] = { -150.0f, 150.0f };
+            static const ALfloat angles[2] = { -150.0f, 150.0f };
             ALint c;

             for(c = 0;c < 2;c++)
@@ -261,15 +250,29 @@
         }
         else
         {
-            SrcMatrix[0][BACK_LEFT]  = DryGain * ListenerGain;
-            SrcMatrix[1][BACK_RIGHT] = DryGain * ListenerGain;
+            static const ALfloat angles[2] = { -150.0f, 150.0f };
+            ALint c;
+
+            for(c = 0;c < 2;c++)
+            {
+                pos = aluCart2LUTpos(cos(angles[c] * (M_PI/180.0)),
+                                     sin(angles[c] * (M_PI/180.0)));
+                SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos];
+
+                for(i = 0;i < (ALint)Device->NumChan;i++)
+                {
+                    Channel chan = Device->Speaker2Chan[i];
+                    SrcMatrix[c][chan] = DryGain * ListenerGain *
+                                         SpeakerGain[chan];
+                }
+            }
         }
         break;

     case FmtQuad:
         if((ALContext->Device->Flags&DEVICE_USE_HRTF))
         {
-            ALfloat angles[4] = { -45.0f, 45.0f, -135.0f, 135.0f };
+            static const ALfloat angles[4] = { -45.0f, 45.0f, -135.0f, 135.0f };
             ALint c;

             for(c = 0;c < 4;c++)
@@ -288,17 +291,30 @@
         }
         else
         {
-            SrcMatrix[0][FRONT_LEFT]  = DryGain * ListenerGain;
-            SrcMatrix[1][FRONT_RIGHT] = DryGain * ListenerGain;
-            SrcMatrix[2][BACK_LEFT]   = DryGain * ListenerGain;
-            SrcMatrix[3][BACK_RIGHT]  = DryGain * ListenerGain;
+            static const ALfloat angles[4] = { -45.0f, 45.0f, -135.0f, 135.0f };
+            ALint c;
+
+            for(c = 0;c < 4;c++)
+            {
+                pos = aluCart2LUTpos(cos(angles[c] * (M_PI/180.0)),
+                                     sin(angles[c] * (M_PI/180.0)));
+                SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos];
+
+                for(i = 0;i < (ALint)Device->NumChan;i++)
+                {
+                    Channel chan = Device->Speaker2Chan[i];
+                    SrcMatrix[c][chan] = DryGain * ListenerGain *
+                                         SpeakerGain[chan];
+                }
+            }
         }
         break;

     case FmtX51:
         if((ALContext->Device->Flags&DEVICE_USE_HRTF))
         {
-            ALfloat angles[6] = { -30.0f, 30.0f, 0.0f, 0.0f, -110.0f, 110.0f };
+            static const ALfloat angles[6] = { -30.0f, 30.0f, 0.0f, 0.0f,
+                                               -110.0f, 110.0f };
             ALint c;

             for(c = 0;c < 6;c++)
@@ -317,20 +333,36 @@
         }
         else
         {
-            SrcMatrix[0][FRONT_LEFT]   = DryGain * ListenerGain;
-            SrcMatrix[1][FRONT_RIGHT]  = DryGain * ListenerGain;
-            SrcMatrix[2][FRONT_CENTER] = DryGain * ListenerGain;
-            SrcMatrix[3][LFE]          = DryGain * ListenerGain;
-            SrcMatrix[4][BACK_LEFT]    = DryGain * ListenerGain;
-            SrcMatrix[5][BACK_RIGHT]   = DryGain * ListenerGain;
+            static const ALfloat angles[6] = { -30.0f, 30.0f, 0.0f, 0.0f,
+                                               -110.0f, 110.0f };
+            ALint c;
+
+            for(c = 0;c < 6;c++)
+            {
+                if(c == 3) /* Special-case LFE */
+                {
+                    SrcMatrix[3][LFE] = DryGain * ListenerGain;
+                    continue;
+                }
+                pos = aluCart2LUTpos(cos(angles[c] * (M_PI/180.0)),
+                                     sin(angles[c] * (M_PI/180.0)));
+                SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos];
+
+                for(i = 0;i < (ALint)Device->NumChan;i++)
+                {
+                    Channel chan = Device->Speaker2Chan[i];
+                    SrcMatrix[c][chan] = DryGain * ListenerGain *
+                                         SpeakerGain[chan];
+                }
+            }
         }
         break;

     case FmtX61:
         if((ALContext->Device->Flags&DEVICE_USE_HRTF))
         {
-            ALfloat angles[7] = { -30.0f, 30.0f, 0.0f, 0.0f,
-                                  -90.0f, 90.0f, 180.0f };
+            static const ALfloat angles[7] = { -30.0f, 30.0f, 0.0f, 0.0f,
+                                               180.0f, -90.0f, 90.0f };
             ALint c;

             for(c = 0;c < 7;c++)
@@ -349,21 +381,36 @@
         }
         else
         {
-            SrcMatrix[0][FRONT_LEFT]   = DryGain * ListenerGain;
-            SrcMatrix[1][FRONT_RIGHT]  = DryGain * ListenerGain;
-            SrcMatrix[2][FRONT_CENTER] = DryGain * ListenerGain;
-            SrcMatrix[3][LFE]          = DryGain * ListenerGain;
-            SrcMatrix[4][BACK_CENTER]  = DryGain * ListenerGain;
-            SrcMatrix[5][SIDE_LEFT]    = DryGain * ListenerGain;
-            SrcMatrix[6][SIDE_RIGHT]   = DryGain * ListenerGain;
+            static const ALfloat angles[7] = { -30.0f, 30.0f, 0.0f, 0.0f,
+                                               180.0f, -90.0f, 90.0f };
+            ALint c;
+
+            for(c = 0;c < 7;c++)
+            {
+                if(c == 3) /* Special-case LFE */
+                {
+                    SrcMatrix[3][LFE] = DryGain * ListenerGain;
+                    continue;
+                }
+                pos = aluCart2LUTpos(cos(angles[c] * (M_PI/180.0)),
+                                     sin(angles[c] * (M_PI/180.0)));
+                SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos];
+
+                for(i = 0;i < (ALint)Device->NumChan;i++)
+                {
+                    Channel chan = Device->Speaker2Chan[i];
+                    SrcMatrix[c][chan] = DryGain * ListenerGain *
+                                         SpeakerGain[chan];
+                }
+            }
         }
         break;

     case FmtX71:
         if((ALContext->Device->Flags&DEVICE_USE_HRTF))
         {
-            ALfloat angles[8] = { -30.0f, 30.0f, 0.0f, 0.0f,
-                                  -90.0f, 90.0f, -110.0f, 110.0f };
+            static const ALfloat angles[8] = {-30.0f, 30.0f, 0.0f, 0.0f,
+                                              -110.0f, 110.0f, -90.0f, 90.0f};
             ALint c;

             for(c = 0;c < 8;c++)
@@ -382,37 +429,30 @@
         }
         else
         {
-            SrcMatrix[0][FRONT_LEFT]   = DryGain * ListenerGain;
-            SrcMatrix[1][FRONT_RIGHT]  = DryGain * ListenerGain;
-            SrcMatrix[2][FRONT_CENTER] = DryGain * ListenerGain;
-            SrcMatrix[3][LFE]          = DryGain * ListenerGain;
-            SrcMatrix[4][BACK_LEFT]    = DryGain * ListenerGain;
-            SrcMatrix[5][BACK_RIGHT]   = DryGain * ListenerGain;
-            SrcMatrix[6][SIDE_LEFT]    = DryGain * ListenerGain;
-            SrcMatrix[7][SIDE_RIGHT]   = DryGain * ListenerGain;
+            static const ALfloat angles[8] = {-30.0f, 30.0f, 0.0f, 0.0f,
+                                              -110.0f, 110.0f, -90.0f, 90.0f};
+            ALint c;
+
+            for(c = 0;c < 8;c++)
+            {
+                if(c == 3) /* Special-case LFE */
+                {
+                    SrcMatrix[3][LFE] = DryGain * ListenerGain;
+                    continue;
+                }
+                pos = aluCart2LUTpos(cos(angles[c] * (M_PI/180.0)),
+                                     sin(angles[c] * (M_PI/180.0)));
+                SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos];
+
+                for(i = 0;i < (ALint)Device->NumChan;i++)
+                {
+                    Channel chan = Device->Speaker2Chan[i];
+                    SrcMatrix[c][chan] = DryGain * ListenerGain *
+                                         SpeakerGain[chan];
+                }
+            }
         }
         break;
-    }
-    if(!(ALContext->Device->Flags&DEVICE_USE_HRTF))
-    {
-        for(i = 0;i < MAXCHANNELS;i++)
-        {
-            ALuint j, k;
-            for(j = 0;j < MAXCHANNELS;j++)
-            {
-                ALfloat (*DevMatrix)[MAXCHANNELS] = ALContext->Device->ChannelMatrix;
-                ALSource->Params.DryGains[i][j] = 0.0f;
-                for(k = 0;k < MAXCHANNELS;k++)
-                {
-                    /* Matrix mult: O[i][j] += A[i][k] * B[k][j]
-                     * However, our device matrix is transposed, so we do:
-                     * O[i][j] += A[i][k] * B[j][k]
-                     */
-                    ALSource->Params.DryGains[i][j] += SrcMatrix[i][k] *
-                                                       DevMatrix[j][k];
-                }
-            }
-        }
     }

     for(i = 0;i < NumSends;i++)


tweak ShallowCopyRequestContextScopeGuard ctor

Summary: DRY the `ShallowCopyRequestContextScopeGuard` ctor taking multiple items.

Differential Revision: D27698685

fbshipit-source-id: 7f23305855918c4248da11c15e5fab839592d372

--- folly/io/async/Request.h
+++ folly/io/async/Request.h
@@ -419,20 +419,10 @@
    * Accepts iterators to a container of <string/RequestToken, RequestData
    * pointer> pairs
    */
-  template <typename... TItems>
+  template <typename... Item>
   explicit ShallowCopyRequestContextScopeGuard(
-      RequestDataItem&& first, TItems&&... rest)
-      : ShallowCopyRequestContextScopeGuard() {
-    auto rc = RequestContext::get();
-    auto overwriteContextData = [&rc](RequestDataItem&& item) {
-      rc->overwriteContextData(item.first, std::move(item.second), true);
-    };
-
-    overwriteContextData(std::move(first));
-
-    using _ = int[];
-    void(_{0, (void(overwriteContextData(std::forward<TItems>(rest))), 0)...});
-  }
+      RequestDataItem&& first, Item&&... rest)
+      : ShallowCopyRequestContextScopeGuard(MultiTag{}, first, rest...) {}

   ~ShallowCopyRequestContextScopeGuard() {
     RequestContext::setContext(std::move(prev_));
@@ -448,6 +438,19 @@
       ShallowCopyRequestContextScopeGuard&&) = delete;

  private:
+  struct MultiTag {};
+  template <typename... Item>
+  explicit ShallowCopyRequestContextScopeGuard(MultiTag, Item&... item)
+      : ShallowCopyRequestContextScopeGuard() {
+    auto rc = RequestContext::get();
+    auto go = [&](RequestDataItem& i) {
+      rc->overwriteContextData(i.first, std::move(i.second), true);
+    };
+
+    using _ = int[];
+    void(_{0, (go(item), 0)...});
+  }
+
   std::shared_ptr<RequestContext> prev_;
 };


Combine duplicate lines into the mixing macro

--- Alc/ALu.c
+++ Alc/ALu.c
@@ -1170,10 +1170,10 @@
             const int chans2[] = {
                 BACK_LEFT, SIDE_LEFT, BACK_RIGHT, SIDE_RIGHT
             };
-            const ALfloat scaler = 1.0f/Channels;
             const ALfloat dupscaler = aluSqrt(1.0f/3.0f);

 #define DO_MIX(resampler) do {                                                \
+    const ALfloat scaler = 1.0f/Channels;                                     \
     while(BufferSize--)                                                       \
     {                                                                         \
         for(i = 0;i < OUTPUTCHANNELS;i++)                                     \
@@ -1223,9 +1223,9 @@
             const int chans[] = {
                 FRONT_LEFT, FRONT_RIGHT
             };
-            const ALfloat scaler = 1.0f/Channels;

 #define DO_MIX(resampler) do {                                                \
+    const ALfloat scaler = 1.0f/Channels;                                     \
     while(BufferSize--)                                                       \
     {                                                                         \
         for(i = 0;i < OUTPUTCHANNELS;i++)                                     \
@@ -1273,7 +1273,6 @@
                 FRONT_LEFT, FRONT_RIGHT,
                 BACK_LEFT,  BACK_RIGHT
             };
-            const ALfloat scaler = 1.0f/Channels;

             switch(Resampler)
             {
@@ -1295,7 +1294,6 @@
                 FRONT_CENTER, LFE,
                 BACK_LEFT,    BACK_RIGHT
             };
-            const ALfloat scaler = 1.0f/Channels;

             switch(Resampler)
             {
@@ -1318,7 +1316,6 @@
                 BACK_CENTER,
                 SIDE_LEFT,    SIDE_RIGHT
             };
-            const ALfloat scaler = 1.0f/Channels;

             switch(Resampler)
             {
@@ -1341,7 +1338,6 @@
                 BACK_LEFT,    BACK_RIGHT,
                 SIDE_LEFT,    SIDE_RIGHT
             };
-            const ALfloat scaler = 1.0f/Channels;

             switch(Resampler)
             {


deerhorn

deerhorn


antecornu

antecornu


dsync: Fixed remote syncing due to recent changes

--- src/doveadm/dsync/dsync-ibc-stream.c
+++ src/doveadm/dsync/dsync-ibc-stream.c
@@ -81,9 +81,9 @@
 	},
 	{ .name = "mailbox",
 	  .chr = 'B',
-	  .required_keys = "mailbox_lost mailbox_guid uid_validity uid_next "
+	  .required_keys = "mailbox_guid uid_validity uid_next "
 		"messages_count first_recent_uid highest_modseq",
-	  .optional_keys = "cache_fields"
+	  .optional_keys = "mailbox_lost cache_fields"
 	},
 	{ .name = "mail_change",
 	  .chr = 'C',


evacuative

evacuative


skimpiness

skimpiness


porphyrogenite

porphyrogenite


[1] Minor changes to lat/lon formats in report. [2] Tested.

--- Hazer/bin/gpstool.c
+++ Hazer/bin/gpstool.c
@@ -369,24 +369,24 @@
 		assert((0 <= minutes) && (minutes <= 59));
 		assert((0 <= seconds) && (seconds <= 59));
 		assert((0 <= hundredths) && (hundredths <= 99));
-		fprintf(fp, " %2d*%02d'%02d.%02d\"%c", degrees, minutes, seconds, hundredths, direction < 0 ? 'S' : 'N');
+		fprintf(fp, " %2d*%02d'%02d.%02d\"%c,", degrees, minutes, seconds, hundredths, direction < 0 ? 'S' : 'N');

 		hazer_format_nanodegrees2position(pa[system].lon_nanodegrees, &degrees, &minutes, &seconds, &hundredths, &direction);
 		assert((0 <= degrees) && (degrees <= 180));
 		assert((0 <= minutes) && (minutes <= 59));
 		assert((0 <= seconds) && (seconds <= 59));
 		assert((0 <= hundredths) && (hundredths <= 99));
-		fprintf(fp, ",%3d*%02d'%02d.%02d\"%c", degrees, minutes, seconds, hundredths, direction < 0 ? 'W' : 'E');
+		fprintf(fp, "%3d*%02d'%02d.%02d\"%c", degrees, minutes, seconds, hundredths, direction < 0 ? 'W' : 'E');

 		decimal = pa[system].lat_nanodegrees;
 		decimal /= 1000000000.0;
-		fprintf(fp, " %9.6lf", decimal);
+		fprintf(fp, " %10.6lf,", decimal);

 		decimal = pa[system].lon_nanodegrees;
 		decimal /= 1000000000.0;
-		fprintf(fp, ",%10.6lf", decimal);
-
-    	fprintf(fp, "%8s", "");
+		fprintf(fp, "%11.6lf", decimal);
+
+    	fprintf(fp, "%7s", "");

         fprintf(fp, " %3usecs", pa[system].ticks);


emblematicize

emblematicize


Added WeakPtr operator <

Added WeakPtr operator <

--- src/dreemchest/Base/memory/WeakPtr.h
+++ src/dreemchest/Base/memory/WeakPtr.h
@@ -74,6 +74,7 @@
 		bool				operator == ( const WeakPtr<T>& other ) const;
         bool                operator != ( T *pointer ) const;
 		bool				operator != ( const WeakPtr<T>& other ) const;
+		bool				operator < ( const WeakPtr<T>& other ) const;
     };

     // ** WeakPtr::WeakPtr
@@ -163,6 +164,13 @@
         return ( m_ptr != other.get() );
     }

+    // ** WeakPtr::operator <
+    template<typename T>
+    bool WeakPtr<T>::operator < ( const WeakPtr<T>& other ) const {
+        manageProxy();
+        return ( m_ptr < other.get() );
+    }
+
     // ** WeakPtr::setPointer
     template<typename T>
     void WeakPtr<T>::setPointer( T *pointer ) {


Prevent tckmap hang on Windows

Prevent tckmap hang on Windows

Make use of Thread::batch() to reduce the load on multi-threading queues, which can hang in heavy processing on Windows.
Related to #255.

--- src/dwi/tractography/tracking/exec.h
+++ src/dwi/tractography/tracking/exec.h
@@ -70,7 +70,7 @@
                 typename Method::Shared shared (diff_path, properties);
                 WriteKernel writer (shared, destination, properties);
                 Exec<Method> tracker (shared);
-                Thread::run_queue (Thread::multi (tracker), GeneratedTrack(), writer);
+                Thread::run_queue (Thread::multi (tracker), Thread::batch (GeneratedTrack()), writer);

               } else {

@@ -101,11 +101,11 @@

                 Thread::run_queue (
                     Thread::multi (tracker),
-                    GeneratedTrack(),
+                    Thread::batch (GeneratedTrack()),
                     writer,
-                    Streamline<value_type>(),
+                    Thread::batch (Streamline<value_type>()),
                     Thread::multi (mapper),
-                    SetDixel(),
+                    Thread::batch (SetDixel()),
                     *seeder);

               }


Closes #2227 closes[t:2227] Change the way backwards recovery works for
fcreate/fclose/fassociate/fopen.  Files that potentially do not have a full header written will never be opened

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@16238 c7de825b-a66e-492c-adef-691d508d4ae1

--- newbrt/recover.c
+++ newbrt/recover.c
@@ -375,6 +375,8 @@
     struct file_map_tuple *tuple = NULL;
     int r = file_map_find(&renv->fmap, filenum, &tuple);
     if (r == 0) {
+        struct scan_state *ss = &renv->ss;
+        assert(ss->ss == SS_BACKWARD_SAW_CKPT);
         //Must keep existing lsn.
         //The only way this should be dirty, is if its doing a file-format upgrade.
         //If not dirty, header will not be written.
@@ -582,10 +584,8 @@
     return 0;
 }

-static int toku_recover_backward_fclose (struct logtype_fclose *l, RECOVER_ENV renv) {
-    // tree open
-    char *fixedfname = fixup_fname(&l->iname);
-    internal_toku_recover_fopen_or_fcreate(renv, 0, 0, fixedfname, l->filenum, l->treeflags, 0, NULL, 0, NULL);
+static int toku_recover_backward_fclose (struct logtype_fclose *UU(l), RECOVER_ENV UU(renv)) {
+    // NO-OP
     return 0;
 }

@@ -668,8 +668,13 @@
 }

 static int toku_recover_backward_fassociate (struct logtype_fassociate *l, RECOVER_ENV renv) {
-    char *fixedfname = fixup_fname(&l->iname);
-    return internal_toku_recover_fopen_or_fcreate(renv, 0, 0, fixedfname, l->filenum, l->treeflags, 0, NULL, 0, NULL);
+    int r = 0;
+    struct scan_state *ss = &renv->ss;
+    if (ss->ss == SS_BACKWARD_SAW_CKPT_END) {
+        char *fixedfname = fixup_fname(&l->iname);
+        r = internal_toku_recover_fopen_or_fcreate(renv, 0, 0, fixedfname, l->filenum, l->treeflags, 0, NULL, 0, NULL);
+    }
+    return r;
 }

 static int toku_recover_xstillopen (struct logtype_xstillopen *UU(l), RECOVER_ENV UU(renv)) {


Guards against too much challenges

Guards against too much challenges

--- c_src/main.c
+++ c_src/main.c
@@ -85,6 +85,9 @@
     challenges_num = strtol(input_len_buf + 4, NULL, 16);
     input_len_buf[4] = '\0';
     domain_len = strtol(input_len_buf, NULL, 16);
+
+    if (challenges_num >= sizeof(challenges_lengths)/sizeof(challenges_lengths[0]))
+      return &eof_op;

     for (i = 0; i < challenges_num; i++) {
       if (!read_n_bytes(input_len_buf, 4))


<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">      <title>403 - Forbidden</title>
403 - Forbidden


corduroyed

corduroyed


pavonazzo

pavonazzo


Kelima

Kelima


xylindein

xylindein


myriadly

myriadly


Change default colors and add documentation

--- calculator.c
+++ calculator.c
@@ -43,6 +43,7 @@
     setval - set value of variable x (used when graphing mode is disabled)
     graph - enable graphing mode
     nograph - disable graphing mode
+    color - set graphing colors (or, if every color is 0, use the default)
     exit - end the program

   As an example, you can try plotting the batman curve:
@@ -155,13 +156,16 @@
     uint8_t *data;
 } Image;

-int graphColors[][3] = {{255,   0, 255},
-                         {  0, 255, 255},
-                         {255, 255,   0},
-                         {120, 100, 200},
-                         {255,   0,   0},
-                         {  0, 255,   0},
-                         {  0,   0, 255}};
+int graphColors[][3] = {{ 57, 106, 177},
+                        {218, 124,  48},
+                        { 62, 150,  81},
+                        {204,  37,  41},
+                        {107,  76, 154},
+                        {255,   0, 255},
+                        {  0, 255, 255},
+                        {255,   0,   0},
+                        {  0, 255,   0},
+                        {  0,   0, 255}};

 Associativity getAssociativity(TokenType type)
 {


Display when nothing on stack

Display when nothing on stack

--- gdb-lite/src/dump.c
+++ gdb-lite/src/dump.c
@@ -23,8 +23,13 @@
   printreg(rsp);
   printreg(rbp);

-  if (regs.rbp <= regs.rsp){
+  if (regs.rbp < regs.rsp){
     fprintf(stderr,"Error in dumping stack, invalid breakpoint?\n");
+    return;
+  }
+
+  if (regs.rbp == regs.rsp){
+    fprintf(stdout,"Nothing on the stack to dump.\n");
     return;
   }


turkeybush

turkeybush


fehlernden Parameter in log_trace_ns ergaenzt

git-svn-id: cc913a7f7b4e3b8bac01cff72f0fc87362e4d502@56 8dd45c8f-be11-0410-86c3-e0da43b70fc1

--- tntnet/framework/common/tnt/log.h
+++ tntnet/framework/common/tnt/log.h
@@ -23,7 +23,7 @@
 #define log_info_ns(ns, expr)   do { LOG4CPLUS_INFO(ns::getLogger(), expr); } while (false)
 #define log_debug_ns(ns, expr)  do { LOG4CPLUS_DEBUG(ns::getLogger(), expr); } while (false)

-#define log_trace_ns(event)  LOG4CPLUS_TRACE_METHOD(ns::getLogger(), event)
+#define log_trace_ns(ns, event)  LOG4CPLUS_TRACE_METHOD(ns::getLogger(), event)

 /// Makros zum definieren von Loggingkategorien pro Namespace


move to function

move to function

--- tool/remctl/serial/remctlclient.c
+++ tool/remctl/serial/remctlclient.c
@@ -441,6 +441,33 @@
     return 0;
 }

+int do_ping(void) {
+    remctl_serial_packet_begin(&cur_pkt,REMCTL_SERIAL_TYPE_PING);
+
+    strncpy((char*)(cur_pkt.data+cur_pkt.hdr.length),"PING",4);
+    cur_pkt.hdr.length += 4;
+
+    remctl_serial_packet_end(&cur_pkt);
+
+    if (do_send_packet(&cur_pkt) < 0) {
+        fprintf(stderr,"Failed to send packet\n");
+        return -1;
+    }
+
+    if (do_recv_packet(&cur_pkt) < 0) {
+        fprintf(stderr,"Failed to recv packet\n");
+        return -1;
+    }
+
+    if (cur_pkt.hdr.type != REMCTL_SERIAL_TYPE_PING ||
+        memcmp(cur_pkt.data,"PING",4) != 0) {
+        fprintf(stderr,"Ping failed, malformed response\n");
+        return -1;
+    }
+
+    return 0;
+}
+
 int main(int argc,char **argv) {
     if (parse_argv(argc,argv))
         return 1;
@@ -455,29 +482,9 @@
             count = repeat;

         while (count-- > 0) {
-            remctl_serial_packet_begin(&cur_pkt,REMCTL_SERIAL_TYPE_PING);
-
-            strncpy((char*)(cur_pkt.data+cur_pkt.hdr.length),"PING",4);
-            cur_pkt.hdr.length += 4;
-
-            remctl_serial_packet_end(&cur_pkt);
-
-            if (do_send_packet(&cur_pkt) < 0) {
-                fprintf(stderr,"Failed to send packet\n");
-                return 1;
-            }
-
             alarm(5);
-            if (do_recv_packet(&cur_pkt) < 0) {
-                fprintf(stderr,"Failed to recv packet\n");
-                return 1;
-            }
-
-            if (cur_pkt.hdr.type != REMCTL_SERIAL_TYPE_PING ||
-                memcmp(cur_pkt.data,"PING",4) != 0) {
-                fprintf(stderr,"Ping failed, malformed response\n");
-                return 1;
-            }
+            if (do_ping() < 0)
+                break;

             printf("Ping OK\n");
         }


Fix error reporting in the gif loader

Fix error reporting in the gif loader

svn path=/trunk/; revision=17197

--- gdk-pixbuf/io-gif.c
+++ gdk-pixbuf/io-gif.c
@@ -1530,7 +1530,7 @@
 	GifContext *context = (GifContext *) data;
         gboolean retval = TRUE;

-        if (context->state != GIF_DONE) {
+        if (context->state != GIF_DONE || context->animation->frames == NULL) {
                 g_set_error (error,
                              GDK_PIXBUF_ERROR,
                              GDK_PIXBUF_ERROR_CORRUPT_IMAGE,


cryptogamic

cryptogamic


Compare bits from correct end of byte

Compare bits from correct end of byte

--- nhrp/nhrp_peer.c
+++ nhrp/nhrp_peer.c
@@ -53,7 +53,7 @@
 			return r;
 	}
 	if (bits != 0) {
-		mask = 0xff >> (8 - r);
+		mask = (0xff << (8 - r)) & 0xff;
 		return ((int) (a[bytes] & mask)) - ((int) (b[bytes] & mask));
 	}
 	return 0;