Restructured to use gdk_pixbuf_new instead of manually allocating image

	* io-png.c (gdk_pixbuf__png_image_load): Restructured to use
	gdk_pixbuf_new instead of manually allocating image storage. This
	gives us a good rowstride and overflow checks.  (#77807)

--- gdk-pixbuf/io-png.c
+++ gdk-pixbuf/io-png.c
@@ -200,13 +200,6 @@
          */
 }

-/* Destroy notification function for the pixbuf */
-static void
-free_buffer (guchar *pixels, gpointer data)
-{
-	g_free (pixels);
-}
-
 static gboolean
 png_text_to_pixbuf_option (png_text   text_ptr,
                            gchar    **key,
@@ -241,16 +234,16 @@
 static GdkPixbuf *
 gdk_pixbuf__png_image_load (FILE *f, GError **error)
 {
-        GdkPixbuf *pixbuf;
+        GdkPixbuf * volatile pixbuf = NULL;
 	png_structp png_ptr;
 	png_infop info_ptr;
         png_textp text_ptr;
-	gint i, ctype, bpp;
+	gint i, ctype;
 	png_uint_32 w, h;
 	png_bytepp volatile rows = NULL;
-	guchar * volatile pixels = NULL;
         gint    num_texts;
-        gchar **options = NULL;
+        gchar *key;
+        gchar *value;

 #ifdef PNG_USER_MEM_SUPPORTED
 	png_ptr = png_create_read_struct_2 (PNG_LIBPNG_VER_STRING,
@@ -279,8 +272,8 @@
 	    	if (rows)
 		  	g_free (rows);

-		if (pixels)
-			g_free (pixels);
+		if (pixbuf)
+			g_object_unref (pixbuf);

 		png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
 		return NULL;
@@ -294,16 +287,9 @@
                 return NULL;
         }

-	if (ctype & PNG_COLOR_MASK_ALPHA)
-		bpp = 4;
-	else
-		bpp = 3;
-
-	pixels = g_try_malloc (w * h * bpp);
-	if (!pixels) {
-                /* Check error NULL, normally this would be broken,
-                 * but libpng makes me want to code defensively.
-                 */
+        pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, ctype & PNG_COLOR_MASK_ALPHA, 8, w, h);
+
+	if (!pixbuf) {
                 if (error && *error == NULL) {
                         g_set_error (error,
                                      GDK_PIXBUF_ERROR,
@@ -311,6 +297,7 @@
                                      _("Insufficient memory to load PNG file"));
                 }

+
 		png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
 		return NULL;
 	}
@@ -318,44 +305,22 @@
 	rows = g_new (png_bytep, h);

 	for (i = 0; i < h; i++)
-		rows[i] = pixels + i * w * bpp;
+		rows[i] = pixbuf->pixels + i * pixbuf->rowstride;

 	png_read_image (png_ptr, rows);
         png_read_end (png_ptr, info_ptr);

         if (png_get_text (png_ptr, info_ptr, &text_ptr, &num_texts)) {
-                options = g_new (gchar *, num_texts * 2);
                 for (i = 0; i < num_texts; i++) {
-                        png_text_to_pixbuf_option (text_ptr[i],
-                                                   options + 2*i,
-                                                   options + 2*i + 1);
+                        png_text_to_pixbuf_option (text_ptr[i], &key, &value);
+                        gdk_pixbuf_set_option (pixbuf, key, value);
+                        g_free (key);
+                        g_free (value);
                 }
         }
+
+	g_free (rows);
 	png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
-	g_free (rows);
-
-	if (ctype & PNG_COLOR_MASK_ALPHA)
-		pixbuf = gdk_pixbuf_new_from_data (pixels, GDK_COLORSPACE_RGB, TRUE, 8,
-                                                   w, h, w * 4,
-                                                   free_buffer, NULL);
-	else
-		pixbuf = gdk_pixbuf_new_from_data (pixels, GDK_COLORSPACE_RGB, FALSE, 8,
-                                                   w, h, w * 3,
-                                                   free_buffer, NULL);
-
-        if (options) {
-                for (i = 0; i < num_texts; i++) {
-                        if (pixbuf) {
-                                if (!gdk_pixbuf_set_option (pixbuf,
-                                                            options[2*i],
-                                                            options[2*i+1]))
-                                        g_warning ("Got multiple tEXt chunks for the same key.");
-                        }
-                        g_free (options[2*i]);
-                        g_free (options[2*i+1]);
-                }
-                g_free (options);
-        }

         return pixbuf;
 }


<?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


no message

no message

--- InOut/pa_blocking.c
+++ InOut/pa_blocking.c
@@ -84,10 +84,6 @@
   PA_BLOCKING_STREAM *pabs =
     (PA_BLOCKING_STREAM *) mcalloc(sizeof(PA_BLOCKING_STREAM));
   pabs->csound = csound;
-  pabs->actualBufferSampleCount = csound->GetKsmps(csound)
-    * csound->GetNchnls(csound);
-  pabs->actualBuffer = (float *)
-    mcalloc(pabs->actualBufferSampleCount * sizeof(float));
   pabs->currentIndex = 0;
   pabs->paLock = csoundCreateThreadLock(csound);
   pabs->clientLock = csoundCreateThreadLock(csound);
@@ -95,12 +91,18 @@
 #ifdef __MACH__
   maxLag =  ((int)ekr)*((maxLag + (int)ekr-1)%krate); /* Round to multiple */
 #endif
+  pabs->actualBufferSampleCount = csound->GetKsmps(csound)
+    * csound->GetNchnls(csound);
+  //pabs->actualBufferSampleCount = maxLag * csound->GetKsmps(csound);
+  pabs->actualBuffer = (float *)
+    mcalloc(pabs->actualBufferSampleCount * sizeof(float));
   memcpy(&pabs->paParameters, paParameters, sizeof(PaStreamParameters));
   csound->Message(csound,
-		  "paBlockingWriteOpen: nchnls %d sr %f maxLag %u device %d\n",
+		  "paBlockingWriteOpen: nchnls %d sr %f maxLag %u buffer samples %d device %d\n",
 		  pabs->paParameters.channelCount,
 		  csound->esr_,
 		  maxLag,
+		  pabs->actualBufferSampleCount,
 		  pabs->paParameters.device);
   paError = Pa_OpenStream(&pabs->paStream,
 			  0,
@@ -134,15 +136,15 @@
   float *paOutput = (float *)output;
   csoundWaitThreadLock(pabs->csound, pabs->paLock, 100);
   memcpy(paOutput, pabs->actualBuffer,
-	 pabs->actualBufferSampleCount*sizeof(float));
+	 pabs->actualBufferSampleCount * sizeof(float));
   csoundNotifyThreadLock(pabs->csound, pabs->clientLock);
   return paContinue;
 }

-void paBlockingWrite(PA_BLOCKING_STREAM *pabs, int bytes, MYFLT *buffer)
+void paBlockingWrite(PA_BLOCKING_STREAM *pabs, int samples, MYFLT *buffer)
 {
   size_t i;
-  for (i = 0; i < bytes; i++, pabs->currentIndex++) {
+  for (i = 0; i < samples; i++, pabs->currentIndex++) {
     pabs->actualBuffer[pabs->currentIndex] = (MYFLT) buffer[i];
     if(pabs->currentIndex >= pabs->actualBufferSampleCount) {
       csoundNotifyThreadLock(pabs->csound, pabs->paLock);


taenifuge

taenifuge


(BackgroundTask::isIdle) : Refine

(BackgroundTask::isIdle) : Refine

git-svn-id: 8c168edca3c6157a1911f01a73f2fb8eefd5ed32@3308 d15c3b8f-5b43-0410-be93-4d5a55ce2954

--- escort/src/WindowImp.h
+++ escort/src/WindowImp.h
@@ -149,7 +149,7 @@
             return state;
         }
         bool isIdle() const {
-            return state == Done && !flags;
+            return state == Done && !flags && xfered;
         }
     };


esp8266: Switch from terse error messages to normal ones.

Adds 2k to the code size.

--- esp8266/mpconfigport.h
+++ esp8266/mpconfigport.h
@@ -55,7 +55,7 @@
 #define MICROPY_CPYTHON_COMPAT      (1)
 #define MICROPY_LONGINT_IMPL        (MICROPY_LONGINT_IMPL_MPZ)
 #define MICROPY_FLOAT_IMPL          (MICROPY_FLOAT_IMPL_FLOAT)
-#define MICROPY_ERROR_REPORTING     (MICROPY_ERROR_REPORTING_TERSE)
+#define MICROPY_ERROR_REPORTING     (MICROPY_ERROR_REPORTING_NORMAL)
 #define MICROPY_STREAMS_NON_BLOCK   (1)
 #define MICROPY_MODULE_FROZEN       (1)
 #define MICROPY_MODULE_FROZEN_LEXER mp_lexer_new_from_str32


semiautomatic

semiautomatic


veuve

veuve


unmolested

unmolested


reefy

reefy


Goodbye RTL Magic Numbers

Goodbye RTL Magic Numbers

--- Kernel/rtl_driver.c
+++ Kernel/rtl_driver.c
@@ -5,17 +5,38 @@
 #include <keyboard.h>

 #define MAC_ADDRESS_LENGTH 6
-#define IOADDRESS 0xC000
-#define IRQ_ROK_REG 0x0001
-#define IRQ_TOK_REG 0x0004
+#define IOADDRESS      0xC000
+//IRQ
+#define IRQ_ROK_REG    0x0001
+#define IRQ_TOK_REG    0x0004
+
+//BUFFER
 #define RX_BUFFER_SIZE 0x2000 // 8KB
+#define TX_BUFFER_SIZE 0x2048
+
+//PIC
+#define PIC_SLAVE_ADDR 0xA0
+#define PIC_ACKNOW     0x20
+
+//REGISTERS
+#define RTL_TSAD_1     0x20
+#define RTL_TSAD_2     0x24
+#define RTL_TSAD_3     0x28
+#define RTL_TSAD_4     0x2C
+#define RTL_RVAD       0x30
+#define RTL_COMMANDER  0x37
+#define RTL_IMR        0x3C
+#define RTL_ISR        0x3E
+#define RTL_TX_CONFIG  0x40
+#define RTL_RX_CONFIG  0x44
+#define RTL_CONFIG_1   0x52

 typedef struct rtl_t{
   uint8_t rx_buffer[RX_BUFFER_SIZE];
-  uint8_t tx_buffer[2048][4];
-  uint8_t mac_addr[6];
-  uint8_t tx_num; // the number of the buffer to write. From 0 to 3
-  uint16_t rx_index;
+  uint8_t tx_buffer[TX_BUFFER_SIZE][4];
+  uint8_t mac_addr[MAC_ADDRESS_LENGTH];
+  uint8_t tx_num;      // the number of the buffer to write. From 0 to 3
+  uint16_t rx_index;   // the current receiver index.
 }rtl_t;

 static rtl_t rtl_info;
@@ -40,24 +61,24 @@
   rtl_info.rx_index = 0;

   // Initializes rtl8139.
-  _out_port_8( IOADDRESS + 0x52, 0x0);
+  _out_port_8( IOADDRESS + RTL_CONFIG_1, 0x0);
   // Software reset.
-  _out_port_8( IOADDRESS + 0x37, 0x10);
-  while( (_in_port_8(IOADDRESS + 0x17) & 0x10) ) {}
-
-  _out_port_32( IOADDRESS + 0x40, 0x03000700);
+  _out_port_8( IOADDRESS + RTL_COMMANDER, 0x10);
+  while( (_in_port_8(IOADDRESS + RTL_COMMANDER) & 0x10) ) {}
+
+  _out_port_32( IOADDRESS + RTL_TX_CONFIG, 0x03000700);
   // Set Receiver Mode.
-  _out_port_32( IOADDRESS + 0x44, 0x3f | (1 << 7));
+  _out_port_32( IOADDRESS + RTL_RX_CONFIG, 0x3f | (1 << 7));
   // Set Receiver and Transmiter buffer.
-  _out_port_32( IOADDRESS + 0x30, adrx);
-  _out_port_32( IOADDRESS + 0x20, ad1);
-  _out_port_32( IOADDRESS + 0x24, ad2);
-  _out_port_32( IOADDRESS + 0x28, ad3);
-  _out_port_32( IOADDRESS + 0x2C, ad4);
+  _out_port_32( IOADDRESS + RTL_RVAD, adrx);
+  _out_port_32( IOADDRESS + RTL_TSAD_1, ad1);
+  _out_port_32( IOADDRESS + RTL_TSAD_2, ad2);
+  _out_port_32( IOADDRESS + RTL_TSAD_3, ad3);
+  _out_port_32( IOADDRESS + RTL_TSAD_4, ad4);
   // Set interruptions.
-  _out_port_16( IOADDRESS + 0x3C , 0x000F );
+  _out_port_16( IOADDRESS + RTL_IMR , 0x000F );
   // Start Receiver and Transmiter
-  _out_port_8( IOADDRESS + 0x37, 0x0C);
+  _out_port_8( IOADDRESS + RTL_COMMANDER, 0x0C);

   get_mac();
 }
@@ -75,8 +96,6 @@
   rtl_info.mac_addr[5] = data >> 8;
 }

