Use two calls to set two headers

Use two calls to set two headers

--- src/transports/winhttp.c
+++ src/transports/winhttp.c
@@ -269,14 +269,27 @@
 		/* Send Content-Type and Accept headers -- only necessary on a POST */
 		git_buf_clear(&buf);
 		if (git_buf_printf(&buf,
-			"Content-Type: application/x-git-%s-request\r\n"
-			"Accept: application/x-git-%s-result\r\n",
-			s->service, s->service) < 0)
+			"Content-Type: application/x-git-%s-request",
+			s->service) < 0)
 			goto on_error;

 		git__utf8_to_16(ct, MAX_CONTENT_TYPE_LEN, git_buf_cstr(&buf));

-		if (!WinHttpAddRequestHeaders(s->request, ct, (ULONG) -1L,
+		if (!WinHttpAddRequestHeaders(s->request, ct, (ULONG)-1L,
+			WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE)) {
+			giterr_set(GITERR_OS, "Failed to add a header to the request");
+			goto on_error;
+		}
+
+		git_buf_clear(&buf);
+		if (git_buf_printf(&buf,
+			"Accept: application/x-git-%s-result",
+			s->service) < 0)
+			goto on_error;
+
+		git__utf8_to_16(ct, MAX_CONTENT_TYPE_LEN, git_buf_cstr(&buf));
+
+		if (!WinHttpAddRequestHeaders(s->request, ct, (ULONG)-1L,
 			WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE)) {
 			giterr_set(GITERR_OS, "Failed to add a header to the request");
 			goto on_error;


loop added to prompt a command while no cell is choosen

--- src/entity/player/human.c
+++ src/entity/player/human.c
@@ -18,23 +18,33 @@
  */
 int human_select_cell_to_leave(s_player *p, struct s_cell **player_cells, int nb_cells)
 {
-	int command_size = 30;
+	int command_size, choosen_cell;
+
+	command_size = 30;
 	char command[command_size];

-	ui_prompt_command(command, (size_t) command_size);
+	choosen_cell = -1;

-	if (check_command(command, "cells", 1)) {
-		ui_list_cells(player_cells, nb_cells);
-	}
-	// list player cells
-	// prompt cell to leave
-	/*
-	 * Command examples:
-	 * cells
-	 * neighbours #
-	 * leave #
-	 */
-	return 1;
+	do {
+		ui_prompt_command(command, (size_t) command_size);
+
+		if (check_command(command, "cells", 1)) {
+			ui_list_cells(player_cells, nb_cells);
+		}
+		else if (check_command(command, "neighbours ", 0)) {
+
+		}
+		// list player cells
+		// prompt cell to leave
+		/*
+		 * Command examples:
+		 * cells
+		 * neighbours #
+		 * leave #
+		 */
+	} while (choosen_cell == -1);
+
+	return choosen_cell;
 }

 /**


Catch and ignore exceptions from TuioUdpServer::update

Too much input was exceeding the Udp buffer capacity.

--- src/tuio/TuioUdpServer.h
+++ src/tuio/TuioUdpServer.h
@@ -72,9 +72,13 @@
 		void sendCursorBundle(long fseq);

 		void update() {
-			initFrame();
-			// check?
-			commitFrame();
+			try {
+				initFrame();
+				// check?
+				commitFrame();
+			} catch (std::exception &e) {
+				std::cout << "error in TuioUdpServer::update, msg = " << e.what() << std::endl;
+			}
 		}

 	private:


Removed a stray period in a comment.

Removed a stray period in a comment.

--- src/vrkit/plugin/TypedRegistryEntry.h
+++ src/vrkit/plugin/TypedRegistryEntry.h
@@ -55,7 +55,7 @@
  * vrkit::plugin::TypedInitRegistryEntry instead.
  *
  * @see vrkit::plugin::Creator
- * @see vrkit::plugin::TypedInitRegistryEntry.
+ * @see vrkit::plugin::TypedInitRegistryEntry
  *
  * @note This class was moved into the vrkit::plugin namespace in version 0.47.
  *


use constants, reduce to 500ms

use constants, reduce to 500ms

--- lib/handler/self_trace.c
+++ lib/handler/self_trace.c
@@ -21,6 +21,8 @@
  */
 #include <inttypes.h>
 #include "h2o.h"
+
+#define SEND_WAIT 500 /* how frequent new loglines should be pushed out; in milliseconds */

 struct h2o_self_trace_generator {
     h2o_generator_t super;
@@ -64,7 +66,7 @@
 static void adjust_send_timer(struct h2o_self_trace_generator *self)
 {
     if (!self->inflight.inflight && self->should_send_buffered && !h2o_timer_is_linked(&self->send_timer))
-        h2o_timer_link(self->req->conn->ctx->loop, 1000, &self->send_timer);
+        h2o_timer_link(self->req->conn->ctx->loop, SEND_WAIT, &self->send_timer);
 }


now seems fixed

now seems fixed

--- cmd/wm/mouse.c
+++ cmd/wm/mouse.c
@@ -445,10 +445,8 @@
 		switch (ev.type) {
 		case ButtonRelease:
 			draw_pseudo_border(&frect);
-			pt.x = px;
-			pt.y = py;
 			if(idx_of_area(f->area))
-				resize_column(c, &frect, &pt);
+				resize_column(c, &frect, nil);
 			else
 				resize_client(c, &frect, False);
 			XUngrabServer(dpy);


removed unnecessary inclusions in wmiimenu.c

--- cmd/wmiimenu.c
+++ cmd/wmiimenu.c
@@ -8,9 +8,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <time.h>
 #include <unistd.h>
 #include <X11/Xlib.h>
 #include <X11/cursorfont.h>


replace the call to malloc with a call to cext_emallocz

--- cmd/wmiimenu.c
+++ cmd/wmiimenu.c
@@ -343,7 +343,7 @@
 			max = len;
 		}

-		new = (Item*)malloc(sizeof(Item));
+		new = cext_emallocz(sizeof(Item));
 		new->next = new->left = new->right = nil;
 		new->text = p;
 		if(!allitem)


config: fix command line usage example

config: fix command line usage example

--- lib/include/bvs/config.h
+++ lib/include/bvs/config.h
@@ -76,7 +76,7 @@
 	 * given when constructing a config object).
 	 * Command line syntax is similar to config file syntax:
 	 * @code
-	 * --$NAME.options=option1=value1:optionString="value2 with spaces":optionList=elementOne,"element Two",'element Three'
+	 * --$NAME.options=section.option1=value1:section.optionString="value2 with spaces":section.optionList=elementOne,"element Two",'element Three'
 	 * @endcode
 	 * The separator for $OPTIONS is a ':' sign, so ':' are not allowed anywhere
 	 * else, not even inside single or double quotes. Also, be careful with spaces


Reland "Adding gtest-spi.h in webrtc/test/gtest.h"

This reverts commit 27e8a3e223098a023c3b2a0cb3c3ee9268b1cc63.

Reason for revert: A CL to make downstream projects compatible has landend.

Original change's description:
> Revert "Adding gtest-spi.h in webrtc/test/gtest.h"
>
> This reverts commit 68f4904ac972fc75e81b642da4d2f46efe79071b.
>
> Reason for revert: Breaks downstream projects.
>
> Original change's description:
> > Adding gtest-spi.h in webrtc/test/gtest.h
> >
> > The additional include is needed in order to use EXPECT_NONFATAL_FAILURE()
> > in unit tests.
> >
> > Bug: webrtc:8948
> > Change-Id: If5b9ceb89a3a36480657d094cfabc81c9b0e15b7
> > Reviewed-on: https://webrtc-review.googlesource.com/58096
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Patrik Höglund <b486136ee68458b09c92c86c39f451c87d6ef6a1@webrtc.org>
> > Commit-Queue: Alessio Bazzica <eed802d553432598d8dd1392efc4d65b5eefde4d@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22227}
>
> TBR=b486136ee68458b09c92c86c39f451c87d6ef6a1@webrtc.org,mbonadei@webrtc.org,eed802d553432598d8dd1392efc4d65b5eefde4d@webrtc.org
>
> Change-Id: Id74c6563e1b8ac637667b5fb8777bbd6b7c8f5d0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8948
> Reviewed-on: https://webrtc-review.googlesource.com/58881
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22232}

TBR=b486136ee68458b09c92c86c39f451c87d6ef6a1@webrtc.org,mbonadei@webrtc.org,eed802d553432598d8dd1392efc4d65b5eefde4d@webrtc.org,philipel@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:8948
Change-Id: Ib8072ab3d508ae82f557306f3519c5bb00b37b25
Reviewed-on: https://webrtc-review.googlesource.com/66840
Reviewed-by: Alessio Bazzica <eed802d553432598d8dd1392efc4d65b5eefde4d@webrtc.org>
Reviewed-by: Patrik Höglund <b486136ee68458b09c92c86c39f451c87d6ef6a1@webrtc.org>
Commit-Queue: Alessio Bazzica <eed802d553432598d8dd1392efc4d65b5eefde4d@webrtc.org>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#22742}

--- test/gtest.h
+++ test/gtest.h
@@ -14,6 +14,7 @@
 #include "rtc_base/ignore_wundef.h"

 RTC_PUSH_IGNORING_WUNDEF()
+#include "testing/gtest/include/gtest/gtest-spi.h"
 #include "testing/gtest/include/gtest/gtest.h"
 RTC_POP_IGNORING_WUNDEF()


(solaris) use X/PY_DECREF around PyList_Append

--- psutil/_psutil_sunos.c
+++ psutil/_psutil_sunos.c
@@ -312,7 +312,6 @@
     PyObject *tuple = NULL;
     PyObject *user_proc = NULL;
     struct utmpx *ut;
-    int ret;

     while (NULL != (ut = getutxent())) {
         if (ut->ut_type == USER_PROCESS)
@@ -326,12 +325,22 @@
             (float)ut->ut_tv.tv_sec,  // tstamp
             user_proc                 // (bool) user process
         );
-        PyList_Append(ret_list, tuple);
+        if (tuple == NULL)
+            goto error;
+        if (PyList_Append(ret_list, tuple))
+            goto error;
         Py_DECREF(tuple);
     }
     endutent();

     return ret_list;
+
+error:
+    Py_XDECREF(tuple);
+    Py_DECREF(ret_list);
+    if (ut != NULL)
+        endutent();
+    return NULL;
 }

@@ -345,11 +354,12 @@
     FILE *file;
     struct mnttab mt;
     PyObject* py_retlist = PyList_New(0);
-    PyObject* py_tuple;
+    PyObject* py_tuple = NULL;

     file = fopen(MNTTAB, "rb");
     if (file == NULL) {
-        return PyErr_SetFromErrno(PyExc_OSError);
+        PyErr_SetFromErrno(PyExc_OSError);
+        goto error;
     }

     while (getmntent(file, &mt) == 0) {
@@ -357,12 +367,22 @@
                                            mt.mnt_mountp,     // mount point
                                            mt.mnt_fstype,    // fs type
                                            mt.mnt_mntopts);   // options
-        PyList_Append(py_retlist, py_tuple);
-        Py_XDECREF(py_tuple);
-
-    }
-
+        if (py_tuple == NULL)
+            goto error;
+        if (PyList_Append(py_retlist, py_tuple))
+            goto error;
+        Py_DECREF(py_tuple);
+
+    }
+    fclose(file);
     return py_retlist;
+
+error:
+    Py_XDECREF(py_tuple);
+    Py_DECREF(py_retlist);
+    if (file != NULL)
+        fclose(file);
+    return NULL;
 }

@@ -378,35 +398,47 @@
     int numcpus;
     int i;
     PyObject* py_retlist = PyList_New(0);
-    PyObject* py_cputime;
+    PyObject* py_cputime = NULL;

     kc = kstat_open();
     if (kc == NULL) {
-        return PyErr_SetFromErrno(PyExc_OSError);;
+        PyErr_SetFromErrno(PyExc_OSError);
+        goto error;
     }

     numcpus = sysconf(_SC_NPROCESSORS_ONLN) - 1;
     for (i=0; i<=numcpus; i++) {
         ksp = kstat_lookup(kc, "cpu_stat", i, NULL);
         if (ksp == NULL) {
-            kstat_close(kc);
-            return PyErr_SetFromErrno(PyExc_OSError);;
+            PyErr_SetFromErrno(PyExc_OSError);
+            goto error;
         }
 	    if (kstat_read(kc, ksp, &cs) == -1) {
-		    kstat_close(kc);
-            return PyErr_SetFromErrno(PyExc_OSError);;
+            PyErr_SetFromErrno(PyExc_OSError);
+            goto error;
 	    }
         py_cputime = Py_BuildValue("IIII",
                                    cs.cpu_sysinfo.cpu[CPU_USER],
                                    cs.cpu_sysinfo.cpu[CPU_KERNEL],
                                    cs.cpu_sysinfo.cpu[CPU_IDLE],
                                    cs.cpu_sysinfo.cpu[CPU_WAIT]);
-        PyList_Append(py_retlist, py_cputime);
-        Py_XDECREF(py_cputime);
+        if (py_cputime == NULL)
+            goto error;
+        if (PyList_Append(py_retlist, py_cputime))
+            goto error;
+        Py_DECREF(py_cputime);
+
     }

     kstat_close(kc);
     return py_retlist;
+
+error:
+    Py_XDECREF(py_cputime);
+    Py_DECREF(py_retlist);
+    if (kc != NULL)
+        kstat_close(kc);
+    return NULL;
 }

@@ -420,11 +452,12 @@
     kstat_t *ksp;
     kstat_io_t kio;
     PyObject* py_retdict = PyDict_New();
-    PyObject* py_disk_info;
+    PyObject* py_disk_info = NULL;

     kc = kstat_open();
     if (kc == NULL) {
-        return PyErr_SetFromErrno(PyExc_OSError);;
+        PyErr_SetFromErrno(PyExc_OSError);;
+        goto error;
     }
     ksp = kc->kc_chain;
     while (ksp != NULL) {
@@ -442,8 +475,12 @@
                                              kio.rtime,  // XXX are these ms?
                                              kio.wtime   // XXX are these ms?
                                              );