-uint8_t broadcast_mac[6] = { 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF };
-
 void
 send_message(Package * data) {
   uint16_t status_address = IOADDRESS + 0x10 + rtl_info.tx_num * 0x04;
@@ -109,7 +128,7 @@

 void
 rtl_irq_handler() {
-  uint16_t check_int = _in_port_16(IOADDRESS + 0x3E);
+  uint16_t check_int = _in_port_16(IOADDRESS + RTL_ISR);
   int size;
   char aux[30];

@@ -140,47 +159,20 @@
     }else{
       _out_port_16(IOADDRESS + 0x3E, IRQ_ROK_REG);
       start_rtl();
-      _out_port_8(0xA0,0x20);
+      _out_port_8(PIC_SLAVE_ADDR,PIC_ACKNOW);
       return;
     }
-    /*
-    for ( int i = 4 ; i < 10 ; i++ ){
-      size = parse_int(aux,rtl_info.rx_buffer[i],16);
-      aux[size] = 0;
-      char aux2[30];
-      int size2;
-      size2 = parse_int(aux2,rtl_info.mac_addr[pos_mac],16);
-      aux2[size2]=0;
-      if(aux[0]==aux2[0]){
-          whisp++;
-      }
-      size2=parse_int(aux2,broadcast_mac[pos_mac],16);
-      aux[size2]=0;
-      if(aux[0]==aux2[0]){
-          broad++;
-      }
-      pos_mac++;
-    }
-    if(whisp==5){
-       color_msj=0xFF69b4;
-    }
-    if(broad>3){
-       color_msj=0xFFA500;
-    }*/
+
     print_string("\n",0x000000);
     print_string("Mensaje de ",color_msj);
-    print_mac(&rtl_info.rx_buffer[10],color_msj);/*
-    for ( int i = 10 ; i < 16 ; i++ ){
-      size = parse_int(aux,rtl_info.rx_buffer[i],16);
-      aux[size] = 0;
-      print_string(aux,color_msj);
-    }*/
+    print_mac(&rtl_info.rx_buffer[10],color_msj);
+
     print_string("\n", 0xff0000);
     print_string((char *)&rtl_info.rx_buffer[MAC_ADDRESS_LENGTH * 2 + 6],color_msj);
     //print_string(&rtl_info.rx_buffer[MAC_ADDRESS_LENGTH * 2 + 6 +20],0xff0000);
     print_string("\n",0);
     restart_line();
-    _out_port_16(IOADDRESS + 0x3E, IRQ_ROK_REG);
+    _out_port_16(IOADDRESS + RTL_ISR, IRQ_ROK_REG);
     //_out_port_16(IOADDRESS + 0X37, 0x04);
     //print_debug();
     start_rtl();
@@ -195,37 +187,8 @@
     print_string(aux,0xffffff);
     print_string("\n",0xffffff);
   }
-  _out_port_8(0xA0,0x20);
-}
-
-/*
-void
-rtl_receive() {
-  int size,length;
-  char aux[30];
-  uint8_t * buf = &(rtl_info.rx_buffer[rtl_info.rx_index]);
-  uint16_t index = rtl_info.rx_index;
-
-  length = (buf[index + 4 + MAC_ADDRESS_LENGTH * 2]) + (buf[index + 4 + MAC_ADDRESS_LENGTH * 2 + 1] << 8);
-  length += 4 + MAC_ADDRESS_LENGTH * 2 + 2;
-
-  rtl_info.rx_index += length;
-  rtl_info.rx_index += 4 - rtl_info.rx_index%4;
-  rtl_info.rx_index %= RX_BUFFER_SIZE;
-
-  _out_port_16(IOADDRESS + 0x38,rtl_info.rx_index - 0x10);
-  print_string("\n", 0xff0000);
-  print_string("RECIBIDO DE:  ",0xff0000);
-  print_mac(&buf[index+ 4 + MAC_ADDRESS_LENGTH]);
-  print_string("\n", 0xff0000);
-  print_string("Longitud: ",0xffffff);
-  size = parse_int(aux, length, 10);
-  aux[size] = 0;
-  print_string(aux, 0xffffff);
-  print_string("\n", 0xff0000);
-  print_string(&buf[4 + MAC_ADDRESS_LENGTH * 2 + 2],0xff0000);
-  print_string("\n", 0xff0000);
-} */
+  _out_port_8(PIC_SLAVE_ADDR,PIC_ACKNOW);
+}

 void
 print_mac(uint8_t * mac_dir, uint32_t color){


Improvement of ticker configuration

Improvement of ticker configuration

--- libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/hal_tick.c
+++ libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/hal_tick.c
@@ -34,7 +34,7 @@
   */
 #include "hal_tick.h"

-// Enable it to measure the tick period on  ARDUINO-D2 pin (PG6)
+// 0=NO, 1=PG6 toggles at each tick
 #define DEBUG_TICK 0

 TIM_HandleTypeDef TimMasterHandle;
@@ -60,7 +60,7 @@
             // Prepare next interrupt
             __HAL_TIM_SetCompare(&TimMasterHandle, TIM_CHANNEL_2, val + HAL_TICK_DELAY);
             PreviousVal = val;
-#if DEBUG_TICK == 1
+#if DEBUG_TICK > 0
             HAL_GPIO_TogglePin(GPIOG, GPIO_PIN_6);
 #endif
         }
@@ -69,6 +69,16 @@

 // Reconfigure the HAL tick using a standard timer instead of systick.
 HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {
+    RCC_ClkInitTypeDef RCC_ClkInitStruct;
+    uint32_t PclkFreq;
+
+    // Get clock configuration
+    // Note: PclkFreq contains here the Latency (not used after)
+    HAL_RCC_GetClockConfig(&RCC_ClkInitStruct, &PclkFreq);
+
+    // Get TIM5 clock value
+    PclkFreq = HAL_RCC_GetPCLK1Freq();
+
     // Enable timer clock
     TIM_MST_RCC;

@@ -76,20 +86,16 @@
     TIM_MST_RESET_ON;
     TIM_MST_RESET_OFF;

-    // Just in case the system clock has been changed and the SystemCoreClock
-    // variable not updated...
-    SystemCoreClockUpdate();
-
-    // Note on timer clock:
-    // TIM5 input clock (TIM5CLK) is set to APB1 clock (PCLK1) x2,
-    // since APB1 prescaler is equal to 4 (see system_stm32f7xx.c).
-    // We have TIM5CLK = PCLK1*2 and PCLK1 = HCLK/4
-    // So TIM5CLK = HCLK/2 = SystemCoreClock/2
-
     // Configure time base
     TimMasterHandle.Instance = TIM_MST;
-    TimMasterHandle.Init.Period            = 0xFFFFFFFF;
-    TimMasterHandle.Init.Prescaler         = (uint32_t)((SystemCoreClock / 2) / 1000000) - 1; // 1 us tick
+    TimMasterHandle.Init.Period = 0xFFFFFFFF;
+
+    // TIMxCLK = PCLKx when the APB prescaler = 1 else TIMxCLK = 2 * PCLKx
+    if (RCC_ClkInitStruct.APB1CLKDivider == RCC_HCLK_DIV1)
+      TimMasterHandle.Init.Prescaler = (uint16_t)((PclkFreq) / 1000000) - 1; // 1 us tick
+    else
+      TimMasterHandle.Init.Prescaler = (uint16_t)((PclkFreq * 2) / 1000000) - 1; // 1 us tick
+
     TimMasterHandle.Init.ClockDivision     = 0;
     TimMasterHandle.Init.CounterMode       = TIM_COUNTERMODE_UP;
     TimMasterHandle.Init.RepetitionCounter = 0;
@@ -107,7 +113,7 @@
     __HAL_TIM_SetCompare(&TimMasterHandle, TIM_CHANNEL_2, PreviousVal + HAL_TICK_DELAY);
     __HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC2);

-#if DEBUG_TICK == 1
+#if DEBUG_TICK > 0
     __GPIOG_CLK_ENABLE();
     GPIO_InitTypeDef GPIO_InitStruct;
     GPIO_InitStruct.Pin = GPIO_PIN_6;


+ Upgraded kitsunwo project.

+ Upgraded kitsunwo project.

--- KitsuNWO/kitsunwo.h
+++ KitsuNWO/kitsunwo.h
@@ -16,9 +16,8 @@
 GDEFINE_ENUM_VALUE	(NETWORK_STATE, ENABLED	, 1);
 GDEFINE_ENUM_VALUE	(NETWORK_STATE, RUNNING	, 2);

-struct SApplication	: public ::nwol::SApplicationBase
-{
-	NWOM(::klib, SGame	,		Game			, ::nwol::GDATA_TYPE_OBJ		, "Game instance"				, "Game information is stored in this object."					);
+struct SApplication	: public ::nwol::SApplicationBase {
+	NWOM(, SApplication, ::klib, SGame,	Game, ::nwol::GDATA_TYPE_OBJ, "Game instance", "Game information is stored in this object.");
 	NWOM_REGISTRY
 		(	NWOM_NAME(Game)
 		);


unfrank

unfrank


trainband

trainband


skeeg

skeeg


suppliancy

suppliancy


pachyntic

pachyntic


stegodontine

stegodontine


After getting rid of the duplicate keys, there is no bug found by test_db_curs4

git-svn-id: 4b2652e19d8125fd9d24eff55f31fd1beb5a42e7@1075 c7de825b-a66e-492c-adef-691d508d4ae1

--- src/tests/test_db_curs4.c
+++ src/tests/test_db_curs4.c
@@ -15,8 +15,6 @@
 static enum mode {
     MODE_DEFAULT, MODE_MORE
 } mode;
-
-

 /* Primary is a map from a UID which consists of a random number followed by the current time. */

@@ -112,6 +110,14 @@
 static void create_databases (void) {
     int r;

+    memset(&nc_key, 0, sizeof(nc_key));
+    memset(&nc_data, 0, sizeof(nc_data));
+    nc_key.flags = DB_DBT_REALLOC;
+    nc_key.data = malloc(1); // Initalize it.
+    ((char*)nc_key.data)[0]=0;
+    nc_data.flags = DB_DBT_REALLOC;
+    nc_data.data = malloc(1); // Initalize it.
+
     r = db_env_create(&dbenv, 0);                                                            CKERR(r);
     r = dbenv->open(dbenv, DIR, DB_PRIVATE|DB_INIT_MPOOL|DB_CREATE, 0);                      CKERR(r);

@@ -153,11 +159,11 @@

 static void gettod (TIMESTAMP *ts) {
     static int counter=0;
-    assert(counter<127);
+    if (counter==0 && oppass==2) counter=64;
+    assert((counter&63) < 60);
     *ts = counter++;
-}
-
-static int oppass=0, opnum=0;
+    fprintf(stderr, "time=%d\n", *ts);
+}

 static void insert_person (void) {
     struct primary_key  pk;
@@ -198,6 +204,7 @@
     write_pk_to_dbt(&key, &pk);
     write_pd_to_dbt(&data, &pd);
     int r=do_put("dbp", dbp, &key, &data);   CKERR(r);
+    fprintf(stderr, "put %2d%c %s\n", pd.expiretime, pd.doesexpire?'e':' ', pd.name.name);
     // If the cursor is to the left of the current item, then increment count_items
     {
 	int compare=strcmp(namearray, nc_key.data);
@@ -229,6 +236,7 @@
     {
 	char *deleted_key = ((char*)data.data)+name_offset_in_pd_dbt();
 	int compare=strcmp(deleted_key, nc_key.data);
+	fprintf(stderr, "del %2d%c %s\n", deleted_key[-2], deleted_key[-1]?'e':' ', deleted_key);
 	if (compare>0) {
 	    //printf("%s:%d r3=%d compare=%d count=%d cacount=%d cucount=%d deleting %s cursor=%s\n", __FILE__, __LINE__, r3, compare, count_all_items, calc_n_items, cursor_count_n_items, deleted_key, (char*)nc_key.data);
 	    calc_n_items--;
@@ -255,10 +263,15 @@
     }
     r = do_cget("name_cursor", name_cursor, &nc_key, &nc_data, DB_NEXT); // an uninitialized cursor should do a DB_FIRST.
     if (r==0) {
+	//assert(strcmp(nc_key.data, ((char*)nc_data.data)+name_offset_in_pd_dbt())==0);
+	//printf("    /* equal */\n");
+	char *dt = nc_data.data;
+	assert(strcmp(nc_key.data, dt+name_offset_in_pd_dbt())==0);
+	fprintf(stderr, "crs %2d%c %s (opnum=%d)\n", dt[0], dt[1] ? 'e' : ' ', dt+2, opnum);
 	cursor_count_n_items++;
     } else if (r==DB_NOTFOUND) {
 	// Got to the end.
-	//printf("%s:%d Got to end count=%d curscount=%d\n", __FILE__, __LINE__, calc_n_items, cursor_count_n_items);
+	fprintf(stderr, "%s:%d Got to end count=%d curscount=%d\n", __FILE__, __LINE__, calc_n_items, cursor_count_n_items);
 	assert(cursor_count_n_items==calc_n_items);
 	r = do_cget("name_cursor", name_cursor, &nc_key, &nc_data, DB_FIRST);
 	//r = name_cursor->c_get(name_cursor, &nc_key, &nc_data, DB_FIRST);
@@ -266,8 +279,13 @@
 	    nc_key.data = realloc(nc_key.data, 1);
 	    ((char*)nc_key.data)[0]=0;
 	    cursor_count_n_items=0;
+	    fprintf(stderr, "crs DB_FIRST (empty)\n");
 	} else {
+	    assert(r==0);
+	    char *dt = nc_data.data;
+	    assert(strcmp(nc_key.data, dt+name_offset_in_pd_dbt())==0);
 	    cursor_count_n_items=1;
+	    fprintf(stderr, "crB %2d%c %s\n", dt[0], dt[1] ? 'e' : ' ', dt+2);
 	}
 	calc_n_items = count_all_items;
     }
@@ -315,14 +333,7 @@
 int main (int argc, const char *argv[]) {
     const char *progname=argv[0];

-    memset(&nc_key, 0, sizeof(nc_key));
-    memset(&nc_data, 0, sizeof(nc_data));
-    nc_key.flags = DB_DBT_REALLOC;
-    nc_key.data = malloc(1); // Initalize it.
-    ((char*)nc_key.data)[0]=0;
-    nc_data.flags = DB_DBT_REALLOC;
-    nc_data.data = malloc(1); // Initalize it.
-
+    do_code=0;

     mode = MODE_DEFAULT;
     argv++; argc--;
@@ -337,6 +348,7 @@

     switch (mode) {
     case MODE_DEFAULT:
+	srandom(1);
 	oppass=1;
 	system("rm -rf " DIR);
 	mkdir(DIR, 0777);
@@ -352,8 +364,10 @@

 	break;
     case MODE_MORE:
+	srandom(1);
 	oppass=2;
 	create_databases();
+	cursor_count_n_items = 0;
 	calc_n_items = count_all_items = 14;//count_entries("dbc", dbp);
 	//fprintf(stderr, "%s:%d n_items initially=%d\n", __FILE__, __LINE__, count_all_items);
 	{


supportful

supportful


phenolsulphonic

phenolsulphonic


update

update

--- M5Stack.h
+++ M5Stack.h
@@ -22,42 +22,42 @@

     LCD:
         M5.lcd.setBrightness(uint8_t brightness);
-        M5.lcd.drawPixel(int16_t x, int16_t y, uint16_t color);
-        M5.lcd.drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
-        M5.lcd.fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
-        M5.lcd.fillScreen(uint16_t color);
-        M5.lcd.drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
-        M5.lcd.drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,uint16_t color);
-        M5.lcd.fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
-        M5.lcd.fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,int16_t delta, uint16_t color);
-        M5.lcd.drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
-        M5.lcd.fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
-        M5.lcd.drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
-        M5.lcd.fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
-        M5.lcd.drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color);
-        M5.lcd.drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[], int16_t w, int16_t h),
-        M5.lcd.drawChar(uint16_t x, uint16_t y, char c, uint16_t color, uint16_t bg, uint8_t size);
-        M5.lcd.setCursor(uint16_t x0, uint16_t y0);
-        M5.lcd.setTextColor(uint16_t color);
-        M5.lcd.setTextColor(uint16_t color, uint16_t backgroundcolor);
-        M5.lcd.setTextSize(uint8_t size);
-        M5.lcd.setTextWrap(boolean w);
+        M5.Lcd.drawPixel(int16_t x, int16_t y, uint16_t color);
+        M5.Lcd.drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
+        M5.Lcd.fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
+        M5.Lcd.fillScreen(uint16_t color);
+        M5.Lcd.drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
+        M5.Lcd.drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,uint16_t color);
+        M5.Lcd.fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
+        M5.Lcd.fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,int16_t delta, uint16_t color);
+        M5.Lcd.drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
+        M5.Lcd.fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
+        M5.Lcd.drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
+        M5.Lcd.fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
+        M5.Lcd.drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color);
+        M5.Lcd.drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[], int16_t w, int16_t h),
+        M5.Lcd.drawChar(uint16_t x, uint16_t y, char c, uint16_t color, uint16_t bg, uint8_t size);
+        M5.Lcd.setCursor(uint16_t x0, uint16_t y0);
+        M5.Lcd.setTextColor(uint16_t color);
+        M5.Lcd.setTextColor(uint16_t color, uint16_t backgroundcolor);
+        M5.Lcd.setTextSize(uint8_t size);
+        M5.Lcd.setTextWrap(boolean w);

     Button:
-        M5.btnA/B/C.read();
-        M5.btnA/B/C.isPressed();
-        M5.btnA/B/C.isReleased();
-        M5.btnA/B/C.wasPressed();
-        M5.btnA/B/C.wasReleased();
-        M5.btnA/B/C.pressedFor(uint32_t ms);
-        M5.btnA/B/C.releasedFor(uint32_t ms);
-        M5.btnA/B/C.lastChange();
+        M5.BtnA/B/C.read();
+        M5.BtnA/B/C.isPressed();
+        M5.BtnA/B/C.isReleased();
+        M5.BtnA/B/C.wasPressed();
+        M5.BtnA/B/C.wasReleased();
+        M5.BtnA/B/C.pressedFor(uint32_t ms);
+        M5.BtnA/B/C.releasedFor(uint32_t ms);
+        M5.BtnA/B/C.lastChange();

     Speaker:
-        M5.speaker.tone(freq);
-        M5.speaker.tone(freq, time);
-        M5.speaker.beep();
-        M5.speaker.mute();
+        M5.Speaker.tone(uint32_t freq);
+        M5.Speaker.tone(freq, time);
+        M5.Speaker.beep();
+        M5.Speaker.mute();

  *
  * \par History:
@@ -122,3 +122,4 @@
 #define lcd Lcd

 #endif
+


sons

sons


tpm2_activatecredential: Fix an issue where in credential activation fails if ak password is set

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

--- tools/tpm2_activatecredential.c
+++ tools/tpm2_activatecredential.c
@@ -155,7 +155,7 @@
     }

     ESYS_TR key_shandle = tpm2_auth_util_get_shandle(ectx,
-                            ctx.key_ctx_obj.tr_handle,
+                            ctx.ctx_obj.tr_handle,
                             ctx.key.session);
     if (key_shandle == ESYS_TR_NONE) {
         goto out_session;


Add missing initialization for tmp_auth

Add missing initialization for tmp_auth

The lack of an initialization causes the command activatecredential to fail on a hardware TPM.

Signed-off-by: William Roberts <60148e894dabf0b83bde1d460768794cd453c455@intel.com>

--- tools/tpm2_activatecredential.c
+++ tools/tpm2_activatecredential.c
@@ -133,13 +133,17 @@
         tpm_activatecred_ctx *ctx) {

     TPM2B_DIGEST certInfoData = TPM2B_TYPE_INIT(TPM2B_DIGEST, buffer);
-    TPMS_AUTH_COMMAND tmp_auth;
+    TPMS_AUTH_COMMAND tmp_auth = {
+            .nonce = { .t = { .size = 0 } },
+            .hmac =  { .t = { .size = 0 } },
+            .sessionHandle = 0,
+            .sessionAttributes = { .val = 0 },
+    };

     ctx->password.sessionHandle = TPM_RS_PW;
     ctx->endorse_password.sessionHandle = TPM_RS_PW;
     *((UINT8 *) ((void *) &ctx->password.sessionAttributes)) = 0;
     *((UINT8 *) ((void *) &ctx->endorse_password.sessionAttributes)) = 0;
-    *((UINT8 *) ((void *) &tmp_auth.sessionAttributes)) = 0;

     TPMS_AUTH_COMMAND *cmd_session_array_password[2] = {
         &ctx->password,


mesiopulpal

mesiopulpal


clean up oggz-basetime, add comments, use oggz_run(), die politely on incorrect
usage.

git-svn-id: ed696e516b63563c8842837a624e30c98be77b3c@2031 8158c8cd-e7e1-0310-9fa4-c5954c97daef

--- src/tools/oggz-basetime.c
+++ src/tools/oggz-basetime.c
@@ -185,6 +185,11 @@
   fprintf (stderr, "--------\n");
 #endif

+  /* If this is the first data page of any track, use its timestamp
+   * as the delta by which to shift all tracks. Hence this page will
+   * get shifted to timestamp 0, and all other pages in the stream will
+   * be shifted relatively.
+   */
   if (ord->base_units == -1 && ort->nr_packets >= 3) {
     ord->base_units = oggz_tell_units (oggz);
 #ifdef DEBUG
@@ -192,6 +197,8 @@
 #endif
   }

+  /* If this is the first data page of a track, calculate the delta
+   * by which to shift all pages of this track */
   if (ord->base_units != -1 && ort->nr_packets >= 3 && ort->delta == -1) {
     oggz_get_granulerate (oggz, serialno, &gr_n, &gr_d);
     ort->delta = (ord->base_units * gr_n) / (gr_d);
@@ -220,14 +227,28 @@
 }

 int
+usage (char * progname)
+{
+  printf ("usage: %s filename\n", progname);
+  printf ("Shift timestamps on all pages such that the stream starts at 0.\n");
+}
+
+int
 main (int argc, char ** argv)
 {
+  char * progname = argv[0];
   OGGZ * oggz;
   OBData * ord;
   long n;

   if (argc < 2) {
-    printf ("usage: %s filename\n", argv[0]);
+    usage (progname);
+    return (1);
+  }
+
+  if (!strcmp (argv[1], "-h") || !strcmp (argv[1], "--help")) {
+    usage (progname);
+    return (0);
   }

   ord = or_data_new ();
@@ -239,7 +260,7 @@

   oggz_set_read_page (oggz, -1, read_page, ord);

-  while ((n = oggz_read (oggz, 1024)) > 0);
+  oggz_run (oggz);

   oggz_close (oggz);


sidle

sidle


Create the glob states

Create the glob states

--- opencog/query/PatternMatchEngine.h
+++ opencog/query/PatternMatchEngine.h
@@ -126,6 +126,23 @@
 	bool have_more;
 	std::map<Unorder, int> perm_count;
 	std::stack<std::map<Unorder, int>> perm_count_stack;
+
+	// --------------------------------------------
+	// Glob state management
+
+	// Record what sequences we are comparing now
+	typedef std::pair<PatternTermSeq, HandleSeq> GlobSeq;
+
+	// Record where the globs are (branchpoints)
+	typedef std::pair<Handle, std::pair<size_t, size_t>> GlobPos;
+	typedef std::stack<GlobPos> GlobPosStack;
+
+	// Record how many atoms have been grounded to the globs
+	typedef std::map<Handle, size_t> GlobGrd;
+
+	typedef std::pair<GlobGrd, GlobPosStack> GlobState;
+
+	std::map<GlobSeq, GlobState> glob_state;

 	// --------------------------------------------
 	// Methods and state that select the next clause to be grounded.


outparamour

outparamour


r300g: remove the CS compenstation for non-atomized states

Now there aren't any. If CS overflow occurs, the fix should go directly
before the problematic BEGIN_CS.

--- src/gallium/drivers/r300/r300_emit.c
+++ src/gallium/drivers/r300/r300_emit.c
@@ -1207,9 +1207,6 @@
         }
     }

-    /* XXX This is the compensation for the non-atomized states. */
-    dwords += 1024;
-
     return dwords;
 }


hectocotylization

hectocotylization


r600/pipe: Stop leaking context->start_compute_cs_cmd.buf on EG/CM

Found while tracking down memory leaks in VDPAU playback

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <59f39c0db42d4479a46b02d4d2bc11120e37bb44@lists.freedesktop.org>

--- src/gallium/drivers/r600/r600_pipe.c
+++ src/gallium/drivers/r600/r600_pipe.c
@@ -191,6 +191,8 @@
 	if (rctx->b.rings.dma.cs) {
 		rctx->b.ws->cs_destroy(rctx->b.rings.dma.cs);
 	}
+
+	FREE(rctx->start_compute_cs_cmd.buf);

 	r600_common_context_cleanup(&rctx->b);
 	FREE(rctx);


r600g: disable dual-src hangs evergreen for some reason.

This did work previously, so I've broken something.

Signed-off-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>

--- src/gallium/drivers/r600/r600_pipe.c
+++ src/gallium/drivers/r600/r600_pipe.c
@@ -466,7 +466,7 @@
 		return 7;

 	case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
-		return 1;
+		return 0;
 	}
 	return 0;
 }


sever

sever


svga: pass svga_compile_key by reference instead of value

Reviewed-by: Jose Fonseca <61b5a29db2c0650f7c8510f93eece059c1b09320@vmware.com>

--- src/gallium/drivers/svga/svga_tgsi.c
+++ src/gallium/drivers/svga/svga_tgsi.c
@@ -266,7 +266,7 @@
  */
 static struct svga_shader_result *
 svga_tgsi_translate(const struct svga_shader *shader,
-                    struct svga_compile_key key, unsigned unit)
+                    const struct svga_compile_key *key, unsigned unit)
 {
    struct svga_shader_result *result = NULL;
    struct svga_shader_emitter emit;
@@ -281,17 +281,17 @@

    emit.ptr = emit.buf;
    emit.unit = unit;
-   emit.key = key;
+   emit.key = *key;

    tgsi_scan_shader(shader->tokens, &emit.info);

    emit.imm_start = emit.info.file_max[TGSI_FILE_CONSTANT] + 1;

    if (unit == PIPE_SHADER_FRAGMENT)
-      emit.imm_start += key.fkey.num_unnormalized_coords;
+      emit.imm_start += key->fkey.num_unnormalized_coords;

    if (unit == PIPE_SHADER_VERTEX) {
-      emit.imm_start += key.vkey.need_prescale ? 2 : 0;
+      emit.imm_start += key->vkey.need_prescale ? 2 : 0;
    }

    emit.nr_hw_float_const =
@@ -324,7 +324,7 @@
    result->shader = shader;
    result->tokens = (const unsigned *) emit.buf;
    result->nr_tokens = (emit.ptr - emit.buf) / sizeof(unsigned);
-   memcpy(&result->key, &key, sizeof key);
+   memcpy(&result->key, key, sizeof(*key));
    result->id = UTIL_BITMASK_INVALID_INDEX;

    if (SVGA_DEBUG & DEBUG_TGSI) {
@@ -360,7 +360,7 @@
    memcpy(key.generic_remap_table, fs->generic_remap_table,
           sizeof(fs->generic_remap_table));

-   return svga_tgsi_translate(&fs->base, key, PIPE_SHADER_FRAGMENT);
+   return svga_tgsi_translate(&fs->base, &key, PIPE_SHADER_FRAGMENT);
 }

@@ -379,7 +379,7 @@
     */
    svga_remap_generics(vkey->fs_generic_inputs, key.generic_remap_table);

-   return svga_tgsi_translate(&vs->base, key, PIPE_SHADER_VERTEX);
+   return svga_tgsi_translate(&vs->base, &key, PIPE_SHADER_VERTEX);
 }


trilobite

trilobite


fix potential deadlock in lwt_unix_recv_notifications

caml_alloc_tuple may provoke a thread switch and an unfortunate
send_notification call will deadlock on notification_mutex
still being held by recv_notifications

--- src/unix/lwt_unix_stubs.c
+++ src/unix/lwt_unix_stubs.c
@@ -587,7 +587,7 @@

 value lwt_unix_recv_notifications()
 {
-  int ret, i;
+  int ret, i, current_index;
   value result;
 #if !defined(LWT_ON_WINDOWS)
   sigset_t new_mask;
@@ -616,8 +616,23 @@
     unix_error(error, "recv_notifications", Nothing);
   }
 #endif
+
+  do {
+    /*
+     release the mutex while calling caml_alloc,
+     which may call gc and switch the thread,
+     resulting in a classical deadlock,
+     when thread in question tries another send
+    */
+    current_index = notification_index;
+    lwt_unix_mutex_unlock(&notification_mutex);
+    result = caml_alloc_tuple(current_index);
+    lwt_unix_mutex_lock(&notification_mutex);
+    /* check that no new notifications appeared meanwhile (rare) */
+  }
+  while (current_index != notification_index);
+
   /* Read all pending notifications. */
-  result = caml_alloc_tuple(notification_index);
   for (i = 0; i < notification_index; i++)
     Field(result, i) = Val_long(notifications[i]);
   /* Reset the index. */


architectonics

architectonics


Bugfix

Bugfix

--- src/unpackcpa/unpackcpa.c
+++ src/unpackcpa/unpackcpa.c
@@ -189,7 +189,7 @@
     for (i = 0; i < animation->quantity; i++)
     {
         wlCpaApplyFrame(frame, animation->frames[i]);
-        sprintf(filename, "%02i.png", i);
+        sprintf(filename, "%02i.png", i + 1);
         writePng(filename, frame);
     }