-                PyDict_SetItemString(py_retdict, ksp->ks_name, py_disk_info);
-                Py_XDECREF(py_disk_info);
+
+                if (!py_disk_info)
+                    goto error;
+                if (PyDict_SetItemString(py_retdict, ksp->ks_name, py_disk_info))
+                    goto error;
+                Py_DECREF(py_disk_info);
             }
         }
         ksp = ksp->ks_next;
@@ -451,6 +488,13 @@
     kstat_close(kc);

     return py_retdict;
+
+error:
+    Py_XDECREF(py_disk_info);
+    Py_DECREF(py_retdict);
+    if (kc != NULL)
+        kstat_close(kc);
+    return NULL;
 }


fix // style comments, not allowed

fix // style comments, not allowed

--- milestone1/1.c
+++ milestone1/1.c
@@ -1,7 +1,6 @@
 extern void print_int(int x);
 extern void print_string(char c[]);

-// any kind of global variable is allowed
 int intVar;
 int intArr[4];

@@ -71,7 +70,6 @@
     print_int(c);
     print_string("\n\n");

-    //overflow in LitInt -> Char
     c = 999998990;
     print_string("should NOT get 999998990 due to overflow\ngot: ");
     print_int(c);


[models] Make the docs show a list.

[models] Make the docs show a list.

--- src/models/src/NIMutableTableViewModel.h
+++ src/models/src/NIMutableTableViewModel.h
@@ -22,8 +22,8 @@
  * When modifications are made to the model there are two ways to reflect the changes in the table
  * view.
  *
- * * Call reloadData on the table view. This is the most destructive way to update the table view.
- * * Call insert/delete/reload methods on the table view with the retuned index path arrays.
+ * - Call reloadData on the table view. This is the most destructive way to update the table view.
+ * - Call insert/delete/reload methods on the table view with the retuned index path arrays.
  *
  * The latter option is the recommended approach to adding new cells to a table view. Each method in
  * the mutable table view model returns a data structure that can be used to inform the table view


Fix a memory leak encoding on FFmpeg v2.3.

--- src/modules/avformat/consumer_avformat.c
+++ src/modules/avformat/consumer_avformat.c
@@ -1710,7 +1710,7 @@
 							// Write the compressed frame in the media file
 							if ( pkt.pts != AV_NOPTS_VALUE )
 								pkt.pts = av_rescale_q( pkt.pts, codec->time_base, stream->time_base );
-#if LIBAVCODEC_VERSION_MAJOR >= 55
+#if LIBAVFORMAT_VERSION_INT >= ((55<<16)+(44<<8)+0)
 							if ( pkt.dts != AV_NOPTS_VALUE )
 								pkt.dts = av_rescale_q( pkt.dts, codec->time_base, stream->time_base );
 							if ( pkt.duration > 0 )
@@ -1736,7 +1736,7 @@

 						if ( i == 0 )
 						{
-#if LIBAVFORMAT_VERSION_MAJOR >= 56
+#if LIBAVFORMAT_VERSION_INT >= ((55<<16)+(44<<8)+0)
 							audio_pts = (double) sample_count[0] * av_q2d( stream->codec->time_base );
 #else
 							audio_pts = (double) sample_count[0] * av_q2d( stream->time_base );
@@ -1925,7 +1925,7 @@
 						}
  					}
 					frame_count++;
-#if LIBAVFORMAT_VERSION_MAJOR >= 56
+#if LIBAVFORMAT_VERSION_INT >= ((55<<16)+(44<<8)+0)
 					video_pts = (double) frame_count * av_q2d( video_st->codec->time_base );
 #else
 					video_pts = (double) frame_count * av_q2d( video_st->time_base );


Fix another typo causing compile error on older APIs.

--- src/modules/avformat/consumer_avformat.c
+++ src/modules/avformat/consumer_avformat.c
@@ -1407,7 +1407,7 @@
 	if ( enc_ctx->oc->oformat && enc_ctx->oc->oformat->priv_class && !enc_ctx->oc->priv_data && enc_ctx->oc->oformat->priv_data_size ) {
 		enc_ctx->oc->priv_data = av_mallocz( enc_ctx->oc->oformat->priv_data_size );
 		if ( enc_ctx->oc->priv_data ) {
-			*(const AVClass**)enc_ctx->oc->priv_data = enc_ctx->= oc->oformat->priv_class;
+			*(const AVClass**)enc_ctx->oc->priv_data = enc_ctx->oc->oformat->priv_class;
 			av_opt_set_defaults( enc_ctx->oc->priv_data );
 		}
 	}


Simplify audio pointer and sample size code.

--- src/modules/avformat/producer_avformat.c
+++ src/modules/avformat/producer_avformat.c
@@ -96,9 +96,9 @@
 	int current_position;
 	int got_picture;
 	int top_field_first;
-	int16_t *audio_buffer[ MAX_AUDIO_STREAMS ];
+	uint8_t *audio_buffer[ MAX_AUDIO_STREAMS ];
 	size_t audio_buffer_size[ MAX_AUDIO_STREAMS ];
-	int16_t *decode_buffer[ MAX_AUDIO_STREAMS ];
+	uint8_t *decode_buffer[ MAX_AUDIO_STREAMS ];
 	int audio_used[ MAX_AUDIO_STREAMS ];
 	int audio_streams;
 	int audio_max_stream;
@@ -1914,8 +1914,8 @@
 	ReSampleContext *resample = self->audio_resample[ index ];

 	// Obtain the audio buffers
-	int16_t *audio_buffer = self->audio_buffer[ index ];
-	int16_t *decode_buffer = self->decode_buffer[ index ];
+	uint8_t *audio_buffer = self->audio_buffer[ index ];
+	uint8_t *decode_buffer = self->decode_buffer[ index ];

 	int audio_used = self->audio_used[ index ];
 	uint8_t *ptr = pkt.data;