hepatoduodenal

hepatoduodenal


honorableship

honorableship


America

America


elasticity

elasticity


sempstrywork

sempstrywork


recurrency

recurrency


pseudojervine

pseudojervine


setting up the test environment

setting up the test environment

--- Tests/Network_C/src/TestEnvironment.h
+++ Tests/Network_C/src/TestEnvironment.h
@@ -1,5 +1,5 @@
-#ifndef mines_h
-#define mines_h
+#ifndef TestEnvironment_h
+#define TestEnvironment_h

 #include <RL_common.h>

@@ -14,10 +14,4 @@
 Random_seed_key env_get_random_seek();
 Message env_message(const Message inMessage);

-/* Mines utility functions */
-void env_print(const char* header, RL_abstract_type* data);
-int getPosition();
-void getNextPosition(Action a);
-Reward getReward();
-
 #endif


vitals

vitals


correct type for struct array

correct type for struct array

--- nct5104d_gpio.c
+++ nct5104d_gpio.c
@@ -34,7 +34,7 @@
 	}

 /*--------  array for our GPIO banks  --------*/
-static struct nct5104d_gpio_bank_t nct5104d_gpio_bank[] = {
+static nct5104d_gpio_bank_t nct5104d_gpio_bank[] = {
 	NCT5104D_GPIO_BANK(0, 8, 0xE0),
 	NCT5104D_GPIO_BANK(1, 8, 0xE4)
 };


Azerbaijanian

Azerbaijanian


Fix warning net_helper-ml.c

Fix warning net_helper-ml.c

--- net_helper-ml.c
+++ net_helper-ml.c
@@ -548,7 +548,7 @@
 int send_to_peer(const struct nodeID *from, struct nodeID *to, const uint8_t *buffer_ptr, int buffer_size)
 {
 	msgData_cb *p;
-	int current;
+	int current, index;
 	send_params params = {0,0,0,0};

 	if (buffer_size <= 0) {
@@ -557,7 +557,7 @@
 	}

 	// if buffer is full, discard the message and return an error flag
-	int index = next_S();
+	index = next_S();
 	if (index<0) {
 		// free(buffer_ptr);
 		fprintf(stderr,"Net-helper: send buffer full\n ");
@@ -787,7 +787,7 @@
 {
   uint8_t sid[SOCKETID_SIZE];
   socketID_handle h = (socketID_handle) sid;
-  mlStringToSocketID((char *)b,h);
-  *len = strlen((char*)b) + 1;
+  mlStringToSocketID((const char *)b,h);
+  *len = strlen((const char*)b) + 1;
   return id_lookup_dup(h);
 }


sestet

sestet


rubied

rubied


sporangia

sporangia


"discontinuation"

"discontinuation"


ARC: Incorrect mm reference used in vmalloc fault handler

A vmalloc fault needs to sync up PGD/PTE entry from init_mm to current
task's "active_mm".  ARC vmalloc fault handler however was using mm.

A vmalloc fault for non user task context (actually pre-userland, from
init thread's open for /dev/console) caused the handler to deref NULL mm
(for mm->pgd)

The reasons it worked so far is amazing:

1. By default (!SMP), vmalloc fault handler uses a cached value of PGD.
   In SMP that MMU register is repurposed hence need for mm pointer deref.

2. In pre-3.12 SMP kernel, the problem triggering vmalloc didn't exist in
   pre-userland code path - it was introduced with commit 20bafb3d23d108bc
   "n_tty: Move buffers into n_tty_data"

Signed-off-by: Vineet Gupta <af669d95a4c0de051445d4cafdbb2c5c4a2838be@synopsys.com>
Cc: Gilad Ben-Yossef <27506c49d0aa0134c702962114d52970047df659@benyossef.com>
Cc: Noam Camus <5aa4b9705348d1692ae3b503c5c840c9fdcd7054@ezchip.com>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org    #3.10 and 3.11
Cc: Peter Hurley <4b8373d016f277527198385ba72fda0feb5da015@hurleysoftware.com>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>


mication

mication


distributival

distributival


protocol

protocol

--- vtrc-client-base/vtrc-client-tcp.h
+++ vtrc-client-base/vtrc-client-tcp.h
@@ -20,6 +20,10 @@

     public:

+        typedef boost::function <
+                void (const boost::system::error_code &)
+            > closure_type;
+
         client_tcp( boost::asio::io_service &ios, vtrc_client *client );
         ~client_tcp( );

@@ -27,9 +31,7 @@
                       const std::string &service );
         void async_connect( const std::string &address,
                             const std::string &service,
-                            boost::function <
-                                    void (const boost::system::error_code &)
-                                >   closure );
+                            closure_type closure );
         void on_write_error( const boost::system::error_code &err );
         void send_message( const char *data, size_t length );


downlooked

downlooked


cannabinaceous

cannabinaceous


Properly set sizes with no accounts in accounts window

pmo-trunk-r7670

--- src/hildon2/modest-accounts-window.c
+++ src/hildon2/modest-accounts-window.c
@@ -79,6 +79,8 @@
 typedef struct _ModestAccountsWindowPrivate ModestAccountsWindowPrivate;
 struct _ModestAccountsWindowPrivate {

+	GtkWidget *box;
+	GtkWidget *pannable;
 	GtkWidget *account_view;
 	GtkWidget *no_accounts_label;
 	GtkWidget *new_message_button;
@@ -228,21 +230,19 @@
 	ModestAccountsWindowPrivate *priv = NULL;
 	HildonProgram *app;
 	GdkPixbuf *window_icon;
-	GtkWidget *pannable;
-	GtkWidget *box;
 	GdkPixbuf *new_message_pixbuf;
 	GtkWidget *action_area_box;

 	self  = MODEST_ACCOUNTS_WINDOW(g_object_new(MODEST_TYPE_ACCOUNTS_WINDOW, NULL));
 	priv = MODEST_ACCOUNTS_WINDOW_GET_PRIVATE(self);

-	box = gtk_vbox_new (FALSE, 0);
+	priv->box = gtk_vbox_new (FALSE, 0);

 	priv->no_accounts_label = gtk_label_new (_("mcen_ia_noaccounts"));
 	gtk_misc_set_alignment (GTK_MISC (priv->no_accounts_label), 0.5, 0.0);
-	gtk_box_pack_start (GTK_BOX (box), priv->no_accounts_label, TRUE, TRUE, 0);
-
-	pannable = hildon_pannable_area_new ();
+	gtk_box_pack_end (GTK_BOX (priv->box), priv->no_accounts_label, TRUE, TRUE, 0);
+
+	priv->pannable = hildon_pannable_area_new ();
 	priv->account_view  = GTK_WIDGET (modest_account_view_new (modest_runtime_get_account_mgr ()));

 	action_area_box = hildon_tree_view_get_action_area_box (GTK_TREE_VIEW (priv->account_view));
@@ -260,13 +260,13 @@

 	setup_menu (self);

-	gtk_container_add (GTK_CONTAINER (pannable), priv->account_view);
-	gtk_box_pack_start (GTK_BOX (box), pannable, TRUE, TRUE, 0);
-	gtk_container_add (GTK_CONTAINER (self), box);
+	gtk_container_add (GTK_CONTAINER (priv->pannable), priv->account_view);
+	gtk_box_pack_start (GTK_BOX (priv->box), priv->pannable, TRUE, TRUE, 0);
+	gtk_container_add (GTK_CONTAINER (self), priv->box);

 	gtk_widget_show (priv->account_view);
-	gtk_widget_show (pannable);
-	gtk_widget_show (box);
+	gtk_widget_show (priv->pannable);
+	gtk_widget_show (priv->box);

 	connect_signals (MODEST_ACCOUNTS_WINDOW (self));

@@ -453,4 +453,8 @@
 	} else {
 		gtk_widget_hide (priv->no_accounts_label);
 	}
-}
+	gtk_container_child_set (GTK_CONTAINER(priv->box), priv->pannable,
+				 "expand", count > 0,
+				 "fill", count > 0,
+				 NULL);
+}


Add justification ui for message settings dialog

pmo-trunk-r6991

--- src/hildon2/modest-msg-edit-window.c
+++ src/hildon2/modest-msg-edit-window.c
@@ -3627,6 +3627,7 @@
 typedef struct _MessageSettingsHelper {
 	ModestMsgEditWindow *window;
 	GSList *priority_group;
+	GtkWidget *align_picker;
 } MessageSettingsHelper;

 static void
@@ -3695,13 +3696,42 @@
 		switch (modest_msg_edit_window_get_format (helper->window)) {
 		case MODEST_MSG_EDIT_FORMAT_TEXT:
 			hildon_picker_button_set_active (button, 0);
+			gtk_widget_set_sensitive (helper->align_picker, FALSE);
 			break;
 		case MODEST_MSG_EDIT_FORMAT_HTML:
 		default:
 			hildon_picker_button_set_active (button, 1);
+			gtk_widget_set_sensitive (helper->align_picker, TRUE);
 			break;
 		}
 	}
+}
+
+static void
+on_align_picker_value_changed (HildonPickerButton *button,
+				MessageSettingsHelper *helper)
+{
+	GtkJustification new_justify;
+	ModestMsgEditFormatState *format_state = NULL;
+
+	switch (hildon_picker_button_get_active (button)) {
+	case 1:
+		new_justify = GTK_JUSTIFY_CENTER;
+		break;
+	case 2:
+		new_justify = GTK_JUSTIFY_RIGHT;
+		break;
+	case 0:
+	default:
+		new_justify = GTK_JUSTIFY_LEFT;
+		break;
+	}
+
+	format_state = modest_msg_edit_window_get_format_state (helper->window);
+	if (format_state->justification != new_justify)
+		format_state->justification = new_justify;
+	modest_msg_edit_window_set_format_state (helper->window, format_state);
+	g_free (format_state);
 }

 static void
@@ -3715,8 +3745,10 @@
 	GtkSizeGroup *title_sizegroup, *value_sizegroup;
 	GtkWidget *format_picker;
 	GtkWidget *format_selector;
+	GtkWidget *align_selector;
 	ModestMsgEditWindowPrivate *priv;
 	MessageSettingsHelper helper = {0,};
+	ModestMsgEditFormatState *format_state = NULL;

 	g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
 	priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
@@ -3766,6 +3798,19 @@
 	gtk_widget_show_all (format_picker);
 	gtk_box_pack_start (GTK_BOX (vbox), format_picker, FALSE, FALSE, 0);

+	/* alignment selector */
+	align_selector = hildon_touch_selector_new_text ();
+	hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (align_selector), _("TD:Left"));
+	hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (align_selector), _("TD:Centered"));
+	hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (align_selector), _("TD:Right"));
+	helper.align_picker = hildon_picker_button_new (MODEST_EDITABLE_SIZE,
+						 HILDON_BUTTON_ARRANGEMENT_HORIZONTAL);
+	hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (helper.align_picker), HILDON_TOUCH_SELECTOR (align_selector));
+	modest_maemo_utils_set_hbutton_layout (title_sizegroup, value_sizegroup,
+					       _("TODO:Alignment:"), helper.align_picker);
+	gtk_widget_show_all (helper.align_picker);
+	gtk_box_pack_start (GTK_BOX (vbox), helper.align_picker, FALSE, FALSE, 0);
+
 	g_object_unref (title_sizegroup);
 	g_object_unref (value_sizegroup);

@@ -3781,21 +3826,41 @@
 		hildon_check_button_set_active (HILDON_CHECK_BUTTON (medium_toggle), TRUE);
 		break;
 	}
+
 	switch (modest_msg_edit_window_get_format (window)) {
 	case MODEST_MSG_EDIT_FORMAT_TEXT:
 		hildon_picker_button_set_active (HILDON_PICKER_BUTTON (format_picker), 0);
+		gtk_widget_set_sensitive (helper.align_picker, FALSE);
 		break;
 	case MODEST_MSG_EDIT_FORMAT_HTML:
 	default:
 		hildon_picker_button_set_active (HILDON_PICKER_BUTTON (format_picker), 1);
+		gtk_widget_set_sensitive (helper.align_picker, TRUE);
 		break;
 	}
+
+	format_state = modest_msg_edit_window_get_format_state (window);
+	switch (format_state->justification) {
+	case GTK_JUSTIFY_RIGHT:
+		hildon_picker_button_set_active (HILDON_PICKER_BUTTON (helper.align_picker), 2);
+		break;
+	case GTK_JUSTIFY_CENTER:
+		hildon_picker_button_set_active (HILDON_PICKER_BUTTON (helper.align_picker), 1);
+		break;
+	default:
+		hildon_picker_button_set_active (HILDON_PICKER_BUTTON (helper.align_picker), 0);
+		break;
+
+	}
+	g_free (format_state);

 	/* Signal connects */
 	g_signal_connect (G_OBJECT (high_toggle), "toggled", G_CALLBACK (on_priority_toggle), &helper);
 	g_signal_connect (G_OBJECT (medium_toggle), "toggled", G_CALLBACK (on_priority_toggle), &helper);
 	g_signal_connect (G_OBJECT (low_toggle), "toggled", G_CALLBACK (on_priority_toggle), &helper);
 	g_signal_connect (G_OBJECT (format_picker), "value-changed", G_CALLBACK (on_format_picker_value_changed), &helper);
+	g_signal_connect (G_OBJECT (helper.align_picker), "value-changed",
+			  G_CALLBACK (on_align_picker_value_changed), &helper);

 	gtk_dialog_run (GTK_DIALOG (dialog));


Extend the 'SparseRow' class template with 'tryAddAssign', 'trySubAssign', and 'tryMultAssign'

--- blaze/math/views/SparseRow.h
+++ blaze/math/views/SparseRow.h
@@ -535,6 +535,15 @@
    template< typename MT2, bool SO2, bool SF2, typename VT >
    friend bool tryAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );

+   template< typename MT2, bool SO2, bool SF2, typename VT >
+   friend bool tryAddAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );
+
+   template< typename MT2, bool SO2, bool SF2, typename VT >
+   friend bool trySubAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );
+
+   template< typename MT2, bool SO2, bool SF2, typename VT >
+   friend bool tryMultAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );
+
    template< typename MT2, bool SO2, bool SF2 >
    friend typename DerestrictTrait< SparseRow<MT2,SO2,SF2> >::Type
       derestrict( SparseRow<MT2,SO2,SF2>& dm );