@@ -1925,8 +1925,7 @@
 	while ( ptr && ret >= 0 && len > 0 )
 	{
 		int sizeof_sample = sample_bytes( codec_context );
-		int sample_size_factor = sizeof_sample / sizeof(int16_t);
-		int data_size = sizeof_sample * AVCODEC_MAX_AUDIO_FRAME_SIZE;
+		int data_size = self->audio_buffer_size[ index ];

 		// Decode the audio
 #if (LIBAVCODEC_VERSION_INT >= ((52<<16)+(26<<8)+0))
@@ -1950,25 +1949,25 @@
 		{
 			// Figure out how many samples will be needed after resampling
 			int convert_samples = data_size / codec_context->channels / sizeof_sample;
-			int samples_needed = self->resample_factor * convert_samples + 1;
-
+			int samples_needed = self->resample_factor * convert_samples;
+
 			// Resize audio buffer to prevent overflow
-			if ( ( audio_used + samples_needed ) * channels > self->audio_buffer_size[ index ] )
-			{
-				self->audio_buffer_size[ index ] *= 2;
-				audio_buffer = self->audio_buffer[ index ] = mlt_pool_realloc( audio_buffer, self->audio_buffer_size[ index ] * sizeof_sample );
+			if ( ( audio_used + samples_needed ) * channels * sizeof_sample > self->audio_buffer_size[ index ] )
+			{
+				self->audio_buffer_size[ index ] = ( audio_used + samples_needed * 2 ) * channels * sizeof_sample;
+				audio_buffer = self->audio_buffer[ index ] = mlt_pool_realloc( audio_buffer, self->audio_buffer_size[ index ] );
 			}
 			if ( resample )
 			{
 				// Copy to audio buffer while resampling
-				int16_t *source = decode_buffer;
-				int16_t *dest = &audio_buffer[ audio_used * channels * sample_size_factor ];
+				uint8_t *source = decode_buffer;
+				uint8_t *dest = &audio_buffer[ audio_used * channels * sizeof_sample ];
 				audio_used += audio_resample( resample, dest, source, convert_samples );
 			}
 			else
 			{
 				// Straight copy to audio buffer
-				memcpy( &audio_buffer[ audio_used * codec_context->channels * sample_size_factor ], decode_buffer, data_size );
+				memcpy( &audio_buffer[ audio_used * codec_context->channels * sizeof_sample ], decode_buffer, data_size );
 				audio_used += convert_samples;
 			}

@@ -1977,7 +1976,7 @@
 			{
 				*ignore -= 1;
 				audio_used -= samples;
-				memmove( audio_buffer, &audio_buffer[ samples * (resample? channels : codec_context->channels) * sample_size_factor ],
+				memmove( audio_buffer, &audio_buffer[ samples * (resample? channels : codec_context->channels) * sizeof_sample ],
 						 audio_used * sizeof_sample );
 			}
 		}
@@ -2036,7 +2035,6 @@
 	AVFormatContext *context = self->audio_format;

 	int sizeof_sample = sizeof( int16_t );
-	int sample_size_factor = 1;

 	// Determine the tracks to use
 	int index = self->audio_index;
@@ -2083,15 +2081,14 @@
 			{
 				codec_context->request_channels = self->audio_index == INT_MAX ? codec_context->channels : *channels;
 				sizeof_sample = sample_bytes( codec_context );
-				sample_size_factor = sizeof_sample / sizeof(int16_t);
 			}

 			// Check for audio buffer and create if necessary
 			self->audio_buffer_size[ index ] = AVCODEC_MAX_AUDIO_FRAME_SIZE;
-			self->audio_buffer[ index ] = mlt_pool_alloc( self->audio_buffer_size[ index ] * sizeof_sample );
+			self->audio_buffer[ index ] = mlt_pool_alloc( self->audio_buffer_size[ index ] );

 			// Check for decoder buffer and create if necessary
-			self->decode_buffer[ index ] = av_malloc( self->audio_buffer_size[ index ] * sizeof_sample );
+			self->decode_buffer[ index ] = av_malloc( self->audio_buffer_size[ index ] );
 		}
 	}

@@ -2146,9 +2143,9 @@
 		// Set some additional return values
 		if ( self->audio_index != INT_MAX && !self->audio_resample[ self->audio_index ] )
 		{
-			*channels = self->audio_codec[ self->audio_index ]->channels;
-			*frequency = self->audio_codec[ self->audio_index ]->sample_rate;
 			index = self->audio_index;
+			*channels = self->audio_codec[ index ]->channels;
+			*frequency = self->audio_codec[ index ]->sample_rate;
 			*format = self->audio_codec[ index ]->sample_fmt == SAMPLE_FMT_S32 ? mlt_audio_s32
 				: self->audio_codec[ index ]->sample_fmt == SAMPLE_FMT_FLT ? mlt_audio_float
 				: mlt_audio_s16;
@@ -2174,7 +2171,7 @@
 		// Interleave tracks if audio_index=all
 		if ( self->audio_index == INT_MAX )
 		{
-			int16_t *dest = *buffer;
+			uint8_t *dest = *buffer;
 			int i;
 			for ( i = 0; i < *samples; i++ )
 			{
@@ -2182,16 +2179,16 @@
 				if ( self->audio_codec[ index ] )
 				{
 					int current_channels = self->audio_codec[ index ]->channels;
-					int16_t *src = self->audio_buffer[ index ] + i * current_channels * sample_size_factor;
+					uint8_t *src = self->audio_buffer[ index ] + i * current_channels * sizeof_sample;
 					memcpy( dest, src, current_channels * sizeof_sample );
-					dest += current_channels * sample_size_factor;
+					dest += current_channels * sizeof_sample;
 				}
 			}
 			for ( index = 0; index < index_max; index++ )
 			if ( self->audio_codec[ index ] && self->audio_used[ index ] >= *samples )
 			{
 				int current_channels = self->audio_codec[ index ]->channels;
-				int16_t *src = self->audio_buffer[ index ] + *samples * current_channels * sample_size_factor;
+				uint8_t *src = self->audio_buffer[ index ] + *samples * current_channels * sizeof_sample;
 				self->audio_used[index] -= *samples;
 				memmove( self->audio_buffer[ index ], src, self->audio_used[ index ] * current_channels * sizeof_sample );
 			}
@@ -2204,11 +2201,11 @@
 			// Now handle the audio if we have enough
 			if ( self->audio_used[ index ] > 0 )
 			{
-				int16_t *src = self->audio_buffer[ index ];
+				uint8_t *src = self->audio_buffer[ index ];
 				*samples = self->audio_used[ index ] < *samples ? self->audio_used[ index ] : *samples;
-				memcpy( *buffer, src, size );
+				memcpy( *buffer, src, *samples * *channels * sizeof_sample );
 				self->audio_used[ index ] -= *samples;
-				memmove( src, &src[ *samples * *channels * sample_size_factor ], self->audio_used[ index ] * *channels * sizeof_sample );
+				memmove( src, &src[ *samples * *channels * sizeof_sample ], self->audio_used[ index ] * *channels * sizeof_sample );
 			}
 			else
 			{


fix minranges

fix minranges

--- include/mujincontrollerclient/mujincontrollerclient.h
+++ include/mujincontrollerclient/mujincontrollerclient.h
@@ -282,7 +282,7 @@
     boost::array<std::string, 2> targetnames; ///< the primary key of the target object to optimize for. If blank, will use robot.
     boost::array<std::string, 2> framenames; ///< The primary key of the frame to define the optimization parameters in. If blank, will use the target's coordinate system.
     boost::array<Real[4],2> maxranges; ///< X, Y, Z, Angle (deg)
-    boost::array<Real[2],2> minranges; ///< X, Y, Z, Angle (deg)
+    boost::array<Real[4],2> minranges; ///< X, Y, Z, Angle (deg)
     boost::array<Real[4],2> stepsizes; ///< X, Y, Z, Angle (deg)
     boost::array<int,2> ignorebasecollisions; ///< If 1, when moving the robot, allow collisions of the base with the environment, this allows users to search for a base placement and while ignoring small obstacles. By default this is 0.


iot/dns: Add '+' operator

iot/dns: Add '+' operator

This commit adds the '+' operator that keeps symmetry with the line
below.

Change-Id: Icb2a5f22b5202597e3e0cc252436b422ce7b44a2
Signed-off-by: Flavio Santes <898dd4ac0d81a15d81a5f0854f3ea5bf79c7fee5@intel.com>

--- lib/iot/dns/dns_client.c
+++ lib/iot/dns/dns_client.c
@@ -409,7 +409,7 @@
 		to_copy = min(len, src->len - offset);
 		memcpy(dst->data + copied, src->data + offset, to_copy);

-		copied = to_copy;
+		copied += to_copy;
 		len -= to_copy;
 		src = src->frags;
 		/* after the first iteration, this value will be 0 */


aaah yes. get the ref -1 as free will dec it.

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

--- src/modules/engines/gl_x11/evas_x_main.c
+++ src/modules/engines/gl_x11/evas_x_main.c
@@ -401,7 +401,7 @@
    if (gw == _evas_gl_x11_window) _evas_gl_x11_window = NULL;
    if (gw->gl_context)
       {
-         ref = gw->gl_context->references;
+         ref = gw->gl_context->references - 1;
          evas_gl_common_context_free(gw->gl_context);
       }
 #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)


Fix Windows _assume warning

Fix Windows _assume warning

--- include/simdjson/generic/ondemand/json_iterator-inl.h
+++ include/simdjson/generic/ondemand/json_iterator-inl.h
@@ -179,7 +179,7 @@
   SIMDJSON_ASSUME(child_depth >= 1 && child_depth < INT32_MAX);
   SIMDJSON_ASSUME(_depth == child_depth - 1);
 #if SIMDJSON_API_USAGE_CHECKS
-  SIMDJSON_ASSUME(position >= parser->start_positions[child_depth]);
+  SIMDJSON_ASSUME(position >= parser->start_positions.get()[child_depth]);
 #endif
   token.set_position(position);
   _depth = child_depth;


Set top shelf geometry on zone.

Set top shelf geometry on zone.

SVN revision: 45471

--- src/modules/illume-indicator/e_mod_win.c
+++ src/modules/illume-indicator/e_mod_win.c
@@ -99,7 +99,7 @@
    else if (mode == ECORE_X_ILLUME_MODE_DUAL_LEFT)
      iwin->win->border->client.illume.drag.locked = 1;

-   ecore_x_e_illume_top_shelf_geometry_set(ecore_x_window_root_first_get(),
+   ecore_x_e_illume_top_shelf_geometry_set(zone->black_win,
                                            zone->x, zone->y, zone->w, 32 * e_scale);

    return iwin;


Remove dead function proto.

Remove dead function proto.

SVN revision: 44750

--- src/modules/illume-keyboard/e_mod_main.c
+++ src/modules/illume-keyboard/e_mod_main.c
@@ -7,7 +7,6 @@
 static void _il_kbd_stop(void);
 static void _il_kbd_start(void);
 static int _il_kbd_cb_exit(void *data, int type, void *event);
-//static int _il_kbd_cb_client_message(void *data, int type, void *event);

 /* local variables */
 static E_Kbd_Int *ki = NULL;


refs #100672 Merge remote-tracking branch 'origin/100672-wireshark-plugin-improvements'

* origin/100672-wireshark-plugin-improvements:
  Refs #100672 Decode the Exclude filter on an interest.

--- apps/wireshark/ccn/packet-ccn.c
+++ apps/wireshark/ccn/packet-ccn.c
@@ -353,6 +353,10 @@
     proto_item *titem;
     struct ccn_parsed_interest interest;
     struct ccn_parsed_interest *pi = &interest;
+    struct ccn_buf_decoder decoder;
+    struct ccn_buf_decoder *d;
+    const unsigned char *bloom;
+    size_t bloom_size = 0;
     struct ccn_charbuf *c;
     struct ccn_indexbuf *comps;
     const unsigned char *comp;
@@ -402,9 +406,53 @@
     /* Exclude */
     l = pi->offset[CCN_PI_E_Exclude] - pi->offset[CCN_PI_B_Exclude];
     if (l > 0) {
+        c = ccn_charbuf_create();
+        d = ccn_buf_decoder_start(&decoder, ccnb + pi->offset[CCN_PI_B_Exclude], l);
+        if (!ccn_buf_match_dtag(d, CCN_DTAG_Exclude)) {
+            ccn_charbuf_destroy(&c);
+            return(-1);
+        }
+        ccn_charbuf_append_string(c, "Exclude: ");
+        ccn_buf_advance(d);
+        if (ccn_buf_match_dtag(d, CCN_DTAG_Any)) {
+            ccn_buf_advance(d);
+            ccn_charbuf_append_string(c, "* ");
+            ccn_buf_check_close(d);
+        }
+        else if (ccn_buf_match_dtag(d, CCN_DTAG_Bloom)) {
+            ccn_buf_advance(d);
+            if (ccn_buf_match_blob(d, &bloom, &bloom_size))
+                ccn_buf_advance(d);
+            ccn_charbuf_append_string(c, "? ");
+            ccn_buf_check_close(d);
+        }
+        while (ccn_buf_match_dtag(d, CCN_DTAG_Component)) {
+            ccn_buf_advance(d);
+            comp_size = 0;
+            if (ccn_buf_match_blob(d, &comp, &comp_size))
+                ccn_buf_advance(d);
+            ccn_uri_append_percentescaped(c, comp, comp_size);
+            ccn_charbuf_append_string(c, " ");
+            ccn_buf_check_close(d);
+            if (ccn_buf_match_dtag(d, CCN_DTAG_Any)) {
+                ccn_buf_advance(d);
+                ccn_charbuf_append_string(c, "* ");
+                ccn_buf_check_close(d);
+            }
+            else if (ccn_buf_match_dtag(d, CCN_DTAG_Bloom)) {
+                ccn_buf_advance(d);
+                if (ccn_buf_match_blob(d, &bloom, &bloom_size))
+                    ccn_buf_advance(d);
+                ccn_charbuf_append_string(c, "? ");
+                ccn_buf_check_close(d);
+            }
+        }
+
         titem = proto_tree_add_text(tree, tvb, pi->offset[CCN_PI_B_Exclude], l,
-                                    "Exclude");
+                                    "%s", ccn_charbuf_as_string(c));
         exclude_tree = proto_item_add_subtree(titem, ett_exclude);
+        ccn_charbuf_destroy(&c);
+
     }
     /* ChildSelector */
     l = pi->offset[CCN_PI_E_ChildSelector] - pi->offset[CCN_PI_B_ChildSelector];


Use HessenbergDecomposition in EigenSolver.

--- Eigen/src/Eigenvalues/EigenSolver.h
+++ Eigen/src/Eigenvalues/EigenSolver.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_EIGENSOLVER_H
 #define EIGEN_EIGENSOLVER_H

+#include "./HessenbergDecomposition.h"
+
 /** \eigenvalues_module \ingroup Eigenvalues_Module
   * \nonstableyet
   *
@@ -310,82 +312,17 @@
   assert(matrix.cols() == matrix.rows());
   int n = matrix.cols();
   m_eivalues.resize(n,1);
-  m_eivec.resize(n,n);
-
-  MatrixType matH = matrix;
-  RealVectorType ort(n);

   // Reduce to Hessenberg form.
-  orthes(matH, ort);
+  HessenbergDecomposition<MatrixType> hd(matrix);
+  MatrixType matH = hd.matrixH();
+  m_eivec = hd.matrixQ();

   // Reduce Hessenberg to real Schur form.
   hqr2(matH);

   m_isInitialized = true;
   return *this;
-}
-
-// Nonsymmetric reduction to Hessenberg form.
-template<typename MatrixType>
-void EigenSolver<MatrixType>::orthes(MatrixType& matH, RealVectorType& ort)
-{
-  //  This is derived from the Algol procedures orthes and ortran,
-  //  by Martin and Wilkinson, Handbook for Auto. Comp.,
-  //  Vol.ii-Linear Algebra, and the corresponding
-  //  Fortran subroutines in EISPACK.
-
-  int n = m_eivec.cols();
-  int low = 0;
-  int high = n-1;
-
-  for (int m = low+1; m <= high-1; ++m)
-  {
-    // Scale column.
-    RealScalar scale = matH.block(m, m-1, high-m+1, 1).cwiseAbs().sum();
-    if (scale != 0.0)
-    {
-      // Compute Householder transformation.
-      RealScalar h = 0.0;
-      // FIXME could be rewritten, but this one looks better wrt cache
-      for (int i = high; i >= m; i--)
-      {
-        ort.coeffRef(i) = matH.coeff(i,m-1)/scale;
-        h += ort.coeff(i) * ort.coeff(i);
-      }
-      RealScalar g = ei_sqrt(h);
-      if (ort.coeff(m) > 0)
-        g = -g;
-      h = h - ort.coeff(m) * g;
-      ort.coeffRef(m) = ort.coeff(m) - g;
-
-      // Apply Householder similarity transformation
-      // H = (I-u*u'/h)*H*(I-u*u')/h)
-      int bSize = high-m+1;
-      matH.block(m, m, bSize, n-m).noalias() -= ((ort.segment(m, bSize)/h)
-        * (ort.segment(m, bSize).transpose() *  matH.block(m, m, bSize, n-m)));
-
-      matH.block(0, m, high+1, bSize).noalias() -= ((matH.block(0, m, high+1, bSize) * ort.segment(m, bSize))
-        * (ort.segment(m, bSize)/h).transpose());
-
-      ort.coeffRef(m) = scale*ort.coeff(m);
-      matH.coeffRef(m,m-1) = scale*g;
-    }
-  }
-
-  // Accumulate transformations (Algol's ortran).
-  m_eivec.setIdentity();
-
-  for (int m = high-1; m >= low+1; m--)
-  {
-    if (matH.coeff(m,m-1) != 0.0)
-    {
-      ort.segment(m+1, high-m) = matH.col(m-1).segment(m+1, high-m);
-
-      int bSize = high-m+1;
-      m_eivec.block(m, m, bSize, bSize).noalias() += ( (ort.segment(m, bSize) /  (matH.coeff(m,m-1) * ort.coeff(m)))
-        * (ort.segment(m, bSize).transpose() * m_eivec.block(m, m, bSize, bSize)) );
-    }
-  }
 }

 // Complex scalar division.


Bug 1048: fix unused variable warning
(grafted from a6a1d703cdd69e908e8fa605ea58927be1b096c2)

--HG--
branch : 3.2

--- Eigen/src/SparseCore/SparseVector.h
+++ Eigen/src/SparseCore/SparseVector.h
@@ -158,6 +158,7 @@

       Index inner = IsColVector ? row : col;
       Index outer = IsColVector ? col : row;
+      EIGEN_ONLY_USED_FOR_DEBUG(outer);
       eigen_assert(outer==0);
       return insert(inner);
     }


Fix warning

Fix warning

--- src/fclaw2d_convenience.c
+++ src/fclaw2d_convenience.c
@@ -849,7 +849,9 @@
     double x, y;
     double *xyentry;
     fclaw2d_block_t *block;
+#ifdef FCLAW_ENABLE_DEBUG
     fclaw2d_patch_t *patch;
+#endif
     fclaw2d_search_data_t *sd = (fclaw2d_search_data_t *) p4est->user_pointer;
     p4est_qcoord_t qh;

@@ -899,8 +901,10 @@
     FCLAW_ASSERT (block != NULL);
     now = (int) local_num - block->num_patches_before;
     FCLAW_ASSERT (0 <= now && now < block->num_patches);
+#ifdef FCLAW_ENABLE_DEBUG
     patch = block->patches + now;
     FCLAW_ASSERT (patch != NULL);
+#endif

     /* do the check a second time with the patch data */
     FCLAW_ASSERT (x >= patch->xlower && x <= patch->xupper);


Engine API: Pass structs by reference

Engine API: Pass structs by reference

--- Engine/source/console/engineTypes.h
+++ Engine/source/console/engineTypes.h
@@ -240,12 +240,12 @@
    typedef void SuperType;

    // Structs get passed in as pointers and passed out as full copies.
-   typedef T ArgumentValueType;
+   typedef T* ArgumentValueType;
    typedef T ReturnValueType;
    typedef T DefaultArgumentValueStoreType;

    typedef ReturnValueType ReturnValue;
-   static ValueType ArgumentToValue( ArgumentValueType val ) { return val; }
+   static ValueType ArgumentToValue( ArgumentValueType val ) { return *val; }

    static const EngineTypeInfo* const TYPEINFO;
 };


Update pilhad.h

Update pilhad.h


Set the correct data size

Set the correct data size

--- Alc/alsa.c
+++ Alc/alsa.c
@@ -474,7 +474,7 @@

     psnd_pcm_sw_params_free(sp);

-    data->size = psnd_pcm_frames_to_bytes(data->pcmHandle, device->UpdateSize);
+    data->size = psnd_pcm_frames_to_bytes(data->pcmHandle, bufferSizeInFrames);
     if(access == SND_PCM_ACCESS_RW_INTERLEAVED)
     {
         data->buffer = malloc(data->size);


Mix the proper size for every update, and notify disconnects

--- Alc/wave.c
+++ Alc/wave.c
@@ -49,7 +49,6 @@
     wave_data *data = (wave_data*)pDevice->ExtraData;
     ALuint frameSize;
     ALuint now, last;
-    size_t WriteCnt;
     size_t fs;
     ALuint avail;
     union {
@@ -62,7 +61,7 @@
                 aluChannelsFromFormat(pDevice->Format);

     last = timeGetTime();
-    while(!data->killNow)
+    while(!data->killNow && pDevice->Connected)
     {
         now = timeGetTime();

@@ -73,11 +72,10 @@
             continue;
         }

-        while(avail > 0)
+        while(avail >= pDevice->UpdateSize)
         {
             SuspendContext(NULL);
-            WriteCnt = min(data->size, avail);
-            aluMixData(pDevice->Context, data->buffer, WriteCnt * frameSize,
+            aluMixData(pDevice->Context, data->buffer, data->size,
                        pDevice->Format);
             ProcessContext(NULL);

@@ -86,19 +84,20 @@
                 ALubyte *bytes = data->buffer;
                 ALuint i;

-                for(i = 0;i < WriteCnt*frameSize;i++)
+                for(i = 0;i < data->size;i++)
                     fputc(bytes[i^1], data->f);
             }
             else
-                fs = fwrite(data->buffer, frameSize, WriteCnt, data->f);
+                fs = fwrite(data->buffer, frameSize, pDevice->UpdateSize,
+                            data->f);
             if(ferror(data->f))
             {
                 AL_PRINT("Error writing to file\n");
-                data->killNow = 1;
+                aluHandleDisconnect(pDevice);
                 break;
             }

-            avail -= WriteCnt;
+            avail -= pDevice->UpdateSize;
         }
         last = now;
     }


Replaced owamp_datumify with str2datum. Added tcp_listen and read_passwd_file

git-svn-id: a387e899ed10e03ab636af3ac21b4488e15ce2f7@30 a2d82226-602c-0410-bba7-e51b83dd10d2

--- Attic/owpcontrib/access.c
+++ Attic/owpcontrib/access.c
@@ -7,6 +7,7 @@
 #include <ndbm.h>
 #include <sys/stat.h>
 #include <assert.h>
+#include <netdb.h>

 /* for inet_pton */
 #include <sys/socket.h>
@@ -41,7 +42,11 @@
 				   );
 #endif

-#define DEBUG 0
+#define DEBUG   0
+#define LISTENQ 5
+#define SERV_PORT_STR "5555"
+#define KID_LEN 16
+#define PASSWD_LEN 16

 #define DEFAULT_OPEN_CLASS "open"
 #define AUTH_CLASS "authenticated"
@@ -51,15 +56,14 @@
 ** This structure is used to keep track of usage resources.
 */

-typedef struct owamp_limits{
+typedef struct owamp_limits {
 	u_int32_t bandwidth;   /* bytes/sec                          */
 	u_int32_t space;       /* bytes                              */
 	u_int8_t num_sessions; /* number of concurrent test sessions */
 } OWAMPLimits;

 typedef DBM* hash_ptr;
-hash_ptr ip2class_hash;
-hash_ptr class2limits_hash;
+hash_ptr ip2class_hash, class2limits_hash, passwd_hash;

 const char *DefaultConfigFile = DEFAULT_CONFIG_FILE;
 char *ConfigFile = NULL;
@@ -67,10 +71,13 @@
 char *IPtoClassFile = NULL;
 const char *DefaultClassToLimitsFile = DEFAULT_CLASS_TO_LIMITS_FILE;
 char *ClassToLimitsFile = NULL;
+const char *DefaultPasswdFile = DEFAULT_PASSWD_FILE;
+char *PasswdFile = NULL;

 static void
-usage()
-{
+usage(char *name)
+{
+	printf("Usage: %s [-p port] [ip address]\n", name);
 	return;
 }

@@ -102,32 +109,6 @@
 u_int32_t
 OWAMPSetNumSessions(OWAMPLimits * lim, u_int32_t ns){
 	lim->num_sessions = ns;
-}
-
-/*
-** This function parses command line options.
-*/
-
-static void
-owamp_parse_options(int argc, char *argv[])
-{
-    extern char *optarg;
-    int c;
-    ConfigFile = strdup(DefaultConfigFile);
-
-    while ((c = getopt(argc, argv, "f:h")) != -1) {
-	switch (c) {
-	case 'f':
-		ConfigFile = strdup(optarg);
-		break;
-	case 'h':
-		usage();
-		break;
-	default:
-		usage();
-		break;
-	}
-    }
 }

 /*
@@ -219,7 +200,6 @@
 ** (host byte prder), and the last byte is the mask offset.
 ** It returns 0 on success, and -1 on failure.
 */
-

 int
 owamp_parse_mask(const char *text, u_int32_t *addr, u_int8_t *off)
@@ -266,23 +246,23 @@
 	return 0;
 }

-
-
 /*
 ** This function fills out a datum structure with the given string.
 */

 datum*
-owamp_datumify(const char *bytes, int dat_len)
+str2datum(const char *bytes)
 {
 	datum *dat;
+	size_t len = strlen(bytes)+1;
+
 	if ( (dat = (void *)malloc(sizeof(datum))) == NULL)
 		return NULL;
-	if ( (dat->dptr = (void *)malloc(dat_len)) == NULL)
+	if ( (dat->dptr = (void *)malloc(len)) == NULL)
 		return NULL;

-	bcopy(bytes, dat->dptr, dat_len);
-	dat->dsize = dat_len;
+	bcopy(bytes, dat->dptr, len);
+	dat->dsize = len;
 	return dat;
 }

@@ -376,7 +356,7 @@
 		if ( (key = subnet2datum(addr, off)) == NULL)
 			continue;

-		if ( (val = owamp_datumify(class, strlen(class)+1)) == NULL )
+		if ( (val = str2datum(class)) == NULL )
 			continue;

 		if (hash_store(hash, *key, *val, DBM_REPLACE) != 0)
@@ -388,12 +368,58 @@
 	/* Assign DEFAULT_OPEN_CLASS for the widest mask. */
 	if ( (key = subnet2datum(0, 0)) == NULL)
 		goto CLOSE;
-	if ((val = owamp_datumify(DEFAULT_OPEN_CLASS, strlen(DEFAULT_OPEN_CLASS)+1)) == NULL)
+	if ( (val = str2datum(DEFAULT_OPEN_CLASS)) == NULL)
 		goto CLOSE;
 	if (hash_store(hash, *key, *val, DBM_INSERT) != 0)
 		fprintf(stderr, "\nhash_store failed to insert all key\n\n");
  CLOSE:
 	return;
+}
+
+void
+read_passwd_file(const char *passwd_file, hash_ptr hash)
+{
+	char line[MAX_LINE], kid[KID_LEN], secret[PASSWD_LEN];
+	char err_msg[1024];
+	FILE *fp;
+	u_int32_t addr;
+	u_int8_t off;
+
+	datum *key, *val;
+
+	if ( (fp = fopen(passwd_file, "r")) == NULL){
+		snprintf(err_msg, sizeof(err_msg),"fopen %s for reading",
+			passwd_file);
+		perror(err_msg);
+		exit(1);
+	}
+
+	while ( (fgets(line, sizeof(line), fp)) != NULL) {
+		if (line[0] == '#')
+			continue;
+		if (sscanf(line, "%s%s", kid, secret) != 2)
+			continue;
+
+		/* Prevent from overspilling */
+		kid[KID_LEN] = '\0';
+		secret[PASSWD_LEN] = '\0';
+		if (strlen(secret) != PASSWD_LEN){ /* bad password */
+			fprintf(stderr, "Warning: password %s is not "
+                        "%d characters long.\n", secret, PASSWD_LEN);
+			continue;
+		}
+		/* Now save the key/class pair in a hash. */
+		if ( (key = str2datum(kid)) == NULL)
+			continue;
+
+		if ( (val = str2datum(secret)) == NULL )
+			continue;
+
+		if (hash_store(hash, *key, *val, DBM_REPLACE) != 0)
+			continue;
+	}
+
+	fclose(fp);
 }

@@ -542,7 +568,7 @@
 				OWAMPSetNumSessions(&limits, numval);
 			printf("DEBUG: key = %s value =  %lu\n", key, numval);
 			}
-		printf("DEBUG: ********************************\n");
+		printf("\n");

 		/* Now save the limits structure in the hash. */
 		key_dat.dptr = (char *)class;
@@ -552,7 +578,6 @@
 		hash_store(hash, key_dat, val_dat, DBM_REPLACE);
 	}
 }