@@ -1132,6 +1141,7 @@
 // \param rhs The right-hand side vector to be multiplied with the sparse row.
 // \return Reference to the sparse row.
 // \exception std::invalid_argument Vector sizes do not match.
+// \exception std::invalid_argument Invalid assignment to restricted matrix.
 //
 // In case the current sizes of the two vectors don't match, a \a std::invalid_argument exception
 // is thrown.
@@ -1158,9 +1168,13 @@
    if( size() != (~rhs).size() )
       throw std::invalid_argument( "Vector sizes do not match" );

+   const MultType tmp( *this * (~rhs) );
+
+   if( !tryAssign( matrix_, tmp, row_, 0UL ) )
+      throw std::invalid_argument( "Invalid assignment to restricted matrix" );
+
    typename DerestrictTrait<This>::Type left( derestrict( *this ) );

-   const MultType tmp( *this * (~rhs) );
    left.reset();
    assign( left, tmp );

@@ -2428,6 +2442,15 @@
    template< typename MT2, bool SO2, bool SF2, typename VT >
    friend bool tryAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );

+   template< typename MT2, bool SO2, bool SF2, typename VT >
+   friend bool tryAddAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );
+
+   template< typename MT2, bool SO2, bool SF2, typename VT >
+   friend bool trySubAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );
+
+   template< typename MT2, bool SO2, bool SF2, typename VT >
+   friend bool tryMultAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );
+
    template< typename MT2, bool SO2, bool SF2 >
    friend typename DerestrictTrait< SparseRow<MT2,SO2,SF2> >::Type
       derestrict( SparseRow<MT2,SO2,SF2>& dm );
@@ -2833,6 +2856,7 @@
 // \param rhs The right-hand side vector to be multiplied with the sparse row.
 // \return Reference to the sparse row.
 // \exception std::invalid_argument Vector sizes do not match.
+// \exception std::invalid_argument Invalid assignment to restricted matrix.
 //
 // In case the current sizes of the two vectors don't match, a \a std::invalid_argument exception
 // is thrown.
@@ -2857,9 +2881,13 @@
    if( size() != (~rhs).size() )
       throw std::invalid_argument( "Vector sizes do not match" );

+   const MultType tmp( *this * (~rhs) );
+
+   if( !tryAssign( matrix_, tmp, row_, 0UL ) )
+      throw std::invalid_argument( "Invalid assignment to restricted matrix" );
+
    typename DerestrictTrait<This>::Type left( derestrict( *this ) );

-   const MultType tmp( *this * (~rhs) );
    assign( left, tmp );

    BLAZE_INTERNAL_ASSERT( !IsLower<MT>::value || isLower( derestrict( matrix_ ) ), "Lower violation detected" );
@@ -3781,6 +3809,15 @@
    template< typename MT2, bool SO2, bool SF2, typename VT >
    friend bool tryAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );

+   template< typename MT2, bool SO2, bool SF2, typename VT >
+   friend bool tryAddAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );
+
+   template< typename MT2, bool SO2, bool SF2, typename VT >
+   friend bool trySubAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );
+
+   template< typename MT2, bool SO2, bool SF2, typename VT >
+   friend bool tryMultAssign( const SparseRow<MT2,SO2,SF2>& lhs, const Vector<VT,true>& rhs, size_t index );
+
    template< typename MT2, bool SO2, bool SF2 >
    friend typename DerestrictTrait< SparseRow<MT2,SO2,SF2> >::Type
       derestrict( SparseRow<MT2,SO2,SF2>& dm );
@@ -4385,6 +4422,7 @@
 // \param rhs The right-hand side vector to be multiplied with the sparse row.
 // \return Reference to the sparse row.
 // \exception std::invalid_argument Vector sizes do not match.
+// \exception std::invalid_argument Invalid assignment to restricted matrix.
 //
 // In case the current sizes of the two vectors don't match, a \a std::invalid_argument exception
 // is thrown.
@@ -4410,9 +4448,13 @@
    if( size() != (~rhs).size() )
       throw std::invalid_argument( "Vector sizes do not match" );

+   const MultType tmp( *this * (~rhs) );
+
+   if( !tryAssign( matrix_, tmp, row_, 0UL ) )
+      throw std::invalid_argument( "Invalid assignment to restricted matrix" );
+
    typename DerestrictTrait<This>::Type left( derestrict( *this ) );

-   const MultType tmp( *this * (~rhs) );
    left.reset();
    assign( left, tmp );

@@ -5328,6 +5370,96 @@

 //*************************************************************************************************
 /*! \cond BLAZE_INTERNAL */
+/*!\brief Predict invariant violations by the addition assignment of a vector to a sparse row.
+// \ingroup sparse_row
+//
+// \param lhs The target left-hand side sparse row.
+// \param rhs The right-hand side vector to be added.
+// \param index The index of the first element to be modified.
+// \return \a true in case the assignment would be successful, \a false if not.
+//
+// This function must \b NOT be called explicitly! It is used internally for the performance
+// optimized evaluation of expression templates. Calling this function explicitly might result
+// in erroneous results and/or in compilation errors. Instead of using this function use the
+// assignment operator.
+*/
+template< typename MT    // Type of the sparse matrix
+        , bool SO        // Storage order
+        , bool SF        // Symmetry flag
+        , typename VT >  // Type of the right-hand side vector
+inline bool tryAddAssign( const SparseRow<MT,SO,SF>& lhs, const Vector<VT,true>& rhs, size_t index )
+{
+   BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
+   BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.size() - index, "Invalid vector size" );
+
+   return tryAddAssign( lhs.matrix_, ~rhs, lhs.row_, index );
+}
+/*! \endcond */
+//*************************************************************************************************
+
+
+//*************************************************************************************************
+/*! \cond BLAZE_INTERNAL */
+/*!\brief Predict invariant violations by the subtraction assignment of a vector to a sparse row.
+// \ingroup sparse_row
+//
+// \param lhs The target left-hand side sparse row.
+// \param rhs The right-hand side vector to be subtracted.
+// \param index The index of the first element to be modified.
+// \return \a true in case the assignment would be successful, \a false if not.
+//
+// This function must \b NOT be called explicitly! It is used internally for the performance
+// optimized evaluation of expression templates. Calling this function explicitly might result
+// in erroneous results and/or in compilation errors. Instead of using this function use the
+// assignment operator.
+*/
+template< typename MT    // Type of the sparse matrix
+        , bool SO        // Storage order
+        , bool SF        // Symmetry flag
+        , typename VT >  // Type of the right-hand side vector
+inline bool trySubAssign( const SparseRow<MT,SO,SF>& lhs, const Vector<VT,true>& rhs, size_t index )
+{
+   BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
+   BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.size() - index, "Invalid vector size" );
+
+   return trySubAssign( lhs.matrix_, ~rhs, lhs.row_, index );
+}
+/*! \endcond */
+//*************************************************************************************************
+
+
+//*************************************************************************************************
+/*! \cond BLAZE_INTERNAL */
+/*!\brief Predict invariant violations by the multiplication assignment of a vector to a sparse row.
+// \ingroup sparse_row
+//
+// \param lhs The target left-hand side sparse row.
+// \param rhs The right-hand side vector to be multiplied.
+// \param index The index of the first element to be modified.
+// \return \a true in case the assignment would be successful, \a false if not.
+//
+// This function must \b NOT be called explicitly! It is used internally for the performance
+// optimized evaluation of expression templates. Calling this function explicitly might result
+// in erroneous results and/or in compilation errors. Instead of using this function use the
+// assignment operator.
+*/
+template< typename MT    // Type of the sparse matrix
+        , bool SO        // Storage order
+        , bool SF        // Symmetry flag
+        , typename VT >  // Type of the right-hand side vector
+inline bool tryMultAssign( const SparseRow<MT,SO,SF>& lhs, const Vector<VT,true>& rhs, size_t index )
+{
+   BLAZE_INTERNAL_ASSERT( index <= lhs.size(), "Invalid vector access index" );
+   BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.size() - index, "Invalid vector size" );
+
+   return tryMultAssign( lhs.matrix_, ~rhs, lhs.row_, index );
+}
+/*! \endcond */
+//*************************************************************************************************
+
+
+//*************************************************************************************************
+/*! \cond BLAZE_INTERNAL */
 /*!\brief Removal of all restrictions on the data access to the given sparse row.
 // \ingroup sparse_row
 //


Support interval lookup.

Support interval lookup.

--- src/vast/util/range_map.h
+++ src/vast/util/range_map.h
@@ -3,6 +3,7 @@

 #include <cassert>
 #include <map>
+#include <tuple>

 namespace vast {
 namespace util {
@@ -46,16 +47,33 @@
     return true;
   }

-  /// Retrieves a value for a given point.
+  /// Retrieves the value for a given point.
   ///
   /// @param p The point to lookup.
   ///
   /// @returns A pointer to the value associated with the half-open interval
-  /// *[a,b)* iff *a <= p < b*, and `nullptr` otherwise.
+  /// *[a,b)* if *a <= p < b* and `nullptr` otherwise.
   Value const* lookup(Point const& p) const
   {
     auto i = find(p, map_.lower_bound(p));
     return i != map_.end() ? &i->second.second : nullptr;
+  }
+
+  /// Retrieves value and interval for a given point.
+  ///
+  /// @param p The point to lookup.
+  ///
+  /// @returns A tuple with the first component holding a pointer to the value
+  /// associated with the half-open interval *[a,b)* if *a <= p < b*, and
+  /// `nullptr` otherwise. If the first component points to a valid value, then
+  /// the remaining two represent *[a,b)* and are set to *[0,0)* otherwise.
+  std::tuple<Value const*, Point, Point> find(Point const& p) const
+  {
+    auto i = find(p, map_.lower_bound(p));
+    if (i == map_.end())
+      return {nullptr, 0, 0};
+    else
+      return {&i->second.second, i->first, i->second.first};
   }

   /// Applies a function over each range and associated value.


Add trailing null bytes to a few more places.

--- Objects/bytesobject.c
+++ Objects/bytesobject.c
@@ -138,11 +138,12 @@

     if (size < alloc / 2) {
         /* Major downsize; resize down to exact size */
-        alloc = size;
+        alloc = size + 1;
     }
     else if (size < alloc) {
         /* Within allocated size; quick exit */
         ((PyBytesObject *)self)->ob_size = size;
+	((PyBytesObject *)self)->ob_bytes[size] = '\0'; /* Trailing null byte */
         return 0;
     }
     else if (size <= alloc * 1.125) {
@@ -151,10 +152,8 @@
     }
     else {
         /* Major upsize; resize up to exact size */
-        alloc = size;
-    }
-    if (alloc <= size)
         alloc = size + 1;
+    }

     sval = PyMem_Realloc(((PyBytesObject *)self)->ob_bytes, alloc);
     if (sval == NULL) {
@@ -165,7 +164,6 @@
     ((PyBytesObject *)self)->ob_bytes = sval;
     ((PyBytesObject *)self)->ob_size = size;
     ((PyBytesObject *)self)->ob_alloc = alloc;
-
     ((PyBytesObject *)self)->ob_bytes[size] = '\0'; /* Trailing null byte */

     return 0;
@@ -231,8 +229,10 @@
     size = mysize + osize;
     if (size < 0)
         return PyErr_NoMemory();
-    if (size < self->ob_alloc)
+    if (size < self->ob_alloc) {
         self->ob_size = size;
+	self->ob_bytes[self->ob_size] = '\0'; /* Trailing null byte */
+    }
     else if (PyBytes_Resize((PyObject *)self, size) < 0)
         return NULL;
     memcpy(self->ob_bytes + mysize, optr, osize);
@@ -278,8 +278,10 @@
     size = mysize * count;
     if (count != 0 && size / count != mysize)
         return PyErr_NoMemory();
-    if (size < self->ob_alloc)
+    if (size < self->ob_alloc) {
         self->ob_size = size;
+	self->ob_bytes[self->ob_size] = '\0'; /* Trailing null byte */
+    }
     else if (PyBytes_Resize((PyObject *)self, size) < 0)
         return NULL;

@@ -713,8 +715,10 @@
         }
         bytes = PyString_AS_STRING(encoded);
         size = PyString_GET_SIZE(encoded);
-        if (size < self->ob_alloc)
+        if (size < self->ob_alloc) {
             self->ob_size = size;
+	    self->ob_bytes[self->ob_size] = '\0'; /* Trailing null byte */
+	}
         else if (PyBytes_Resize((PyObject *)self, size) < 0) {
             Py_DECREF(encoded);
             return -1;


Add calls to portYIELD_FROM_ISR().

Add calls to portYIELD_FROM_ISR().

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

--- Demo/NEC_V850ES_Fx3_IAR/serial/serial.c
+++ Demo/NEC_V850ES_Fx3_IAR/serial/serial.c
@@ -218,10 +218,6 @@
 }
 /*-----------------------------------------------------------*/

-//#pragma vector=INTUD0T_vector
-//extern __interrupt void vUARTTxISRWrapper( void );
-//#pragma required=vUARTTxISRWrapper
-
 void vUARTTxISRHandler( void )
 {
 char cChar;
@@ -235,11 +231,10 @@
 	{
 		ulTxInProgress = pdFALSE;
 	}
-}
-
-//#pragma vector=INTUD0R_vector
-//extern __interrupt void vUARTRxISRWrapper( void );
-//#pragma required=vUARTRxISRWrapper
+
+	portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+}
+

 void vUARTRxISRHandler( void )
 {
@@ -248,9 +243,11 @@

 	cChar = UD0RX;
 	xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
-}
-
-
-
-
-
+
+	portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+}
+
+
+
+
+


Adding comlev fields for obcs+ptracers adjoint with OBCS_PRESCRIBE.

--- pkg/obcs/obcs_ad_check_lev1_dir.h
+++ pkg/obcs/obcs_ad_check_lev1_dir.h
@@ -67,15 +67,31 @@

 #ifdef ALLOW_OBCS_NORTH
 CADJ STORE OBNptr  = comlev1, key = ikey_dynamics
+#ifdef ALLOW_OBCS_PRESCRIBE
+CADJ STORE OBNptr0 = comlev1, key = ikey_dynamics
+CADJ STORE OBNptr1 = comlev1, key = ikey_dynamics
+#endif /* ALLOW_OBCS_PRESCRIBE */
 #endif /* ALLOW_OBCS_NORTH */
 #ifdef ALLOW_OBCS_SOUTH
 CADJ STORE OBSptr  = comlev1, key = ikey_dynamics
+#ifdef ALLOW_OBCS_PRESCRIBE
+CADJ STORE OBSptr0 = comlev1, key = ikey_dynamics
+CADJ STORE OBSptr1 = comlev1, key = ikey_dynamics
+#endif /* ALLOW_OBCS_PRESCRIBE */
 #endif /* ALLOW_OBCS_SOUTH */
 #ifdef ALLOW_OBCS_EAST
 CADJ STORE OBEptr  = comlev1, key = ikey_dynamics
+#ifdef ALLOW_OBCS_PRESCRIBE
+CADJ STORE OBEptr0 = comlev1, key = ikey_dynamics
+CADJ STORE OBEptr1 = comlev1, key = ikey_dynamics
+#endif /* ALLOW_OBCS_PRESCRIBE */
 #endif /* ALLOW_OBCS_EAST */
 #ifdef ALLOW_OBCS_WEST
 CADJ STORE OBWptr  = comlev1, key = ikey_dynamics
+#ifdef ALLOW_OBCS_PRESCRIBE
+CADJ STORE OBWptr0 = comlev1, key = ikey_dynamics
+CADJ STORE OBWptr1 = comlev1, key = ikey_dynamics
+#endif /* ALLOW_OBCS_PRESCRIBE */
 #endif /* ALLOW_OBCS_WEST */

 # endif  /* ALLOW_PTRACERS */


If we sent client "waiting for auth process" message, we crashed later.