-

 void owamp_first_check(void *app_data,
 		       struct sockaddr *local,
@@ -626,18 +651,107 @@
 }

 int
+tcp_listen(const char *host, const char *serv, socklen_t *addrlenp)
+{
+	int				listenfd, n;
+	const int		on = 1;
+	struct addrinfo	hints, *res, *ressave;
+
+	bzero(&hints, sizeof(struct addrinfo));
+	hints.ai_flags = AI_PASSIVE;
+	hints.ai_family = AF_UNSPEC;
+	hints.ai_socktype = SOCK_STREAM;
+
+	if ( (n = getaddrinfo(host, serv, &hints, &res)) != 0)
+		err_quit("tcp_listen error for %s, %s: %s",
+				 host, serv, gai_strerror(n));
+	ressave = res;
+
+	do {
+		listenfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+		if (listenfd < 0)
+			continue;		/* error, try next one */
+
+		Setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+		if (bind(listenfd, res->ai_addr, res->ai_addrlen) == 0)
+			break;			/* success */
+
+		Close(listenfd);	/* bind error, close and try next one */
+	} while ( (res = res->ai_next) != NULL);
+
+	if (res == NULL)	/* errno from final socket() or bind() */
+		err_sys("tcp_listen error for %s, %s", host, serv);
+
+	Listen(listenfd, LISTENQ);
+
+	if (addrlenp)
+		*addrlenp = res->ai_addrlen;	/* return size of protocol address */
+
+	freeaddrinfo(ressave);
+
+	return(listenfd);
+}
+/* end tcp_listen */
+
+void
+do_control_client(pid_t connfd)
+{
+	;
+}
+
+void
+do_ban(int fd)
+{
+	Close(fd);
+}
+
+int
 main(int argc, char *argv[])
 {
 	char key_bytes[5];
 	datum * dat;
 	char class[128];
 	char err_msg[128];
-
-	owamp_parse_options(argc, argv);
+	int listenfd, connfd;
+	char buff[MAX_LINE];
+	struct sockaddr *cliaddr;
+	socklen_t addrlen, len;
+	extern char *optarg;
+	extern int optind;
+	int c;
+	char* port = NULL;
+	char* cmd = argv[0];
+	pid_t pid;
+	OWPErrSeverity out;
+
+	/* Parse command line options. */
+	while ((c = getopt(argc, argv, "f:p:h")) != -1) {
+		switch (c) {
+		case 'f':
+			ConfigFile = strdup(optarg);
+			break;
+		case 'h':
+			usage(argv[0]);
+			break;
+		case 'p':
+			port = strdup(optarg);
+			break;
+		default:
+			usage(cmd);
+			break;
+		}
+	}
+	argc -= optind;
+	argv += optind;
+
+	if (!port)
+		port = strdup(SERV_PORT_STR);
 	if (!IPtoClassFile)
 		IPtoClassFile = strdup(DefaultIPtoClassFile);
 	if (!ClassToLimitsFile)
 		ClassToLimitsFile = strdup(DefaultClassToLimitsFile);
+	if (!PasswdFile)
+		PasswdFile = strdup(DefaultPasswdFile);

 	/* Open the ip2class hash for writing. */
 	if ((ip2class_hash = hash_init(IPtoClassFile)) == NULL){
@@ -659,7 +773,65 @@
 	owamp_read_class2limits(ClassToLimitsFile, class2limits_hash);
 	owamp_print_class2limits(class2limits_hash);

+	/* Open the passwd hash for writing. */
+	if ((passwd_hash = hash_init(PasswdFile)) == NULL){
+		snprintf(err_msg, sizeof(err_msg),
+			 "hash_init %s.db for writing", PasswdFile);
+		perror(err_msg);
+		exit(1);
+	}
+	read_passwd_file(PasswdFile, passwd_hash);
+
+
+	if (argc == 0)
+		listenfd = tcp_listen(NULL, port, &addrlen);
+	else if (argc == 1)
+		listenfd = tcp_listen(argv[0], port, &addrlen);
+	else
+		usage(cmd);
+
+#if 0
 	test_policy_check();
+#endif
+
+	cliaddr = (void*)Malloc(addrlen);
+
+	for ( ; ; ) {
+		len = addrlen;
+#if 1
+		break; /* XXX - remove */
+#endif
+
+
+		connfd = Accept(listenfd, cliaddr, &len);
+		owamp_first_check(NULL, NULL, cliaddr, &out);
+		switch (out) {
+		case OWPErrFATAL:
+			fprintf(stderr, "DEBUG: access prohibited\n");
+			do_ban(connfd);
+			continue;
+			break;
+		case OWPErrOK:
+			fprintf(stderr, "DEBUG: access allowed\n");
+			break;
+		default:
+			fprintf(stderr, "DEBUG: policy is confused\n");
+			continue;
+			break;
+		};
+
+
+		if ( (pid = fork()) < 0)
+			sys_quit("fork");
+
+		if (pid == 0) { /* child */
+			do_control_client(connfd);
+			exit(0);
+		}
+
+		/* Parent */
+		Close(connfd);
+	}

 	hash_close(ip2class_hash);
 	hash_close(class2limits_hash);


unified naming rules,_rtgui_type => _rtgui_object

git-svn-id: 839522a79b1d56a78fa446d2fd3a0c499f8e535e@2132 bbd45198-f89e-11dd-88c7-29a3b14d5316

--- components/rtgui/common/rtgui_object.c
+++ components/rtgui/common/rtgui_object.c
@@ -29,7 +29,7 @@
 	/* nothing */
 }

-DEFINE_CLASS_TYPE(type, "object",
+DEFINE_CLASS_TYPE(object, "object",
 	RT_NULL,
 	_rtgui_object_constructor,
 	_rtgui_object_destructor,


ulp test: suppress -Wstringop-overflow and -Warray-bounds

--- components/ulp/test/ulp_fsm/test_ulp.c
+++ components/ulp/test/ulp_fsm/test_ulp.c
@@ -50,8 +50,12 @@

 TEST_CASE("ULP FSM addition test", "[ulp]")
 {
-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     /* ULP co-processor program to add data in 2 memory locations using ULP macros */
     const ulp_insn_t program[] = {
@@ -84,8 +88,12 @@
 {
     assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");

-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     /* ULP co-processor program to perform subtractions and branch to a label */
     const ulp_insn_t program[] = {
@@ -155,8 +163,12 @@
 {
     assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");

-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     /* ULP co-processor program to perform some activities and wakeup the main CPU from deep-sleep */
     const ulp_insn_t program[] = {
@@ -197,8 +209,12 @@
 {
     assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");

+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
     /* Clearout the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
     memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     /* ULP co-processor program to perform some activities and wakeup the main CPU from deep-sleep */
     const ulp_insn_t program[] = {
@@ -239,8 +255,12 @@
     /* Clear ULP timer */
     CLEAR_PERI_REG_MASK(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN);

-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     /* ULP co-processor program to read from and write to peripheral registers */
     const ulp_insn_t program[] = {
@@ -288,8 +308,12 @@
 {
     assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");

-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     /* Define the test set */
     typedef struct {
@@ -354,8 +378,12 @@
 {
     assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");

-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     /* ULP co-processor program to toggle LED */
     const ulp_insn_t program[] = {
@@ -416,12 +444,20 @@
 {
     assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 4 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");

-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     /* Put the ULP coprocessor in halt state */
     ulp_insn_t insn = I_HALT();
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
     memcpy(&RTC_SLOW_MEM[0], &insn, sizeof(insn));
+#pragma GCC diagnostic pop

     /* Set ULP timer */
     ulp_set_wakeup_period(0, 0x8000);
@@ -442,8 +478,12 @@
 {
     assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 32 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");

-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     /*
      * Run a simple ULP program which increments the counter, for one second.
@@ -503,8 +543,12 @@
 {
     assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");

-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

     // Allow TSENS to be controlled by the ULP
     SET_PERI_REG_BITS(SENS_SAR_TSENS_CTRL_REG, SENS_TSENS_CLK_DIV, 10, SENS_TSENS_CLK_DIV_S);
@@ -571,8 +615,12 @@
     const int channel = 0;
     const int atten = 0;

-    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
-    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Warray-bounds"
+    /* Clear the RTC_SLOW_MEM region for the ULP co-processor binary to be loaded */
+    memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM);
+#pragma GCC diagnostic pop

 #if defined(CONFIG_IDF_TARGET_ESP32)
     // Configure SAR ADCn resolution


firdespm: adding method for computing interpolating polynomial

--- src/filter/src/firdespm.c
+++ src/filter/src/firdespm.c
@@ -115,6 +115,16 @@
                         float * _F,
                         float * _D,
                         float * _W);
+
+// compute interpolating polynomial
+void firdespm_compute_interp(unsigned int _r,
+                             unsigned int * _iext,
+                             float * _F,
+                             float * _D,
+                             float * _W,
+                             float * _alpha,
+                             float * _x,
+                             float * _c);

 void firdespm_compute_error(unsigned int _r,
                             float * _alpha,
@@ -220,6 +230,8 @@
     float c[r+1];           // interpolated extremal values (alternating +/- rho on E)

     firdespm_init_grid(r,grid_density,num_bands,bands,des,weight,&grid_size,F,D,W);
+    printf("grid size : %u\n", grid_size);
+#if LIQUID_FIRDES_DEBUG
     FILE * fid = fopen("firdespm_grid.m","w");
     for (i=0; i<grid_size; i++) {
         fprintf(fid,"F(%4u) = %12.4e;\n", i+1, F[i]);
@@ -227,6 +239,7 @@
         fprintf(fid,"W(%4u) = %12.4e;\n", i+1, W[i]);
     }
     fclose(fid);
+#endif

     // initial guess of extremal frequencies evenly spaced on F
     for (i=0; i<=r; i++) {
@@ -239,48 +252,27 @@
     // iterate over the Remez exchange algorithm
     unsigned int p;
     for (p=0; p<max_iterations; p++) {
-        // compute Chebyshev points on F[iext[]] : cos(2*pi*f)
-        for (i=0; i<=r; i++) {
-            x[i] = cosf(2*M_PI*F[iext[i]]);
-            printf("x[%3u] = %12.8f\n", i, x[i]);
-        }
-        printf("\n");
-
-        // compute Lagrange interpolating polynomial
-        fpolyfit_lagrange_barycentric(x,r+1,alpha);
-        for (i=0; i<=r; i++)
-            printf("a[%3u] = %12.8f\n", i, alpha[i]);
-
-        // compute rho
-        float t0 = 0.0f;    // numerator
-        float t1 = 0.0f;    // denominator
-        float rho;
-        for (i=0; i<r+1; i++) {
-            t0 += alpha[i] * D[iext[i]];
-            t1 += alpha[i] / W[iext[i]] * (i % 2 ? -1.0f : 1.0f);
-        }
-        rho = t0/t1;
-        printf("  rho   :   %12.4e\n", rho);
-        printf("\n");
-
-        // compute polynomial values (interpolants)
-        for (i=0; i<=r; i++) {
-            c[i] = D[iext[i]] - (i % 2 ? -1 : 1) * rho / W[i];
-            printf("c[%3u] = %16.8e\n", i, c[i]);
-        }
-
-        // calculate error
+        // compute interpolator
+        firdespm_compute_interp(r, iext, F, D, W, alpha, x, c);
+
+        // compute error
         firdespm_compute_error(r,alpha,x,c,grid_size,F,D,W,E);
+
+#if LIQUID_FIRDES_DEBUG
         FILE * fid = fopen("error.dat","w");
         for (i=0; i<grid_size; i++)
             fprintf(fid,"%16.8e;\n", E[i]);
         fclose(fid);
+#endif

         // search for new extremal frequencies
         firdespm_iext_search(r, iext, E, grid_size);

         // TODO : check exit criteria
     }
+
+    // re-compute interpolator one last time
+    firdespm_compute_interp(r, iext, F, D, W, alpha, x, c);

 #if 0
     // evaluate Lagrange polynomial on evenly spaced points
@@ -419,6 +411,50 @@
     *_gridsize = n;

     // TODO : take care of special symmetry conditions here
+}
+
+// compute interpolating polynomial
+void firdespm_compute_interp(unsigned int _r,
+                             unsigned int * _iext,
+                             float * _F,
+                             float * _D,
+                             float * _W,
+                             float * _alpha,
+                             float * _x,
+                             float * _c)
+{
+    unsigned int i;
+
+    // compute Chebyshev points on F[iext[]] : cos(2*pi*f)
+    for (i=0; i<=_r; i++) {
+        _x[i] = cosf(2*M_PI*_F[_iext[i]]);
+        printf("x[%3u] = %12.8f\n", i, _x[i]);
+    }
+    printf("\n");
+
+    // compute Lagrange interpolating polynomial
+    fpolyfit_lagrange_barycentric(_x,_r+1,_alpha);
+    for (i=0; i<=_r; i++)
+        printf("a[%3u] = %12.8f\n", i, _alpha[i]);
+
+    // compute rho
+    float t0 = 0.0f;    // numerator
+    float t1 = 0.0f;    // denominator
+    float rho;
+    for (i=0; i<_r+1; i++) {
+        t0 += _alpha[i] * _D[_iext[i]];
+        t1 += _alpha[i] / _W[_iext[i]] * (i % 2 ? -1.0f : 1.0f);
+    }
+    rho = t0/t1;
+    printf("  rho   :   %12.4e\n", rho);
+    printf("\n");
+
+    // compute polynomial values (interpolants)
+    for (i=0; i<=_r; i++) {
+        _c[i] = _D[_iext[i]] - (i % 2 ? -1 : 1) * rho / _W[i];
+        printf("c[%3u] = %16.8e\n", i, _c[i]);
+    }
+
 }

 void firdespm_compute_error(unsigned int _r,


make ctor explicit

make ctor explicit

--- arangod/VocBase/CleanupThread.h
+++ arangod/VocBase/CleanupThread.h
@@ -36,7 +36,7 @@

 class CleanupThread : public Thread {
  public:
-  CleanupThread(TRI_vocbase_t* vocbase);
+  explicit CleanupThread(TRI_vocbase_t* vocbase);
   ~CleanupThread();

  protected:


PCI-IDE interface.

PCI-IDE interface.

error: pathspec 'arch/alpha/pci/pciide_machdep.c' did not match any file(s) known to git

--- arch/alpha/pci/pciide_machdep.c
+++ arch/alpha/pci/pciide_machdep.c
@@ -0,0 +1,70 @@
+/* $OpenBSD: pciide_machdep.c,v 1.1 1998/07/01 02:42:40 angelos Exp $ */
+/* $NetBSD: pciide_machdep.c,v 1.2 1998/04/18 01:09:20 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1998 Christopher G. Demetriou.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Christopher G. Demetriou
+ *	for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * PCI IDE controller driver (Alpha machine-dependent portion).
+ *
+ * Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
+ * sys/dev/pci/ppb.c, revision 1.16).
+ *
+ * See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the
+ * PCI SIG.
+ */
+
+#include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+
+#include <dev/isa/isavar.h>
+
+#include <dev/pci/pciidereg.h>
+#include <dev/pci/pciidevar.h>
+
+void *
+pciide_machdep_compat_intr_establish(dev, pa, chan, func, arg)
+	struct device *dev;
+	struct pci_attach_args *pa;
+	int chan;
+	int (*func) __P((void *));
+	void *arg;
+{
+	pci_chipset_tag_t pc = pa->pa_pc;
+
+	return (alpha_pciide_compat_intr_establish(pc, dev, pa, chan,
+	    func, arg));
+}


Fix defaults in ReactionFp parameter struct

--- Code/GraphMol/ChemReactions/ReactionFingerprints.h
+++ Code/GraphMol/ChemReactions/ReactionFingerprints.h
@@ -68,9 +68,9 @@

 	  ReactionFingerprintParams():
 		includeAgents(false),
-		bitRatioAgents(0.0),
+		bitRatioAgents(0.2),
 		nonAgentWeight(10),
-		agentWeight(0),
+		agentWeight(1),
 		fpSize(2048),
 		fpType(AtomPairFP){}


Bug 724590 - GSlice slab_stack corruption

Dereference allocation->contention_counters before trying to take the
address of an element.

--- glib/gslice.c
+++ glib/gslice.c
@@ -715,7 +715,8 @@
 magazine_cache_pop_magazine (guint  ix,
                              gsize *countp)
 {
-  g_mutex_lock_a (&allocator->magazine_mutex, &allocator->contention_counters[ix]);
+  guint *counters = allocator->contention_counters;
+  g_mutex_lock_a (&allocator->magazine_mutex, &counters[ix]);
   if (!allocator->magazines[ix])
     {
       guint magazine_threshold = allocator_get_magazine_threshold (allocator, ix);


W32: Make _g_win32_get_system_data_dirs() inline available in C++

This way g_get_system_data_dirs() works the same way in C and C++.

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

Closes #1240

--- glib/gutils.h
+++ glib/gutils.h
@@ -83,7 +83,7 @@
 const gchar * const * g_win32_get_system_data_dirs_for_module (void (*address_of_function)(void));
 #endif

-#if defined (G_OS_WIN32) && defined (G_CAN_INLINE) && !defined (__cplusplus)
+#if defined (G_OS_WIN32) && defined (G_CAN_INLINE)
 /* This function is not part of the public GLib API either. Just call
  * g_get_system_data_dirs() in your code, never mind that that is
  * actually a macro and you will in fact call this inline function.


Add missing include for vivtc

Add missing include for vivtc

--- src/filters/vivtc/vivtc.c
+++ src/filters/vivtc/vivtc.c
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2012 Fredrik Mellbin
+* Copyright (c) 2012-2014 Fredrik Mellbin
 *
 * This file is part of VapourSynth.
 *
@@ -25,6 +25,7 @@
 #include <math.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stddef.h>
 #ifdef _WIN32
 #include <windows.h>
 #endif


pca100: clean up GPIO pin multiplexing

pca100: clean up GPIO pin multiplexing

cleaned up some duplicated mxc_gpio_mode calls and move the correpsonding
pin multiplexing either into the initial pin config table or ifdef blocks.

Signed-off-by: Luotao Fu <85ed96e8394e24a331a1a2a9131a782ad665de22@pengutronix.de>
Signed-off-by: Sascha Hauer <c00cbc2b736c26791a3822db86f8796fe9efff67@pengutronix.de>

--- arch/arm/mach-mx2/mach-pca100.c
+++ arch/arm/mach-mx2/mach-pca100.c
@@ -55,6 +55,9 @@

 #define OTG_PHY_CS_GPIO (GPIO_PORTB + 23)
 #define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24)
+#define SPI1_SS0 (GPIO_PORTD + 28)
+#define SPI1_SS1 (GPIO_PORTD + 27)
+#define SD2_CD (GPIO_PORTC + 29)

 static int pca100_pins[] = {
 	/* UART1 */
@@ -69,6 +72,7 @@
 	PB7_PF_SD2_D3,
 	PB8_PF_SD2_CMD,
 	PB9_PF_SD2_CLK,
+	SD2_CD | GPIO_GPIO | GPIO_IN,
 	/* FEC */
 	PD0_AIN_FEC_TXD0,
 	PD1_AIN_FEC_TXD1,
@@ -156,6 +160,10 @@
 	PA28_PF_HSYNC,
 	PA29_PF_VSYNC,
 	PA31_PF_OE_ACD,
+	/* free GPIO */
+	GPIO_PORTC | 31 | GPIO_GPIO | GPIO_IN, /* GPIO0_IRQ */
+	GPIO_PORTC | 25 | GPIO_GPIO | GPIO_IN, /* GPIO1_IRQ */
+	GPIO_PORTE | 5 | GPIO_GPIO | GPIO_IN, /* GPIO2_IRQ */
 };

 static struct imxuart_platform_data uart_pdata = {
@@ -214,7 +222,7 @@
 	},
 };

-static int pca100_spi_cs[] = {GPIO_PORTD + 28, GPIO_PORTD + 27};
+static int pca100_spi_cs[] = {SPI1_SS0, SPI1_SS1};

 static struct spi_imx_master pca100_spi_0_data = {
 	.chipselect	= pca100_spi_cs,
@@ -388,7 +396,6 @@

 	mxc_register_device(&mxc_uart_device0, &uart_pdata);

-	mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN);
 	mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);

 	mxc_register_device(&imx27_nand_device, &pca100_nand_board_info);
@@ -399,17 +406,9 @@

 	mxc_register_device(&mxc_i2c_device1, &pca100_i2c_1_data);

-	mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
-	mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_OUT);
-
-	/* GPIO0_IRQ */
-	mxc_gpio_mode(GPIO_PORTC | 31 | GPIO_GPIO | GPIO_IN);
-	/* GPIO1_IRQ */
-	mxc_gpio_mode(GPIO_PORTC | 25 | GPIO_GPIO | GPIO_IN);
-	/* GPIO2_IRQ */
-	mxc_gpio_mode(GPIO_PORTE | 5 | GPIO_GPIO | GPIO_IN);
-
 #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
+	mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN);
+	mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN);
 	spi_register_board_info(pca100_spi_board_info,
 				ARRAY_SIZE(pca100_spi_board_info));
 	mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data);


OMAP3 clock: Fixed processing of bootarg 'mpurate'

The argument 'mpurate' had no effect on the MPU
frequency. This patch fixes the same.

Signed-off-by: Sanjeev Premi <98839ec877592dbbc79844e7a6884f5b7cc4e82e@ti.com>
Signed-off-by: Paul Walmsley <a027184a55211cd23e3f3094f1fdc728df5e0500@pwsan.com>

--- arch/arm/mach-omap2/clock34xx.c
+++ arch/arm/mach-omap2/clock34xx.c
@@ -27,6 +27,7 @@
 #include <linux/limits.h>
 #include <linux/bitops.h>

+#include <mach/cpu.h>
 #include <mach/clock.h>
 #include <mach/sram.h>
 #include <asm/div64.h>
@@ -1067,17 +1068,17 @@
 		return -EINVAL;

 	/* REVISIT: not yet ready for 343x */
-#if 0
-	if (clk_set_rate(&virt_prcm_set, mpurate))
-		printk(KERN_ERR "Could not find matching MPU rate\n");
-#endif
+	if (clk_set_rate(&dpll1_ck, mpurate))
+		printk(KERN_ERR "*** Unable to set MPU rate\n");

 	recalculate_root_clocks();

-	printk(KERN_INFO "Switched to new clocking rate (Crystal/DPLL3/MPU): "
+	printk(KERN_INFO "Switched to new clocking rate (Crystal/Core/MPU): "
 	       "%ld.%01ld/%ld/%ld MHz\n",
-	       (osc_sys_ck.rate / 1000000), (osc_sys_ck.rate / 100000) % 10,
-	       (core_ck.rate / 1000000), (dpll1_fck.rate / 1000000)) ;
+	       (osc_sys_ck.rate / 1000000), ((osc_sys_ck.rate / 100000) % 10),
+	       (core_ck.rate / 1000000), (arm_fck.rate / 1000000)) ;
+
+	calibrate_delay();

 	return 0;
 }
@@ -1136,7 +1137,7 @@

 	recalculate_root_clocks();

-	printk(KERN_INFO "Clocking rate (Crystal/DPLL/ARM core): "
+	printk(KERN_INFO "Clocking rate (Crystal/Core/MPU): "
 	       "%ld.%01ld/%ld/%ld MHz\n",
 	       (osc_sys_ck.rate / 1000000), (osc_sys_ck.rate / 100000) % 10,
 	       (core_ck.rate / 1000000), (arm_fck.rate / 1000000));


Blackfin: smp: add smp_mb() to keep coherency

After use generic smp helpers, smp_mb() should be added to keep coherency.

Signed-off-by: Steven Miao <eb4bb6630d9afd913be5ae87090c50ac1ba7a4b2@gmail.com>
Signed-off-by: Bob Liu <d77a20a83082b67b4fa80a32c4df5692104d5480@gmail.com>

--- arch/blackfin/mach-common/smp.c
+++ arch/blackfin/mach-common/smp.c
@@ -146,7 +146,7 @@
 	platform_clear_ipi(cpu, IRQ_SUPPLE_1);

 	bfin_ipi_data = &__get_cpu_var(bfin_ipi);
-
+	smp_mb();
 	while ((pending = xchg(&bfin_ipi_data->bits, 0)) != 0) {
 		msg = 0;
 		do {
@@ -195,7 +195,7 @@
 	unsigned long flags;

 	local_irq_save(flags);
-
+	smp_mb();
 	for_each_cpu(cpu, cpumask) {
 		bfin_ipi_data = &per_cpu(bfin_ipi, cpu);
 		smp_mb();


Clean up code - sort headers, remove __OpenBSD__ #ifdefs and ansify
function declarations.

ok kettenis@

--- arch/hppa/stand/mkboot/mkboot.c
+++ arch/hppa/stand/mkboot/mkboot.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: mkboot.c,v 1.17 2013/10/17 08:02:15 deraadt Exp $	*/
+/*	$OpenBSD: mkboot.c,v 1.18 2014/01/22 09:18:04 jsing Exp $	*/

 /*
  * Copyright (c) 1990, 1993
@@ -32,18 +32,18 @@
  */

 #include <sys/param.h>
+#include <sys/exec.h>
+#include <sys/exec_elf.h>
 #include <sys/file.h>
 #include <sys/stat.h>
+
+#include <ctype.h>
+#include <err.h>
+#include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
-#include <stdlib.h>
+#include <time.h>
 #include <unistd.h>
-#include <time.h>
-#ifdef __OpenBSD__
-#include <err.h>
-#endif
-
-#include <sys/exec.h>
-#include <sys/exec_elf.h>

 #ifndef hppa
 /* hack for cross compile XXX */
@@ -52,9 +52,6 @@
 #include <sys/disklabel.h>
 #endif

-#include <stdio.h>
-#include <ctype.h>
-
 int putfile(char *, int);
 void __dead usage(void);
 void bcddate(char *, char *);
@@ -64,9 +61,6 @@
 char *to_file;
 int loadpoint, verbose;
 u_long entry;
-#ifndef __OpenBSD__
-char *__progname = "mkboot";
-#endif

 /*
  * Old Format:
@@ -178,13 +172,11 @@
 	if (close(to) < 0)
 		err(1, "%s", to_file);

-	return(0);
+	return (0);
 }

 int
-putfile(from_file, to)
-	char *from_file;
-	int to;
+putfile(char *from_file, int to)
 {
 	struct exec ex;
 	register int n, total;
@@ -313,10 +305,7 @@
 }

 int
-cksum(ck, p, size)
-	int ck;
-	int *p;
-	int size;
+cksum(int ck, int *p, int size)
 {
 	/* we assume size is int-aligned */
 	for (size = (size + sizeof(int) - 1) / sizeof(int); size--; p++ )
@@ -326,7 +315,7 @@
 }

 void __dead
-usage()
+usage(void)
 {
 	extern char *__progname;
 	fprintf(stderr,
@@ -336,8 +325,7 @@
 }

 char *
-lifname(str)
-	char *str;
+lifname(char *str)
 {
 	static char lname[10] = "XXXXXXXXXX";
 	register int i;
@@ -358,26 +346,10 @@

 void
-bcddate(file, toc)
-	char *file;
-	char *toc;
+bcddate(char *file, char *toc)
 {
 	struct stat statb;
-#ifndef __OpenBSD__
-	struct tm {
-		int tm_sec;    /* second (0-61, allows for leap seconds) */
-		int tm_min;    /* minute (0-59) */
-		int tm_hour;   /* hour (0-23) */
-		int tm_mday;   /* day of the month (1-31) */
-		int tm_mon;    /* month (0-11) */
-		int tm_year;   /* years since 1900 */
-		int tm_wday;   /* day of the week (0-6) */
-		int tm_yday;   /* day of the year (0-365) */
-		int tm_isdst;  /* non-0 if daylight saving time is in effect */
-	} *tm;
-#else
 	struct tm *tm;
-#endif

 	stat(file, &statb);
 	tm = localtime(&statb.st_ctime);
@@ -394,23 +366,3 @@
 	*toc = (tm->tm_sec / 10) << 4;
 	*toc |= tm->tm_sec % 10;
 }
-
-#ifndef __OpenBSD__
-int
-err(ex, str)
-	int ex;
-	char *str;
-{
-	perror(str);
-	exit(ex);
-}
-
-int
-errx(ex, str)
-	int ex;
-	char *str;
-{
-	perror(str);
-	exit(ex);
-}
-#endif


put missed changes that support booting from floppy (;
i applodgize for any inconvinience this memory hole caused to people.

ps. i would like to know the snapshots schedule to issue extra testing
cycles to ensure i did not forget anything.

--- arch/i386/stand/libsa/biosdev.c
+++ arch/i386/stand/libsa/biosdev.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: biosdev.c,v 1.51 1998/04/18 07:39:42 deraadt Exp $	*/
+/*	$OpenBSD: biosdev.c,v 1.52 1998/06/11 02:30:57 mickey Exp $	*/

 /*
  * Copyright (c) 1996 Michael Shalayeff
@@ -307,30 +307,36 @@
 	if(bd->bios_heads == 0 || bd->bios_sectors == 0)
 		return("failed to read disklabel");

-	/* Read MBR */
-	btochs(DOSBBSECTOR, cyl, head, sect, bd->bios_heads, bd->bios_sectors);
-
-	error = biosd_io(F_READ, bd->bios_number, cyl, head, sect, 1, &mbr);
-	if(error)
-		return(biosdisk_err(error));
-
-	/* check mbr signature */
-	if (mbr.dmbr_sign != DOSMBR_SIGNATURE)
-		return("bad MBR signature\n");
-
-	/* Search for OpenBSD partition */
-	for (off = 0, i = 0; off == 0 && i < NDOSPART; i++)
-		if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_OPENBSD)
-			off = mbr.dmbr_parts[i].dp_start + LABELSECTOR;
-
-	/* just in case */
-	if (off == 0)
+	/* MBR is a hard thing */
+	if (bd->bios_number & 0x80) {
+		/* Read MBR */
+		btochs(DOSBBSECTOR, cyl, head, sect,
+		       bd->bios_heads, bd->bios_sectors);
+
+		error = biosd_io(F_READ, bd->bios_number,
+				 cyl, head, sect, 1, &mbr);
+		if(error)
+			return(biosdisk_err(error));
+
+		/* check mbr signature */
+		if (mbr.dmbr_sign != DOSMBR_SIGNATURE)
+			return("bad MBR signature\n");
+
+		/* Search for OpenBSD partition */
 		for (off = 0, i = 0; off == 0 && i < NDOSPART; i++)
-			if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_NETBSD)
+			if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_OPENBSD)
 				off = mbr.dmbr_parts[i].dp_start + LABELSECTOR;

-	if (off == 0)
-		return("no BSD partition\n");
+		/* just in case */
+		if (off == 0)
+			for (off = 0, i = 0; off == 0 && i < NDOSPART; i++)
+				if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_NETBSD)
+					off = mbr.dmbr_parts[i].dp_start + LABELSECTOR;
+
+		if (off == 0)
+			return("no BSD partition\n");
+	} else
+		off = LABELSECTOR;

 	/* Load BSD disklabel */
 	buf = alloca(DEV_BSIZE);


fix cylinders in getdiskinfo get EDD fot hd* only more debug

--- arch/i386/stand/libsa/biosdev.c
+++ arch/i386/stand/libsa/biosdev.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: biosdev.c,v 1.41 1997/10/24 01:38:50 weingart Exp $	*/
+/*	$OpenBSD: biosdev.c,v 1.42 1997/10/24 17:16:53 mickey Exp $	*/

 /*
  * Copyright (c) 1996 Michael Shalayeff
@@ -70,11 +70,15 @@
 	int dev;
 	bios_diskinfo_t *pdi;
 {
-	u_int rv, bm, sgn;
+	u_int rv, bm;
+#ifdef BIOS_DEBUG
+	printf("getinfo: try #8, %x,%p\n", dev, pdi);
+#endif
+	BIOS_regs.biosr_ds = BIOS_regs.biosr_es = 0;
 	__asm __volatile (DOINT(0x13) "\n\t"
 			  "setc %b0; movzbl %h1, %1\n\t"
 			  "movzbl %%cl, %3; andb $0x3f, %b3\n\t"
-			  "xchgb %%cl, %%ch; rorb $2, %%ch"
+			  "xchgb %%cl, %%ch; rolb $2, %%ch"
 			  : "=a" (rv), "=d" (pdi->bios_heads),
 			    "=c" (pdi->bios_cylinders),
 			    "=b" (pdi->bios_sectors)
@@ -85,18 +89,22 @@
 	pdi->bios_heads++;
 	pdi->bios_cylinders &= 0x3ff;
 	pdi->bios_cylinders++;
-
-	if (rv & 0xff)
+#ifdef BIOS_DEBUG
+	printf("getinfo: got #8\n");
+#endif
+	if (rv & 0xff || !pdi->bios_cylinders)
 		return(1);

-	/* EDD support check */
-	__asm __volatile(DOINT(0x13) "; setc %b0"
-		 : "=a" (rv), "=c" (bm), "=b" (sgn)
-		 : "0" (0x4400), "2" (0x55aa) : "%edx", "cc");
-	if (!(rv & 0xff) && (sgn & 0xffff) == 0xaa55)
-		pdi->bios_edd = bm & 0xffff;
-	else
-		pdi->bios_edd = -1;
+	if (dev & 0x80) {
+		/* EDD support check */
+		__asm __volatile(DOINT(0x13) "; setc %b0"
+			 : "=a" (rv), "=c" (bm)
+			 : "0" (0x4100), "2" (0x55aa), "d" (dev) : "cc");
+		if (!(rv & 0xff) && (BIOS_regs.biosr_bx & 0xffff) == 0xaa55)
+			pdi->bios_edd = bm & 0xffff;
+		else
+			pdi->bios_edd = -1;
+	}

 	/*
 	 * NOTE: This seems to hang on certain machines.  Use function #8
@@ -104,10 +112,9 @@
 	 */
 	__asm __volatile (DOINT(0x13) "; setc %b0"
 		: "=a" (rv) : "0" (0x1500), "d" (dev) : "%ecx", "cc");
-
 	if(!(rv & 0xff00))
 		return(1);
-	if(rv & 0x00ff)
+	if(rv & 0xff)
 		return(1);

 	return(0);


MIPS: GT641xx: Convert timer lock to raw spinlock.

Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>

--- arch/mips/kernel/cevt-gt641xx.c
+++ arch/mips/kernel/cevt-gt641xx.c
@@ -25,7 +25,7 @@
 #include <asm/gt64120.h>
 #include <asm/time.h>

-static DEFINE_SPINLOCK(gt641xx_timer_lock);
+static DEFINE_RAW_SPINLOCK(gt641xx_timer_lock);
 static unsigned int gt641xx_base_clock;

 void gt641xx_set_base_clock(unsigned int clock)
@@ -49,7 +49,7 @@
 {
 	u32 ctrl;

-	spin_lock(&gt641xx_timer_lock);
+	raw_spin_lock(&gt641xx_timer_lock);

 	ctrl = GT_READ(GT_TC_CONTROL_OFS);
 	ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -58,7 +58,7 @@
 	GT_WRITE(GT_TC0_OFS, delta);
 	GT_WRITE(GT_TC_CONTROL_OFS, ctrl);

-	spin_unlock(&gt641xx_timer_lock);
+	raw_spin_unlock(&gt641xx_timer_lock);

 	return 0;
 }
@@ -68,7 +68,7 @@
 {
 	u32 ctrl;

-	spin_lock(&gt641xx_timer_lock);
+	raw_spin_lock(&gt641xx_timer_lock);

 	ctrl = GT_READ(GT_TC_CONTROL_OFS);
 	ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -86,7 +86,7 @@

 	GT_WRITE(GT_TC_CONTROL_OFS, ctrl);

-	spin_unlock(&gt641xx_timer_lock);
+	raw_spin_unlock(&gt641xx_timer_lock);
 }

 static void gt641xx_timer0_event_handler(struct clock_event_device *dev)


Fixed bug in GRegEx() for OS X

Fixed bug in GRegEx() for OS X

--- src/FrcSim.h
+++ src/FrcSim.h
@@ -1,129 +0,0 @@
-#ifndef TEMPLATEGAME_H_
-#define TEMPLATEGAME_H_
-
-#include "gameplay.h"
-
-using namespace gameplay;
-
-#define VERT_SHADER "res/shaders/textured.vert"
-#define FRAG_SHADER "res/shaders/textured.frag"
-#define DEF_SHADER "SPOT_LIGHT_COUNT 1; TEXTURE_DISCARD_ALPHA"
-
-/**
- * Main game class.
- */
-class AerialAssist: public Game
-{
-public:
-
-    const static GFileName _kFieldBundle;
-    const static GFileName _kRobotBundle;
-
-    /**
-     * Constructor.
-     */
-    AerialAssist();
-
-    /**
-     * @see Game::keyEvent
-     */
-	void keyEvent(Keyboard::KeyEvent evt, int key);
-
-    /**
-     * @see Game::touchEvent
-     */
-    void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);
-
-protected:
-
-    /**
-     * @see Game::initialize
-     */
-    void initialize();
-
-    /**
-     * @see Game::finalize
-     */
-    void finalize();
-
-    /**
-     * @see Game::update
-     */
-    void update(float elapsedTime);
-
-    /**
-     * @see Game::render
-     */
-    void render(float elapsedTime);
-
-    /**
-     *
-     */
-    void setMaterial(Node* node_ptr, const char* diffuse_string_ptr, const char* normal_string_ptr, float specularity);
-
-    /**
-     *
-     */
-    static void drawFrameRate(Font* font, const Vector4& color, unsigned int x, unsigned int y, unsigned int fps);
-
-    // render variables & methods
-    Node* _camera_h_node;
-    Node* _camera_v_node;
-    Node* _spotlight_node;
-    Node* _floor_node;
-    Node* _robot_node;
-    Node* _catapult_node;
-    Camera* _camera;
-    Node* _light_node;
-    Light* _light;
-    Light* _spotlight;
-
-    double _elapsedTime;
-
-private:
-
-    /**
-     * Adds a node to the appropriate render queue (opaque or transparent)
-     * based on the "transparent" tag set in the node.  The "transparent"
-     * tag is set by loadTextureMap() based on the "transparent" boolean
-     * in the JSON file.
-     */
-    bool buildRenderQueues(Node* node);
-
-    /**
-     * Sets the material for a node and binds it to the scene's light sources.
-     */
-    bool setSceneMaterial(Node* node);
-
-    /**
-     *
-     */
-    void createFloorModels(void);
-
-    /**
-     *
-     */
-    Mesh* createFloorMesh(void);
-
-    /**
-     *
-     */
-    void loadTextureMap(const string &filename);
-
-    // Render queue indexes (in order of drawing).
-    enum RenderQueue
-    {
-        QUEUE_OPAQUE = 0,
-        QUEUE_TRANSPARENT,
-        QUEUE_COUNT
-    };
-
-    vector<Node*> _renderQueues[QUEUE_COUNT];
-    Scene* _scene;
-    Font* _font;
-    bool _wireframe;
-
-    map<string, GPair<string, bool> > textureList;
-};
-
-#endif


use pmap functions instead of getpte/setpte hacks

--- arch/sparc/sparc/db_interface.c
+++ arch/sparc/sparc/db_interface.c
@@ -163,11 +163,6 @@
 }

-/*
- * XXX - stolen from pmap.c
- */
-#define	getpte(va)		lda(va, ASI_PTE)
-#define	setpte(va, pte)		sta(va, ASI_PTE, pte)
 #define	splpmap() splimp()

 static void
@@ -175,25 +170,22 @@
 	unsigned char *dst;
 	int ch;
 {
-	int s, pte0, pte;
 	vm_offset_t va;
+	int s;

 	s = splpmap();
 	va = (unsigned long)dst & (~PGOFSET);
-	pte0 = getpte(va);
-
-	if ((pte0 & PG_V) == 0) {
+
+	if (pmap_extract(pmap_kernel(), va) == 0) {
 		db_printf(" address 0x%x not a valid page\n", dst);
 		splx(s);
 		return;
 	}

-	pte = pte0 | PG_W;
-	setpte(va, pte);
-
+	pmap_changeprot(pmap_kernel(), va, VM_PROT_ALL, 0);
 	*dst = (unsigned char)ch;
-
-	setpte(va, pte0);
+	pmap_protect(pmap_kernel(), va, va, VM_PROT_READ|VM_PROT_EXECUTE);
+
 	splx(s);
 }


intr_disable() returns an u_int64_t.

intr_disable() returns an u_int64_t.

--- arch/sparc64/sparc64/ipifuncs.c
+++ arch/sparc64/sparc64/ipifuncs.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: ipifuncs.c,v 1.5 2007/11/16 16:20:55 kettenis Exp $	*/
+/*	$OpenBSD: ipifuncs.c,v 1.6 2007/11/27 19:00:26 kettenis Exp $	*/
 /*	$NetBSD: ipifuncs.c,v 1.8 2006/10/07 18:11:36 rjs Exp $ */

 /*-
@@ -79,7 +79,7 @@

 	/* Schedule an interrupt. */
 	for (i = 0; i < SPARC64_IPI_RETRIES; i++) {
-		int s = intr_disable();
+		u_int64_t s = intr_disable();

 		stxa(IDDR_0H, ASI_INTERRUPT_DISPATCH, (u_int64_t)func);
 		stxa(IDDR_1H, ASI_INTERRUPT_DISPATCH, arg0);


x86/boot-image: Don't leak phdrs in arch/x86/boot/compressed/misc.c::Parse_elf()

We allocate memory with malloc(), but neglect to free it before
the variable 'phdrs' goes out of scope --> leak.

Signed-off-by: Jesper Juhl <7323a5431d1c31072983a6a5bf23745b655ddf59@chaosbits.net>
Link: 000ef2bef927931ac85cee10f8f99c06e60bde66@swampdragon.chaosbits.net
[ Mostly harmless. ]
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- arch/x86/boot/compressed/misc.c
+++ arch/x86/boot/compressed/misc.c
@@ -321,6 +321,8 @@
 		default: /* Ignore other PT_* */ break;
 		}
 	}
+
+	free(phdrs);
 }

 asmlinkage void decompress_kernel(void *rmode, memptr heap,


made it so you can access ivar of contentView in inputtoolbar

--- JSQMessagesViewController/Views/JSQMessagesInputToolbar.h
+++ JSQMessagesViewController/Views/JSQMessagesInputToolbar.h
@@ -58,7 +58,9 @@
  *  composing a new message. It is displayed above and follow the movement of
  *  the system keyboard.
  */
-@interface JSQMessagesInputToolbar : UIToolbar
+@interface JSQMessagesInputToolbar : UIToolbar {
+@protected JSQMessagesToolbarContentView __weak *_contentView;
+} // this is so that we can actually access the toolbar content view's ivar in the subclasses.

 /**
  *  The object that acts as the delegate of the toolbar.


Fix sqFileAtEnd logic to test if the file position is >= file size instead of ==.

git-svn-id: http://squeakvm.org/svn/squeak/trunk@2161 fa1542d4-bde8-0310-ad64-8ed1123d492a

Former-commit-id: 51602129b3c1b1b918152811576e45036df73fcf

--- FilePlugin/sqFilePluginBasicPrims.c
+++ FilePlugin/sqFilePluginBasicPrims.c
@@ -114,7 +114,7 @@
 	/* Return true if the file's read/write head is at the end of the file. */

 	if (!sqFileValid(f)) return interpreterProxy->success(false);
-	return ftell(getFile(f)) == getSize(f);
+	return ftell(getFile(f)) >= getSize(f);
 }

 sqInt sqFileClose(SQFile *f) {


Use vsprintf instead of rolling our own.

PR:		bin/140496
Submitted by:	Jeremy Huddleston <jeremyhu apple.com>
MFC after:	1 month


Slight stylification.

Slight stylification.


Use decimap_point from localeconv() instead of hardcoded '.'

Obtained from:	inspired by NetBSD strtod

--- lib/libc/stdlib/strtod.c
+++ lib/libc/stdlib/strtod.c
@@ -134,6 +134,7 @@
 #define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
 #endif

+#include <locale.h>
 #ifdef __cplusplus
 #include "malloc.h"
 #include "memory.h"
@@ -1202,6 +1203,8 @@
 	long L;
 	unsigned long y, z;
 	Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
+	char decimal_point = localeconv()->decimal_point[0];
+
 	sign = nz0 = nz = 0;
 	rv = 0.;
 	for (s = s00;;s++) switch(*s) {
@@ -1235,7 +1238,7 @@
 		else if (nd < 16)
 			z = 10*z + c - '0';
 	nd0 = nd;
-	if (c == '.') {
+	if ((char)c == decimal_point) {
 		c = *++s;
 		if (!nd) {
 			for (; c == '0'; c = *++s)


git-svn-id: https://www.imagemagick.org/subversion/ImageMagick/branches/ImageMagick-6@12272 aa41f4f7-0bf4-0310-aa73-e5a19afd5a74

--- coders/label.c
+++ coders/label.c
@@ -139,63 +139,64 @@
       image->columns=(size_t) (metrics.width+draw_info->stroke_width+0.5);
       image->rows=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
     }
-  if (((image->columns == 0) || (image->rows == 0)) ||
-      (fabs(image_info->pointsize) < MagickEpsilon))
-    {
-      double
-        high,
-        low;
-
-      /*
-        Auto fit text into bounding box.
-      */
-      for ( ; ; draw_info->pointsize*=2.0)
+  else
+    if (((image->columns == 0) || (image->rows == 0)) ||
+        (fabs(image_info->pointsize) < MagickEpsilon))
       {
-        (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",
-          -metrics.bounds.x1,metrics.ascent);
-        if (draw_info->gravity == UndefinedGravity)
-          (void) CloneString(&draw_info->geometry,geometry);
-        status=GetMultilineTypeMetrics(image,draw_info,&metrics);
-        (void) status;
-        width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
-        height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
-        if ((image->columns != 0) && (image->rows != 0))
-          {
-            if ((width > image->columns) && (height > image->rows))
+        double
+          high,
+          low;
+
+        /*
+          Auto fit text into bounding box.
+        */
+        for ( ; ; draw_info->pointsize*=2.0)
+        {
+          (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",
+            -metrics.bounds.x1,metrics.ascent);
+          if (draw_info->gravity == UndefinedGravity)
+            (void) CloneString(&draw_info->geometry,geometry);
+          status=GetMultilineTypeMetrics(image,draw_info,&metrics);
+          (void) status;
+          width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
+          height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
+          if ((image->columns != 0) && (image->rows != 0))
+            {
+              if ((width > image->columns) && (height > image->rows))
+                break;
+            }
+          else
+            if (((image->columns != 0) && (width > image->columns)) ||
+                ((image->rows != 0) && (height > image->rows)))
               break;
-          }
-        else
-          if (((image->columns != 0) && (width > image->columns)) ||
-              ((image->rows != 0) && (height > image->rows)))
-            break;
-      }
-      high=draw_info->pointsize;
-      for (low=1.0; (high-low) > 1.0; )
-      {
-        draw_info->pointsize=(low+high)/2.0;
-        (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",
-          -metrics.bounds.x1,metrics.ascent);
-        if (draw_info->gravity == UndefinedGravity)
-          (void) CloneString(&draw_info->geometry,geometry);
-        status=GetMultilineTypeMetrics(image,draw_info,&metrics);
-        width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
-        height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
-        if ((image->columns != 0) && (image->rows != 0))
-          {
-            if ((width <= image->columns) && (height <= image->rows))
+        }
+        high=draw_info->pointsize;
+        for (low=1.0; (high-low) > 1.0; )
+        {
+          draw_info->pointsize=(low+high)/2.0;
+          (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",
+            -metrics.bounds.x1,metrics.ascent);
+          if (draw_info->gravity == UndefinedGravity)
+            (void) CloneString(&draw_info->geometry,geometry);
+          status=GetMultilineTypeMetrics(image,draw_info,&metrics);
+          width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
+          height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
+          if ((image->columns != 0) && (image->rows != 0))
+            {
+              if ((width <= image->columns) && (height <= image->rows))
+                low=draw_info->pointsize+1.0;
+              else
+                high=draw_info->pointsize-1.0;
+            }
+          else
+            if (((image->columns != 0) && (width < image->columns)) ||
+                ((image->rows != 0) && (height < image->rows)))
               low=draw_info->pointsize+1.0;
             else
               high=draw_info->pointsize-1.0;
-          }
-        else
-          if (((image->columns != 0) && (width < image->columns)) ||
-              ((image->rows != 0) && (height < image->rows)))
-            low=draw_info->pointsize+1.0;
-          else
-            high=draw_info->pointsize-1.0;
+        }
+        draw_info->pointsize=(low+high)/2.0-1.0;
       }
-      draw_info->pointsize=(low+high)/2.0-1.0;
-    }
   status=GetMultilineTypeMetrics(image,draw_info,&metrics);
   if (status == MagickFalse)
     {


INTEGRATION: CWS odkaddonexample (1.1.2); FILE ADDED 2006/05/05 14:15:41 cd 1.1.2.1: #i65116# New demo add-on using the complex toolbar controls

error: pathspec 'odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h' did not match any file(s) known to git

--- odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h
+++ odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h
@@ -0,0 +1,91 @@
+#include <vector>
+#include <hash_map>
+
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_
+#include <com/sun/star/frame/XStatusListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FEATURESTATEEVENT_HPP_
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
+#include <com/sun/star/frame/XDispatch.hpp>
+#endif
+
+#include <rtl/ustring.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+struct hashObjectName_Impl
+{
+    size_t operator()(const ::rtl::OUString Str) const
+    {
+        return (size_t)Str.hashCode();
+    }
+};
+
+struct eqObjectName_Impl
+{
+    sal_Bool operator()(const ::rtl::OUString Str1, const ::rtl::OUString Str2) const
+    {
+        return ( Str1 == Str2 );
+    }
+};
+
+typedef std::vector < com::sun::star::uno::Reference < com::sun::star::frame::XStatusListener > > StatusListeners;
+
+typedef std::hash_map
+<
+    ::rtl::OUString,
+    StatusListeners,
+    hashObjectName_Impl,
+    eqObjectName_Impl
+>
+ListenerMap;
+
+// For every frame there is *one* Dispatch object for all possible commands
+// this struct contains an array of listeners for every supported command
+// these arrays are accessed by a hash_map (with the command string as index)
+struct ListenerItem
+{
+    ListenerMap aContainer;
+    ::com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > xDispatch;
+    ::com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame;
+};
+
+typedef std::vector < ListenerItem > AllListeners;
+
+class ListenerHelper
+{
+public:
+    void AddListener(
+        const com::sun::star::uno::Reference < com::sun::star::frame::XFrame >& xFrame,
+        const com::sun::star::uno::Reference < com::sun::star::frame::XStatusListener > xControl,
+        const ::rtl::OUString& aCommand );
+    void RemoveListener(
+        const com::sun::star::uno::Reference < com::sun::star::frame::XFrame >& xFrame,
+        const com::sun::star::uno::Reference < com::sun::star::frame::XStatusListener > xControl,
+        const ::rtl::OUString& aCommand );
+    void Notify(
+        const com::sun::star::uno::Reference < com::sun::star::frame::XFrame >& xFrame,
+        const ::rtl::OUString& aCommand,
+        com::sun::star::frame::FeatureStateEvent& rEvent );
+    com::sun::star::uno::Reference < com::sun::star::frame::XDispatch > GetDispatch(
+        const com::sun::star::uno::Reference < com::sun::star::frame::XFrame >& xFrame,
+        const ::rtl::OUString& aCommand );
+    void AddDispatch(
+        const com::sun::star::uno::Reference < com::sun::star::frame::XDispatch > xDispatch,
+        const com::sun::star::uno::Reference < com::sun::star::frame::XFrame >& xFrame,
+        const ::rtl::OUString& aCommand );
+};
+
+class ListenerItemEventListener : public cppu::WeakImplHelper1 < ::com::sun::star::lang::XEventListener >
+{
+    ::com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame;
+public:
+    ListenerItemEventListener( const com::sun::star::uno::Reference < com::sun::star::frame::XFrame >& xFrame)
+        : mxFrame(xFrame)
+    {}
+    virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& aEvent ) throw (com::sun::star::uno::RuntimeException);
+};


acl: fix 32-bit match for range field

acl: fix 32-bit match for range field

ACL build phase for range fields that are bigger then
16 bits might generate wrong trie.
For more details please refer to:
https://bugs.dpdk.org/show_bug.cgi?id=307

Bugzilla ID: 307
Fixes: dc276b5780c2 ("acl: new library")
Cc: stable@dpdk.org

Reported-by: Ido Goshen <9bf660e90dbb8f09e938a5703dac0e6c6d0031d5@cgstowernetworks.com>
Signed-off-by: Konstantin Ananyev <cbd5212b59ab42a210d72992d23a3aa17cfd3eaf@intel.com>

--- lib/librte_acl/acl_bld.c
+++ lib/librte_acl/acl_bld.c
@@ -778,9 +778,8 @@
 }

 static void
-acl_gen_range(struct acl_build_context *context,
-	const uint8_t *hi, const uint8_t *lo, int size, int level,
-	struct rte_acl_node *root, struct rte_acl_node *end)
+acl_gen_full_range(struct acl_build_context *context, struct rte_acl_node *root,
+	struct rte_acl_node *end, int size, int level)
 {
 	struct rte_acl_node *node, *prev;
 	uint32_t n;
@@ -788,10 +787,71 @@
 	prev = root;
 	for (n = size - 1; n > 0; n--) {
 		node = acl_alloc_node(context, level++);
-		acl_add_ptr_range(context, prev, node, lo[n], hi[n]);
+		acl_add_ptr_range(context, prev, node, 0, UINT8_MAX);
 		prev = node;
 	}
-	acl_add_ptr_range(context, prev, end, lo[0], hi[0]);
+	acl_add_ptr_range(context, prev, end, 0, UINT8_MAX);
+}
+
+static void
+acl_gen_range_mdl(struct acl_build_context *context, struct rte_acl_node *root,
+	struct rte_acl_node *end, uint8_t lo, uint8_t hi, int size, int level)
+{
+	struct rte_acl_node *node;
+
+	node = acl_alloc_node(context, level++);
+	acl_add_ptr_range(context, root, node, lo, hi);
+	acl_gen_full_range(context, node, end, size - 1, level);
+}
+
+static void
+acl_gen_range_low(struct acl_build_context *context, struct rte_acl_node *root,
+	struct rte_acl_node *end, const uint8_t *lo, int size, int level)
+{
+	struct rte_acl_node *node;
+	uint32_t n;
+
+	n = size - 1;
+	if (n == 0) {
+		acl_add_ptr_range(context, root, end, lo[0], UINT8_MAX);
+		return;
+	}
+
+	node = acl_alloc_node(context, level++);
+	acl_add_ptr_range(context, root, node, lo[n], lo[n]);
+
+	/* generate lower-bound sub-trie */
+	acl_gen_range_low(context, node, end, lo, n, level);
+
+	/* generate middle sub-trie */
+	if (n > 1 && lo[n - 1] != UINT8_MAX)
+		acl_gen_range_mdl(context, node, end, lo[n - 1] + 1, UINT8_MAX,
+			n, level);
+}
+
+static void
+acl_gen_range_high(struct acl_build_context *context, struct rte_acl_node *root,
+	struct rte_acl_node *end, const uint8_t *hi, int size, int level)
+{
+	struct rte_acl_node *node;
+	uint32_t n;
+
+	n = size - 1;
+	if (n == 0) {
+		acl_add_ptr_range(context, root, end, 0, hi[0]);
+		return;
+	}
+
+	node = acl_alloc_node(context, level++);
+	acl_add_ptr_range(context, root, node, hi[n], hi[n]);
+
+	/* generate upper-bound sub-trie */
+	acl_gen_range_high(context, node, end, hi, n, level);
+
+	/* generate middle sub-trie */
+	if (n > 1 && hi[n - 1] != 0)
+		acl_gen_range_mdl(context, node, end, 0, hi[n - 1] - 1,
+			n, level);
 }

 static struct rte_acl_node *
@@ -799,52 +859,56 @@
 	const void *min, const void *max,
 	int size, int level, struct rte_acl_node **pend)
 {
-	int32_t n;
-	struct rte_acl_node *root;
-	const uint8_t *lo = min;
-	const uint8_t *hi = max;
-
-	*pend = acl_alloc_node(context, level+size);
+	int32_t k, n;
+	uint8_t hi_ff, lo_00;
+	struct rte_acl_node *node, *prev, *root;
+	const uint8_t *lo;
+	const uint8_t *hi;
+
+	lo = min;
+	hi = max;
+
+	*pend = acl_alloc_node(context, level + size);
 	root = acl_alloc_node(context, level++);
-
-	if (lo[size - 1] == hi[size - 1]) {
-		acl_gen_range(context, hi, lo, size, level, root, *pend);
-	} else {
-		uint8_t limit_lo[64];
-		uint8_t limit_hi[64];
-		uint8_t hi_ff = UINT8_MAX;
-		uint8_t lo_00 = 0;
-
-		memset(limit_lo, 0, RTE_DIM(limit_lo));
-		memset(limit_hi, UINT8_MAX, RTE_DIM(limit_hi));
-
-		for (n = size - 2; n >= 0; n--) {
-			hi_ff = (uint8_t)(hi_ff & hi[n]);
-			lo_00 = (uint8_t)(lo_00 | lo[n]);
-		}
-
-		if (hi_ff != UINT8_MAX) {
-			limit_lo[size - 1] = hi[size - 1];
-			acl_gen_range(context, hi, limit_lo, size, level,
-				root, *pend);
-		}
-
-		if (lo_00 != 0) {
-			limit_hi[size - 1] = lo[size - 1];
-			acl_gen_range(context, limit_hi, lo, size, level,
-				root, *pend);
-		}
-
-		if (hi[size - 1] - lo[size - 1] > 1 ||
-				lo_00 == 0 ||
-				hi_ff == UINT8_MAX) {
-			limit_lo[size-1] = (uint8_t)(lo[size-1] + (lo_00 != 0));
-			limit_hi[size-1] = (uint8_t)(hi[size-1] -
-				(hi_ff != UINT8_MAX));
-			acl_gen_range(context, limit_hi, limit_lo, size,
-				level, root, *pend);
-		}
-	}
+	prev = root;
+
+	/* build common sub-trie till possible */
+	for (n = size - 1; n > 0 && lo[n] == hi[n]; n--) {
+		node = acl_alloc_node(context, level++);
+		acl_add_ptr_range(context, prev, node, lo[n], hi[n]);
+		prev = node;
+	}
+
+	/* no branch needed, just one sub-trie */
+	if (n == 0) {
+		acl_add_ptr_range(context, prev, *pend, lo[0], hi[0]);
+		return root;
+	}
+
+	/* gather information about divirgent paths */
+	lo_00 = 0;
+	hi_ff = UINT8_MAX;
+	for (k = n - 1; k >= 0; k--) {
+		hi_ff &= hi[k];
+		lo_00 |= lo[k];
+	}
+
+	/* generate left (lower-bound) sub-trie */
+	if (lo_00 != 0)
+		acl_gen_range_low(context, prev, *pend, lo, n + 1, level);
+
+	/* generate right (upper-bound) sub-trie */
+	if (hi_ff != UINT8_MAX)
+		acl_gen_range_high(context, prev, *pend, hi, n + 1, level);
+
+	/* generate sub-trie in the middle */
+	if (lo[n] + 1 != hi[n] || lo_00 == 0 || hi_ff == UINT8_MAX) {
+		lo_00 = lo[n] + (lo_00 != 0);
+		hi_ff = hi[n] - (hi_ff != UINT8_MAX);
+		acl_gen_range_mdl(context, prev, *pend, lo_00, hi_ff,
+			n + 1, level);
+	}
+
 	return root;
 }


ifreq must be zeroed before using

ifreq must be zeroed before using

--- glue/device.c
+++ glue/device.c
@@ -19,9 +19,10 @@
 {
     struct ifreq ifr;
     struct sockaddr *sa = ifreq_getaddr(0,&ifr);
-    struct sockaddr_in *sin = satocsin(sa);
+    struct sockaddr_in *sin = satosin(sa);
     int rc;

+    memset(&ifr,0,sizeof(ifr));
     sin->sin_len = sizeof(struct sockaddr_in);
     sin->sin_family = AF_INET;
     sin->sin_addr.s_addr = ip_addr;


another attempt to fix freind issue with bijection

--- Library/Sources/Stroika/Foundation/Containers/Bijection.h
+++ Library/Sources/Stroika/Foundation/Containers/Bijection.h
@@ -495,7 +495,8 @@
 #if __cpp_impl_three_way_comparison < 201907
     private:
         DISABLE_COMPILER_GCC_WARNING_START ("GCC diagnostic ignored \"-Wnon-template-friend\"");
-        friend bool operator== (const Bijection& lhs, const Bijection& rhs);
+        template<typename D, typename R>
+        friend bool operator== (const Bijection<D, R>& lhs, const Bijection<D, R>& rhs);
         DISABLE_COMPILER_GCC_WARNING_END ("GCC diagnostic ignored \"-Wnon-template-friend\"");
 #endif
     };