--- src/imap-login/client-authenticate.c
+++ src/imap-login/client-authenticate.c
@@ -201,7 +201,8 @@

 	switch (reply) {
 	case SASL_SERVER_REPLY_SUCCESS:
-		timeout_remove(&client->to_auth_waiting);
+		if (client->to_auth_waiting != NULL)
+			timeout_remove(&client->to_auth_waiting);
 		if (args != NULL) {
 			if (client_handle_args(client, args, TRUE))
 				break;
@@ -212,7 +213,8 @@
 		break;
 	case SASL_SERVER_REPLY_AUTH_FAILED:
 	case SASL_SERVER_REPLY_CLIENT_ERROR:
-		timeout_remove(&client->to_auth_waiting);
+		if (client->to_auth_waiting != NULL)
+			timeout_remove(&client->to_auth_waiting);
 		if (args != NULL) {
 			if (client_handle_args(client, args, FALSE))
 				break;


<?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


virbitmaptest: test13: Refactor memory cleanup

Move scope of variables and get rid of the 'cleanup' section.

Signed-off-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

--- tests/virbitmaptest.c
+++ tests/virbitmaptest.c
@@ -670,37 +670,27 @@
 static int
 test13(const void *opaque G_GNUC_UNUSED)
 {
-    virBitmapPtr map = NULL;
     const char *strings[] = { "1234feebee", "000c0fefe" };
-    char *str = NULL;
     size_t i = 0;
-    int ret = -1;

     for (i = 0; i < G_N_ELEMENTS(strings); i++) {
-        map = virBitmapNewString(strings[i]);
-        if (!map)
-            goto cleanup;
-
-        str = virBitmapToString(map);
-        if (!str)
-            goto cleanup;
+        g_autoptr(virBitmap) map = NULL;
+        g_autofree char *str = NULL;
+
+        if (!(map = virBitmapNewString(strings[i])))
+            return -1;
+
+        if (!(str = virBitmapToString(map)))
+            return -1;

         if (STRNEQ(strings[i], str)) {
             fprintf(stderr, "\n expected bitmap string '%s' actual string "
                     "'%s'\n", strings[i], str);
-            goto cleanup;
+            return -1;
         }
-
-        VIR_FREE(str);
-        virBitmapFree(map);
-        map = NULL;
-    }
-
-    ret = 0;
- cleanup:
-    VIR_FREE(str);
-    virBitmapFree(map);
-    return ret;
+    }
+
+    return 0;
 }

 #undef TEST_MAP


Date: Wed, 9 May 2001 18:03:20 -0600
From: Peter Valchev <pvalchev@openbsd.org>
Subject: openbsd patches

- The dlsym() one is supposed to fix dynamic loading on our a.out
architectures, where prefixing of an underscore symbol is required.
Actually I don't know what kind of dynamic loading does SDL deal with,
but anyway.  You may want to make that change global, but only gcc's
preprocessor passes __ELF__, I think, so you can just add Linux or
something if you decide so.

git-svn-id: 75429ccc2030f235ccf16e6b9b7f8e83d5edd22e@167 c70aab31-4412-0410-b14c-859654838e24

--- src/video/x11/SDL_x11gl.c
+++ src/video/x11/SDL_x11gl.c
@@ -343,6 +343,9 @@
 #endif
 	handle = dlopen(path, dlopen_flags);
 	/* Catch the case where the application isn't linked with GL */
+#if defined __OpenBSD__ && !defined __ELF__
+#define dlsym(x,y) dlsym(x, "_" y)
+#endif
 	if ( (dlsym(handle, "glXChooseVisual") == NULL) && (path == NULL) ) {
 		dlclose(handle);
 		path = getenv("SDL_VIDEO_GL_DRIVER");


Yet more elaborate message for exception in __del__. Make gcc -Wall happy.

--- Objects/classobject.c
+++ Objects/classobject.c
@@ -353,10 +353,10 @@
 	init = instance_getattr1(inst, initstr);
 	if (init == NULL) {
 		err_clear();
-		if (arg != NULL && (!is_tupleobject(arg) ||
-				    gettuplesize(arg) != 0)
-		    || kw != NULL && (!is_dictobject(kw) ||
-				      getdictsize(kw) != 0)) {
+		if ((arg != NULL && (!is_tupleobject(arg) ||
+				     gettuplesize(arg) != 0))
+		    || (kw != NULL && (!is_dictobject(kw) ||
+				      getdictsize(kw) != 0))) {
 			err_setstr(TypeError,
 				   "this constructor takes no arguments");
 			DECREF(inst);
@@ -411,19 +411,32 @@
 		delstr = newstringobject("__del__");
 	if ((del = instance_getattr1(inst, delstr)) != NULL) {
 		object *res = call_object(del, (object *)NULL);
-		DECREF(del);
 		if (res == NULL) {
-			PyObject *f = sysget("stderr");
+			object *f, *t, *v, *tb;
+ 			err_fetch(&t, &v, &tb);
+			f = sysget("stderr");
 			err_clear();
 			if (f != NULL) {
-				writestring("exception in ", f);
-				writestring(PyString_AsString(
-					inst->in_class->cl_name), f);
-				writestring(".__del__() ignored\n", f);
+				writestring("Exception ", f);
+				if (t) {
+					writeobject(t, f, Py_PRINT_RAW);
+					if (v && v != None) {
+						writestring(": ", f);
+						writeobject(v, f, 0);
+					}
+				}
+				writestring(" in ", f);
+				writeobject(del, f, 0);
+				writestring(" ignored\n", f);
+				err_clear(); /* Just in case */
 			}
+			Py_XDECREF(t);
+			Py_XDECREF(v);
+			Py_XDECREF(tb);
 		}
 		else
 			DECREF(res);
+		DECREF(del);
 	}
 	/* Restore the saved exception and undo the temporary revival */
 	err_restore(error_type, error_value, error_traceback);
@@ -632,7 +645,6 @@
 	long outcome;
 	result = instance_compare1(inst, other);
 	if (result == NULL || !is_intobject(result)) {
-	error:
 		err_clear();
 		return (inst < other) ? -1 : 1;
 	}


Add docs to builder

Add docs to builder

--- DesktopEditor/doctrenderer/docbuilder.h
+++ DesktopEditor/doctrenderer/docbuilder.h
@@ -252,7 +252,9 @@
      * 2) argument
      * docbuilder.exe "--argument={\"company\":\"ONLYOFFICE\",\"product\":\"ONLYOFFICE Document Builder\"}" "path-to-script.docbuilder"
      * This set the --argument property to CDocBuilder & Run (see point 1)
-     *
+     * Using in javascript:
+     * var sCompany   = Argument["company"];
+     * var sProduct = Argument["product"];
      *
      * 3) Methods of the "builder" object cannot be called with values - js variables. If necessary, then you need to
      * wrap it in an instruction "jsValue", e.g.:


jni: there should be no JNI calls after throwing Java exception in C++ code before the controls returns back to Java

--- src/include/baselib/jni/JavaBridge.h
+++ src/include/baselib/jni/JavaBridge.h
@@ -210,60 +210,67 @@

                 const auto& environment = JniEnvironment::instance();

-                ByteArrayPtr inByteArrayPtr = nullptr;
-                ByteArrayPtr outByteArrayPtr = nullptr;
-
-                bl::om::ObjPtr< data::DataBlock > inDataBlock;
-                bl::om::ObjPtr< data::DataBlock > outDataBlock;
-
-                if( environment.isDirectByteBuffer( inJavaBuffer ) )
-                {
-                    inDataBlock = dataBlockFromDirectByteBuffer( jniEnv, inJavaBuffer );
-                }
-                else
-                {
-                    inByteArrayPtr = byteArrayPtrFromIndirectByteBuffer( environment, inJavaBuffer, JNI_ABORT );
-
-                    inDataBlock = bl::data::DataBlock::createInstance(
-                        reinterpret_cast< char* >( inByteArrayPtr.get() ),
-                        bl::numbers::safeCoerceTo< std::size_t >( environment.getByteBufferCapacity( inJavaBuffer ) )
-                        );
-                }
-
-                const DirectByteBuffer inBuffer( std::move( inDataBlock ), inJavaBuffer );
-                inBuffer.prepareForRead();
-
-                if( environment.isDirectByteBuffer( outJavaBuffer ) )
-                {
-                    outDataBlock = dataBlockFromDirectByteBuffer( jniEnv, outJavaBuffer );
-                }
-                else
-                {
-                    outByteArrayPtr = byteArrayPtrFromIndirectByteBuffer( environment, outJavaBuffer, 0 /* mode */ );
-
-                    outDataBlock = bl::data::DataBlock::createInstance(
-                        reinterpret_cast< char* >( outByteArrayPtr.get() ),
-                        bl::numbers::safeCoerceTo< std::size_t >( environment.getByteBufferCapacity( outJavaBuffer ) )
-                        );
-                }
-
-                DirectByteBuffer outBuffer( std::move( outDataBlock ), outJavaBuffer );
-                outBuffer.prepareForWrite();
-
-                const callback_t& callback = *reinterpret_cast< callback_t* >( callbackAddress );
-
-
                 std::string exceptionText;
-                try
-                {
-                    callback( inBuffer, outBuffer );
-                }
-                catch( std::exception& e )
-                {
-                    exceptionText = e.what();
-                }
-
-                outBuffer.prepareForJavaRead();
+
+                {
+                    ByteArrayPtr inByteArrayPtr = nullptr;
+                    ByteArrayPtr outByteArrayPtr = nullptr;
+
+                    bl::om::ObjPtr< data::DataBlock > inDataBlock;
+                    bl::om::ObjPtr< data::DataBlock > outDataBlock;
+
+                    if( environment.isDirectByteBuffer( inJavaBuffer ) )
+                    {
+                        inDataBlock = dataBlockFromDirectByteBuffer( jniEnv, inJavaBuffer );
+                    }
+                    else
+                    {
+                        inByteArrayPtr = byteArrayPtrFromIndirectByteBuffer( environment, inJavaBuffer, JNI_ABORT );
+
+                        inDataBlock = bl::data::DataBlock::createInstance(
+                            reinterpret_cast< char* >( inByteArrayPtr.get() ),
+                            bl::numbers::safeCoerceTo< std::size_t >( environment.getByteBufferCapacity( inJavaBuffer ) )
+                            );
+                    }
+
+                    const DirectByteBuffer inBuffer( std::move( inDataBlock ), inJavaBuffer );
+                    inBuffer.prepareForRead();
+
+                    if( environment.isDirectByteBuffer( outJavaBuffer ) )
+                    {
+                        outDataBlock = dataBlockFromDirectByteBuffer( jniEnv, outJavaBuffer );
+                    }
+                    else
+                    {
+                        outByteArrayPtr = byteArrayPtrFromIndirectByteBuffer( environment, outJavaBuffer, 0 /* mode */ );
+
+                        outDataBlock = bl::data::DataBlock::createInstance(
+                            reinterpret_cast< char* >( outByteArrayPtr.get() ),
+                            bl::numbers::safeCoerceTo< std::size_t >( environment.getByteBufferCapacity( outJavaBuffer ) )
+                            );
+                    }
+
+                    DirectByteBuffer outBuffer( std::move( outDataBlock ), outJavaBuffer );
+                    outBuffer.prepareForWrite();
+
+                    const callback_t& callback = *reinterpret_cast< callback_t* >( callbackAddress );
+
+                    try
+                    {
+                        callback( inBuffer, outBuffer );
+                    }
+                    catch( std::exception& e )
+                    {
+                        exceptionText = e.what();
+                    }
+
+                    outBuffer.prepareForJavaRead();
+                }
+
+                /*
+                 * The "throwNew()" call below throws a Java exception and it should be the last JNI call in this function
+                 * (this includes any JNI calls in any destructor in this function too).
+                 */

                 if( ! exceptionText.empty() )
                 {


testsuite: add missing error handling

testsuite: add missing error handling

If we passed an invalid argument to a test it would segfault rather than
returning an error code.

--- testsuite/testsuite.h
+++ testsuite/testsuite.h
@@ -151,6 +151,8 @@
 		arg = test_init(__start_kmod_tests, __stop_kmod_tests, argc, argv);		\
 		if (arg == 0)									\
 			return 0;								\
+		if (arg < 0)									\
+			return EXIT_FAILURE;							\
 												\
 		if (arg < argc) {								\
 			t = test_find(__start_kmod_tests, __stop_kmod_tests, argv[arg]);	\


Sample time of Thread block can't be inherited. Internally set to 2s but is is not used anywhere.

--- blocks/sfunar_createThread.c
+++ blocks/sfunar_createThread.c
@@ -190,7 +190,7 @@
  */
 static void mdlInitializeSampleTimes(SimStruct *S)
 {
-  ssSetSampleTime(S, 0, INHERITED_SAMPLE_TIME);
+  ssSetSampleTime(S, 0, 2);
   ssSetOffsetTime(S, 0, FIXED_IN_MINOR_STEP_OFFSET);

   ssSetCallSystemOutput(S,0);


puissantness

puissantness


Moved #endif to correct location.

Moved #endif to correct location.

--- Opcodes/system_call.c
+++ Opcodes/system_call.c
@@ -74,6 +74,8 @@
     }
 }

+#endif
+
 int call_system_i(CSOUND *csound, SYSTEM *p)
 {
     if (*p->ktrig <= FL(0.0)) {
@@ -100,7 +102,6 @@
       return (call_system(csound, p));
     return OK;
 }
-#endif

 #define S(x)    sizeof(x)


Kajar

Kajar


remove duplicate entrt for dust r k-rate

--- Opcodes/tl/sc_noise.c
+++ Opcodes/tl/sc_noise.c
@@ -384,8 +384,6 @@
 }

 static OENTRY scnoise_localops[] = {
-  { "dust.k",      sizeof(DUST), 0,3, "k", "kk",
-    (SUBR)dust_init, (SUBR)dust_process_krate, NULL },
   { "dust.k",     sizeof(DUST), 0,3, "k", "kk",
     (SUBR)dust_init, (SUBR)dust_process_krate, NULL },
   { "dust.a",      sizeof(DUST), 0,3, "a", "kk",


proenforcement

proenforcement


Acanthuridae

Acanthuridae


Esperanto

Esperanto


presumptive

presumptive


Include config.h in private header

Include config.h in private header

atspi-misc.c was not including config.h anywhere, resulting in HAVE_X11
not being defined, so X would not be queried when fetching the
accessibility bus address.

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

--- atspi/atspi-private.h
+++ atspi/atspi-private.h
@@ -25,6 +25,7 @@
 #ifndef _ATSPI_PRIVATE_H_
 #define _ATSPI_PRIVATE_H_

+#include <config.h>
 #include "atspi-device-listener-private.h"
 #include "atspi-event-listener-private.h"
 #include "atspi-matchrule-private.h"


exponency

exponency


doctrinization

doctrinization


Compilation warning in CreateInputs is fixed

--- PHOS/AliPHOSTrigger.h
+++ PHOS/AliPHOSTrigger.h
@@ -45,6 +45,7 @@
   AliPHOSTrigger(const AliPHOSTrigger & trig) ; // cpy ctor
   virtual ~AliPHOSTrigger();

+  using AliTriggerDetector::CreateInputs;
   virtual void    CreateInputs(); //Define trigger inputs for Central Trigger Processor
   void            Print(const Option_t * opt ="") const ;
   virtual void    Trigger() {}                   //Make PHOS trigger


coloratura

coloratura


Removed upb-generated headers from status_helper.h (#26129)

--- src/core/lib/gprpp/status_helper.h
+++ src/core/lib/gprpp/status_helper.h
@@ -22,9 +22,13 @@
 #include <grpc/support/port_platform.h>

 #include "absl/status/status.h"
-#include "google/rpc/status.upb.h"

 #include "src/core/lib/gprpp/debug_location.h"
+
+extern "C" {
+struct google_rpc_Status;
+struct upb_arena;
+}

 namespace grpc_core {


casein

casein


Use atomics for poll status to prevent tsan race complaints

--- src/core/lib/iomgr/ev_poll_posix.c
+++ src/core/lib/iomgr/ev_poll_posix.c
@@ -254,7 +254,7 @@
 #define CV_POLL_PERIOD_MS 1000
 #define CV_DEFAULT_TABLE_SIZE 16

-typedef enum status_t { INPROGRESS, COMPLETED, CANCELLED } status_t;
+typedef enum poll_status_t { INPROGRESS, COMPLETED, CANCELLED } poll_status_t;

 typedef struct poll_args {
   gpr_refcount refcount;
@@ -264,7 +264,7 @@
   int timeout;
   int retval;
   int err;
-  status_t status;
+  gpr_atm status;
 } poll_args;

 cv_fd_table g_cvfds;
@@ -1276,7 +1276,7 @@
 static void run_poll(void *arg) {
   int timeout, retval;
   poll_args *pargs = (poll_args *)arg;
-  while (pargs->status == INPROGRESS) {
+  while (gpr_atm_no_barrier_load(&pargs->status) == INPROGRESS) {
     if (pargs->timeout < 0) {
       timeout = CV_POLL_PERIOD_MS;
     } else {
@@ -1291,9 +1291,9 @@
     }
   }
   gpr_mu_lock(&g_cvfds.mu);
-  if (pargs->status == INPROGRESS) {
+  if (gpr_atm_no_barrier_load(&pargs->status) == INPROGRESS) {
     // Signal main thread that the poll completed
-    pargs->status = COMPLETED;
+    gpr_atm_no_barrier_store(&pargs->status, COMPLETED);
     gpr_cv_signal(pargs->cv);
   }
   decref_poll_args(pargs);
@@ -1345,7 +1345,7 @@
     pargs->timeout = timeout;
     pargs->retval = 0;
     pargs->err = 0;
-    pargs->status = INPROGRESS;
+    gpr_atm_no_barrier_store(&pargs->status, INPROGRESS);
     idx = 0;
     for (i = 0; i < nfds; i++) {
       if (fds[i].fd >= 0) {
@@ -1361,13 +1361,13 @@
     gpr_thd_new(&t_id, &run_poll, pargs, &opt);
     // We want the poll() thread to trigger the deadline, so wait forever here
     gpr_cv_wait(pollcv, &g_cvfds.mu, gpr_inf_future(GPR_CLOCK_MONOTONIC));
-    if (pargs->status == COMPLETED) {
+    if (gpr_atm_no_barrier_load(&pargs->status) == COMPLETED) {
       res = pargs->retval;
       errno = pargs->err;
     } else {
       res = 0;
       errno = 0;
-      pargs->status = CANCELLED;
+      gpr_atm_no_barrier_store(&pargs->status, CANCELLED);
     }
   } else {
     gpr_timespec deadline = gpr_now(GPR_CLOCK_REALTIME);
@@ -1398,7 +1398,8 @@
         fds[i].revents = POLLIN;
         if (res >= 0) res++;
       }
-    } else if (fds[i].fd >= 0 && pargs->status == COMPLETED) {
+    } else if (fds[i].fd >= 0 &&
+               gpr_atm_no_barrier_load(&pargs->status) == COMPLETED) {
       fds[i].revents = pargs->fds[idx].revents;
       idx++;
     }


Breakout of #18445 - part 1

Breakout of #18445 - part 1

--- src/core/lib/transport/transport.h
+++ src/core/lib/transport/transport.h
@@ -111,10 +111,11 @@
 // currently handling the batch).  Once a filter or transport passes control
 // of the batch to the next handler, it cannot depend on the contents of
 // this struct anymore, because the next handler may reuse it.
-typedef struct {
-  void* extra_arg;
+struct grpc_handler_private_op_data {
+  void* extra_arg = nullptr;
   grpc_closure closure;
-} grpc_handler_private_op_data;
+  grpc_handler_private_op_data() { memset(&closure, 0, sizeof(closure)); }
+};

 typedef struct grpc_transport_stream_op_batch_payload
     grpc_transport_stream_op_batch_payload;


jestmonger

jestmonger


added more arguments to Process

added more arguments to Process

--- Process.h
+++ Process.h
@@ -24,6 +24,12 @@
 	template <typename A1, typename A2, typename A3, typename A4>
 	Process(A1 a1, A2 a2, A3 a3, A4 a4) : _operator(boost::make_shared<Operator>(a1, a2, a3, a4)) {}

+	template <typename A1, typename A2, typename A3, typename A4, typename A5>
+	Process(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) : _operator(boost::make_shared<Operator>(a1, a2, a3, a4, a5)) {}
+
+	template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
+	Process(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) : _operator(boost::make_shared<Operator>(a1, a2, a3, a4, a5, a6)) {}
+
 	Operator* operator->() {

 		return _operator.get();


umbel

umbel


Updated struct version :(

Updated struct version :(

--- Core/gb.h
+++ Core/gb.h
@@ -9,7 +9,7 @@
 #include "symbol_hash.h"

-#define GB_STRUCT_VERSION 9
+#define GB_STRUCT_VERSION 10

 enum {
     GB_REGISTER_AF,


platitudinously

platitudinously


added macros for InitCsocket, maybe more stuff will go into them in the future

--- Csocket.h
+++ Csocket.h
@@ -28,7 +28,7 @@
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *
-* $Revision: 1.196 $
+* $Revision: 1.197 $
 */

 // note to compile with win32 need to link to winsock2, using gcc its -lws2_32
@@ -293,6 +293,11 @@
 {
 	WSACleanup();
 }
+#define InitCsocket InitWin32
+#define ShutdownCsocket ShutdownWin32
+#else
+#define InitCsocket (void)0
+#define ShutdownCsocket (void)0
 #endif /* _WIN32 */

 //! wrappers for FD_SET and such to work in templates.


ungroundably

ungroundably


carnate

carnate


"underpin"

"underpin"


Hemerobius

Hemerobius


pneumonoerysipelas

pneumonoerysipelas


bladdernut

bladdernut


unwedgeable

unwedgeable


enricher

enricher


secernment

secernment


reappraisal

reappraisal


overproportionated

overproportionated


framework

framework


whereout

whereout


beckon

beckon


dicyclist

dicyclist


godown

godown


plumbaginaceous

plumbaginaceous


abreact

abreact


stormable

stormable


chokecherry

chokecherry


unenterprisingness

unenterprisingness


upfling

upfling


radii

radii


glycerizine

glycerizine


spready

spready


irrespectively

irrespectively


holostome

holostome


ungettable

ungettable


nonconforming

nonconforming


controllably

controllably


uniloculate

uniloculate


nidifugous

nidifugous


isothujone

isothujone


piperic

piperic


Hopcalite

Hopcalite


histochemic

histochemic


oftwhiles

oftwhiles


cyclopedic

cyclopedic


receptant

receptant


mesorrhin

mesorrhin


hailshot

hailshot


oligosynthetic

oligosynthetic


decontaminate

decontaminate


circumstantiable

circumstantiable


diatropic

diatropic


dysphagia

dysphagia


resalute

resalute


welly

welly


glossopalatinus

glossopalatinus


malariaproof

malariaproof


precalculation

precalculation


affranchisement

affranchisement


revelationer

revelationer


Updated hash source

Updated hash source

--- md5_hash.c
+++ md5_hash.c
@@ -1,6 +1,4 @@
 /*
-  Copyright (C) 2002 Aladdin Enterprises.  All rights reserved.
-
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   arising from the use of this software.
@@ -17,27 +15,6 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.

-  L. Peter Deutsch
-  ghost@aladdin.com
-
- */
-/* $Id: md5main.c,v 1.1 2002/04/13 19:20:28 lpd Exp $ */
-/*
-  Independent implementation of MD5 (RFC 1321).
-
-  This code implements the MD5 Algorithm defined in RFC 1321, whose
-  text is available at
-	http://www.ietf.org/rfc/rfc1321.txt
-  The code is derived from the text of the RFC, including the test suite
-  (section A.5) but excluding the rest of Appendix A.  It does not include
-  any code or documentation that is identified in the RFC as being
-  copyrighted.
-
-  The original and principal author of md5.c is L. Peter Deutsch
-  <ghost@aladdin.com>.  Other authors are noted in the change history
-  that follows (in reverse chronological order):
-
-  2002-04-13 lpd Splits off main program into a separate file, md5main.c.
  */

 #include "md5.h"
@@ -45,7 +22,6 @@
 #include <stdio.h>
 #include <string.h>

-/* Run the self-test. */
 char * md5_hash(char * md5_string)
 {
   int status = 0;


Fixes duplicate variable name

Fixes duplicate variable name

--- mdrgpalu.c
+++ mdrgpalu.c
@@ -33,13 +33,13 @@
 			curline = i;
 		}

-		for (int i = 0; i < l->len; i++) {
-			char c = l->chars[i];
-			if (needsCursor && e->curchar == i) {
+		for (int j = 0; j < l->len; j++) {
+			char c = l->chars[j];
+			if (needsCursor && e->curchar == j) {
 				char s[2] = {c, '\0'};
 				print_format(FORMAT_REVERSE, (char*) &s);
 				needsCursor = 0;
-				curchar = i;
+				curchar = j;
 			} else {
 				printf("%c", c);
 			}


fix some publishing code

fix some publishing code

--- measures.c
+++ measures.c
@@ -129,19 +129,18 @@
 	enum stat_types stavg[] = {AVG};
 	enum stat_types stwinavg[] = {WIN_AVG};
 	enum stat_types stsum[] = {SUM};
-	enum stat_types stavgrate[] = {WIN_AVG, RATE};
 	enum stat_types stsumrate[] = {SUM, RATE};

 	dprintf("adding measures to %s\n",node_addr(id));

 	/* HopCount */
-       add_measure(&id->mhs[j++], HOPCOUNT, TXRXUNI | PACKET | IN_BAND, 600, "HopCount", stwinavg, sizeof(stavg)/sizeof(enum stat_types), id->addr, MSG_TYPE_CHUNK);	//[IP hops]
+       add_measure(&id->mhs[j++], HOPCOUNT, TXRXUNI | PACKET | IN_BAND, 600, "HopCount", stwinavg, sizeof(stwinavg)/sizeof(enum stat_types), id->addr, MSG_TYPE_CHUNK);	//[IP hops]

 	/* Round Trip Time */
-       add_measure(&id->mhs[j++], RTT, TXRXBI | PACKET | IN_BAND, 120, "RoundTripDelay", stwinavg, sizeof(stavg)/sizeof(enum stat_types), id->addr, MSG_TYPE_SIGNALLING);	//[seconds]
+       add_measure(&id->mhs[j++], RTT, TXRXBI | PACKET | IN_BAND, 120, "RoundTripDelay", stwinavg, sizeof(stwinavg)/sizeof(enum stat_types), id->addr, MSG_TYPE_SIGNALLING);	//[seconds]

 	/* Loss */
-       add_measure(&id->mhs[j++], LOSS, TXRXUNI | PACKET | IN_BAND, 120, "LossRate", stwinavg, sizeof(stavgrate)/sizeof(enum stat_types), id->addr, MSG_TYPE_CHUNK);	//LossRate_avg [probability 0..1] LossRate_rate [lost_pkts/sec]
+       add_measure(&id->mhs[j++], LOSS, TXRXUNI | PACKET | IN_BAND, 120, "LossRate", stwinavg, sizeof(stwinavg)/sizeof(enum stat_types), id->addr, MSG_TYPE_CHUNK);	//LossRate_avg [probability 0..1] LossRate_rate [lost_pkts/sec]

 	// Cumulative Traffic
        //add_measure(&id->mhs[j++], BYTE, RXONLY | PACKET | IN_BAND, 120, "RxBytes", stsum, sizeof(stsum)/sizeof(enum stat_types), id->addr, MSG_TYPE_ANY);


Add a helper to calculate and wrap the index of the array in a queue

--- fq/indexed_array_queue.c
+++ fq/indexed_array_queue.c
@@ -35,6 +35,7 @@
 static enum qterror fqpeekia(struct function_queue*,
 		struct function_queue_element*, int);
 static enum qterror fqresizeia(struct function_queue*, unsigned int, int);
+static unsigned int inc_and_wrap_index(unsigned int, unsigned int);

 /*
  * This is the function dispatch table for manipulating the queue in an
@@ -109,12 +110,10 @@

 	e.func = func;
 	e.arg = arg;
-
-	if(++q->queue.ia.back == q->max_elements)
-		q->queue.ia.back = 0;
-
+	q->queue.ia.back = inc_and_wrap_index(q->queue.ia.back,
+			q->queue.ia.max_size);
+	q->queue.ia.elements[q->queue.ia.back] = e;
 	++q->queue.ia.size;
-	q->queue.ia.elements[q->queue.ia.back] = e;
 	return QTSUCCESS;
 }

@@ -139,11 +138,10 @@
 	if(q->queue.ia.size == 0)
 		return QTEFQEMPTY;

-	if(++q->queue.ia.front == q->max_elements)
-		q->queue.ia.front = 0;
-
+	q->queue.ia.front = inc_and_wrap_index(q->queue.ia.front,
+			q->queue.ia.max_size);
+	*e = q->queue.ia.elements[q->queue.ia.front];
 	--q->queue.ia.size;
-	*e = q->queue.ia.elements[q->queue.ia.front];
 	return QTSUCCESS;
 }

@@ -230,3 +228,19 @@
 	return QTSUCCESS;
 }

+/*
+ * This procedure calculates the index of the the queue which results
+ * from incrementing the given index and wrapping it appropriately with
+ * the given maximum number of elements.  The value of index is the
+ * index given by a position in the queue. The value of max is the value
+ * of the max_elements member of the queue. This procedure returns the
+ * index of the next element insertion point in the queue. The value of
+ * max must be greater than or equal to the value of index.
+ */
+static unsigned int
+inc_and_wrap_index(unsigned int index, unsigned int max)
+{
+	assert(index <= max);
+	return index + 1 >= max ? 0 : index + 1;
+}
+


ELiminate a couple of compiler warnings in the win32 build.

git-svn-id: http://squeakvm.org/svn/squeak/branches/Cog@2980 fa1542d4-bde8-0310-ad64-8ed1123d492a

Former-commit-id: 6197bbb94bb9c790201478092bf1c377a56e7025

--- platforms/win32/vm/sqWin32Alloc.c
+++ platforms/win32/vm/sqWin32Alloc.c
@@ -187,7 +187,7 @@
 {
 	DWORD previous;

-	if (!VirtualProtect(startAddr,
+	if (!VirtualProtect((void *)startAddr,
 						endAddr - startAddr + 1,
 						PAGE_EXECUTE_READWRITE,
 						&previous))
@@ -199,7 +199,7 @@
 {
 	DWORD previous;

-	if (!VirtualProtect(startAddr,
+	if (!VirtualProtect((void *)startAddr,
 						endAddr - startAddr + 1,
 						PAGE_READWRITE,
 						&previous))


If we didn't sync everything in the view, we could have synced some transactions multiple times causing different kinds of problems.

--- src/lib-index/mail-index-view-sync.c
+++ src/lib-index/mail-index-view-sync.c
@@ -369,6 +369,15 @@
 		if (view_sync_pos_find(&view->syncs_done, seq, offset))
 			continue;

+		if (ctx->skipped_some) {
+			/* We've been skipping some transactions, which means
+			   we'll go through these same transactions again
+			   later. Since we're syncing this one, we don't want
+			   to do it again. */
+			mail_index_view_add_synced_transaction(view, seq,
+							       offset);
+		}
+
 		/* Apply transaction to view's mapping if needed (meaning we
 		   didn't just re-map the view to head mapping). */
 		if (ctx->sync_map_update) {
@@ -391,13 +400,6 @@
 		if (view_sync_pos_find(&view->syncs_hidden, seq, offset))
 			continue;
 		break;
-	}
-
-	if (ctx->skipped_some) {
-		/* We've been skipping some transactions, which means we'll
-		   go through these same transaction again later. Since we're
-		   syncing this one, we don't want to do it again. */
-		mail_index_view_add_synced_transaction(view, seq, offset);
 	}
 	return 1;
 }


fixed some fd leaks in error conditions

fixed some fd leaks in error conditions

--- src/lib-index/mail-transaction-log.c
+++ src/lib-index/mail-transaction-log.c
@@ -22,6 +22,8 @@
 #define LOG_DOTLOCK_STALE_TIMEOUT 0
 #define LOG_DOTLOCK_IMMEDIATE_STALE_TIMEOUT 300

+#define LOG_NEW_DOTLOCK_SUFFIX ".newlock"
+
 struct mail_transaction_add_ctx {
 	struct mail_transaction_log *log;
 	struct mail_index_view *view;
@@ -342,27 +344,15 @@
 }

 static int
-mail_transaction_log_file_create(struct mail_transaction_log *log,
-				 const char *path, dev_t dev, ino_t ino)
-{
-#define LOG_NEW_DOTLOCK_SUFFIX ".newlock"
+mail_transaction_log_file_create2(struct mail_transaction_log *log,
+				  const char *path, int fd,
+				  dev_t dev, ino_t ino)
+{
 	struct mail_index *index = log->index;
 	struct mail_transaction_log_header hdr;
 	struct stat st;
 	unsigned int lock_id;
-	int fd, fd2, ret;
-
-	/* With dotlocking we might already have path.lock created, so this
-	   filename has to be different. */
-	fd = file_dotlock_open(path, NULL, LOG_NEW_DOTLOCK_SUFFIX,
-			       LOG_DOTLOCK_TIMEOUT,
-			       LOG_DOTLOCK_STALE_TIMEOUT,
-			       LOG_DOTLOCK_IMMEDIATE_STALE_TIMEOUT, NULL, NULL);
-	if (fd == -1) {
-		mail_index_file_set_syscall_error(index, path,
-						  "file_dotlock_open()");
-		return -1;
-	}
+	int fd2, ret;

 	/* log creation is locked now - see if someone already created it */
 	fd2 = open(path, O_RDWR);
@@ -411,14 +401,12 @@
 	if (write_full(fd, &hdr, sizeof(hdr)) < 0) {
 		mail_index_file_set_syscall_error(index, path,
 						  "write_full()");
-                (void)file_dotlock_delete(path, LOG_NEW_DOTLOCK_SUFFIX, fd);
 		return -1;
 	}

 	fd2 = dup(fd);
 	if (fd2 < 0) {
 		mail_index_file_set_syscall_error(index, path, "dup()");
-                (void)file_dotlock_delete(path, LOG_NEW_DOTLOCK_SUFFIX, fd);
 		return -1;
 	}

@@ -426,6 +414,32 @@
 		return -1;

 	/* success */
+	return fd2;
+}
+
+static int
+mail_transaction_log_file_create(struct mail_transaction_log *log,
+				 const char *path, dev_t dev, ino_t ino)
+{
+	int fd, fd2;
+
+	/* With dotlocking we might already have path.lock created, so this
+	   filename has to be different. */
+	fd = file_dotlock_open(path, NULL, LOG_NEW_DOTLOCK_SUFFIX,
+			       LOG_DOTLOCK_TIMEOUT,
+			       LOG_DOTLOCK_STALE_TIMEOUT,
+			       LOG_DOTLOCK_IMMEDIATE_STALE_TIMEOUT, NULL, NULL);
+	if (fd == -1) {
+		mail_index_file_set_syscall_error(log->index, path,
+						  "file_dotlock_open()");
+		return -1;
+	}
+
+	fd2 = mail_transaction_log_file_create2(log, path, fd, dev, ino);
+	if (fd2 < 0) {
+		(void)file_dotlock_delete(path, LOG_NEW_DOTLOCK_SUFFIX, fd);
+		return -1;
+	}
 	return fd2;
 }

@@ -440,6 +454,7 @@

 	if (fstat(fd, &st) < 0) {
 		mail_index_file_set_syscall_error(log->index, path, "fstat()");
+		(void)close(fd);
 		return NULL;
 	}


imap: While modseq tracking hasn't been enabled, return mailbox as NOMODSEQ. It would be possible to avoid this by always keeping track of highestmodseq, but that requires changing the index format a bit.

--- src/lib-storage/index/index-status.c
+++ src/lib-storage/index/index-status.c
@@ -58,7 +58,9 @@
 	status_r->uidvalidity = hdr->uid_validity;
 	status_r->uidnext = hdr->next_uid;
 	status_r->first_recent_uid = hdr->first_recent_uid;
-	status_r->nonpermanent_modseqs = mail_index_is_in_memory(box->index);
+	status_r->nonpermanent_modseqs =
+		mail_index_is_in_memory(box->index) ||
+		!mail_index_have_modseq_tracking(box->index);
 	if ((items & STATUS_HIGHESTMODSEQ) != 0) {
 		status_r->highest_modseq =
 			mail_index_modseq_get_highest(box->view);


lib-storage: Crashfix on thread handling.

--- src/lib-storage/index/index-thread.c
+++ src/lib-storage/index/index-thread.c
@@ -13,6 +13,7 @@
 #include "mail-search-build.h"
 #include "mailbox-search-result-private.h"
 #include "index-storage.h"
+#include "index-search-private.h"
 #include "index-thread-private.h"

 #include <stdlib.h>
@@ -299,6 +300,7 @@
 	struct mail_thread_mailbox *tbox = MAIL_THREAD_CONTEXT(ctx->box);
 	struct mail_search_args *search_args;
 	struct mail_search_context *search_ctx;
+	struct index_search_context *search_ctx_i;
 	struct mail *mail;
 	struct mail_private *pmail;
 	uint32_t last_uid, seq1, seq2;
@@ -337,8 +339,8 @@
 	search_ctx = mailbox_search_init(ctx->t, search_args, NULL);

 	mail = mail_alloc(ctx->t, 0, NULL);
-	pmail = (struct mail_private *)mail;
-	pmail->extra_wanted_headers =
+	search_ctx_i = (struct index_search_context *)search_ctx;
+	search_ctx_i->extra_wanted_headers =
 		mailbox_header_lookup_init(ctx->box, wanted_headers);

 	while (mailbox_search_next(search_ctx, mail)) {
@@ -347,7 +349,6 @@
 			break;
 		}
 	}
-	mailbox_header_lookup_unref(&pmail->extra_wanted_headers);
 	mail_free(&mail);
 	if (mailbox_search_deinit(&search_ctx) < 0)
 		ret = -1;
@@ -572,7 +573,7 @@
 	tbox->ctx = ctx;

 	mail_thread_cache_sync_remove(tbox, ctx);
-	ret = mail_thread_index_map_build(ctx) < 0;
+	ret = mail_thread_index_map_build(ctx);
 	if (ret == 0)
 		mail_thread_cache_sync_add(tbox, ctx, search_ctx);
 	if (mailbox_search_deinit(&search_ctx) < 0)


Revert unintentional change to this file.

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

--- tools/c-index-test/c-index-test.c
+++ tools/c-index-test/c-index-test.c
@@ -4,7 +4,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <assert.h>

 #ifdef _MSC_VER
 char *basename(const char* path)
@@ -87,7 +86,7 @@
             printf("// CHECK: %s:%d:%d: ", basename(clang_getCursorSource(Ref)),
                                              curLine, curColumn);
             PrintCursor(Ref);
-			printf(" [Context:%s]\n", clang_getDeclSpelling(Ref.decl));
+            printf(" [Context:%s]\n", clang_getDeclSpelling(Ref.decl));
           }
           startBuf++;
         }


Bumping version number

Bumping version number

--- FastLED.h
+++ FastLED.h
@@ -7,8 +7,8 @@
 #define xstr(s) str(s)
 #define str(s) #s

-#define  FASTLED_VERSION 3000000
-#warning FastLED version 3000000  (Not really a warning, just telling you here.)
+#define  FASTLED_VERSION 3000001
+#warning FastLED version 3.000.001  (Not really a warning, just telling you here.)

 #define __PROG_TYPES_COMPAT__


CDRIVER-4408 require 4.2.0 server for csfle tests (#1040)

* Require 4.2.0 server for csfle tests

* Update src/libmongoc/tests/unified/runner.c

Co-authored-by: Ezra Chung <ac2244fb8f9d14c584c89a2e3d2f6d4dc35bcd28@users.noreply.github.com>

Co-authored-by: Ezra Chung <ac2244fb8f9d14c584c89a2e3d2f6d4dc35bcd28@users.noreply.github.com>

--- src/libmongoc/tests/unified/runner.c
+++ src/libmongoc/tests/unified/runner.c
@@ -777,6 +777,16 @@
 #if defined(MONGOC_ENABLE_CLIENT_SIDE_ENCRYPTION)
       if (0 == strcmp (key, "csfle")) {
          const bool csfle_required = bson_iter_bool (&req_iter);
+         semver_t min_server_version;
+
+         semver_parse ("4.2.0", &min_server_version);
+         if (semver_cmp (server_version, &min_server_version) < 0) {
+            *fail_reason = bson_strdup_printf (
+               "Server version %s is lower than minServerVersion %s required by CSFLE",
+               semver_to_string (server_version),
+               semver_to_string (&min_server_version));
+            return false;
+         }

          if (csfle_required) {
             continue;