efivarfs-storage: Remove useless check

efivarfs-storage: Remove useless check

It was using `realpath` to avoid writing to some location that
was not on `/sys/firmware/efi/efivars` - but it was fundamentally
flawed: `realpath` only check a file that already exists, and that may
not always be the case. In fact, will never be the case for first
writing.
Removed check for reading also, as again, one may read a value not yet
persisted - common case, Soletta persistence has default values for it.

Signed-off-by: Ederson de Souza <1da3dd06fbb9d545ec21e96bca6ffa5cba52ede5@intel.com>

--- src/lib/io/sol-efivarfs-storage.c
+++ src/lib/io/sol-efivarfs-storage.c
@@ -62,18 +62,6 @@
 static const int EFIVARS_DEFAULT_ATTR = 0x7;

 static bool
-check_realpath(const char *path)
-{
-    char real_path[PATH_MAX];
-
-    if (realpath(path, real_path)) {
-        return strstartswith(real_path, EFIVARFS_VAR_DIR);
-    }
-
-    return false;
-}
-
-static bool
 perform_pending_write(void *data)
 {
     FILE *file = NULL;
@@ -97,17 +85,6 @@
             sol_util_strerrora(errno));
         pending_write->status = -errno;
         goto callback;
-    }
-
-    if (!check_realpath(path)) {
-        /* At this point, a file on an invalid location may have been created.
-         * Should we care about it? Is there a 'realpath()' that doesn't need
-         * the file to exist? Or a string path santiser? */
-        SOL_WRN("Invalid pending_write->name for efivars persistence packet [%s]",
-            pending_write->name);
-        pending_write->status = -EINVAL;
-
-        goto close;
     }

     fwrite(&EFIVARS_DEFAULT_ATTR, sizeof(EFIVARS_DEFAULT_ATTR), 1, file);
@@ -234,10 +211,6 @@
         SOL_WRN("Could not create path for efivars persistence file [%s]", path);
         return -EINVAL;
     }
-    if (!check_realpath(path)) {
-        SOL_WRN("Invalid name for efivars persistence packet [%s]", name);
-        return -EINVAL;
-    }

     fd = open(path, O_RDONLY | O_CLOEXEC);
     if (fd < 0) {


Fixed SelectInstrSet, now we change APSR when we do the switch

--- src/libemulation/arm/ARMContext.h
+++ src/libemulation/arm/ARMContext.h
@@ -247,8 +247,28 @@
     }

     void SelectInstrSet(ARMMode instruction_set) {
-        if (instruction_set == ARMMode_ARM && CurrentInstrSet() == ARMMode_ThumbEE)
-            UNPREDICTABLE();
+        switch (instruction_set) {
+            case InstrSet_ARM:
+                if (CurrentInstrSet() == InstrSet_ThumbEE) UNPREDICTABLE();
+                CPSR.J = 0;
+                CPSR.T = 0;
+                break;
+
+            case InstrSet_Thumb:
+                CPSR.J = 0;
+                CPSR.T = 1;
+                break;
+
+            case InstrSet_Jazelle:
+                CPSR.J = 1;
+                CPSR.T = 0;
+                break;
+
+            case InstrSet_ThumbEE:
+                CPSR.J = 1;
+                CPSR.T = 1;
+                break;
+        }

         m_opcode_mode = instruction_set;
     }


fix material theme init

fix material theme init

--- src/lv_themes/lv_theme_material.c
+++ src/lv_themes/lv_theme_material.c
@@ -872,8 +872,10 @@
                                     const lv_font_t * font_title)
 {

-    LV_GC_ROOT(_lv_theme_material_styles) = lv_mem_alloc(sizeof(theme_styles_t));
-    styles = (theme_styles_t *)LV_GC_ROOT(_lv_theme_material_styles);
+    if(!inited) {
+        LV_GC_ROOT(_lv_theme_material_styles) = lv_mem_alloc(sizeof(theme_styles_t));
+        styles = (theme_styles_t *)LV_GC_ROOT(_lv_theme_material_styles);
+    }

     theme.color_primary = color_primary;
     theme.color_secondary = color_secondary;


free hll val_lists, hll op error messages

--- src/main/client/cdt_hll_operate.c
+++ src/main/client/cdt_hll_operate.c
@@ -184,27 +184,33 @@
     bool policy_in_use = false;

     if (get_int(err, AS_PY_HLL_INDEX_BIT_COUNT, op_dict, &index_bit_count) != AEROSPIKE_OK) {
-        return err->code;
+        goto cleanup;
     }

     if (get_hll_policy(err, op_dict, &hll_policy, &policy_in_use) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_val_list(self, err, AS_PY_VALUES_KEY, op_dict, &value_list, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (as_operations_hll_add(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, value_list, index_bit_count) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (ctx_in_use) {
-        as_cdt_ctx_destroy(&ctx);
+        goto cleanup;
+    }
+
+    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (get_val_list(self, err, AS_PY_VALUES_KEY, op_dict, &value_list, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (! as_operations_hll_add(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, value_list, index_bit_count)) {
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_add operation.");
+        goto cleanup;
+    }
+
+cleanup:
+    if (ctx_in_use) {
+        as_cdt_ctx_destroy(&ctx);
+    }
+
+    if (value_list) {
+        as_val_destroy(value_list);
     }

     return err->code;
@@ -224,32 +230,37 @@
     bool policy_in_use = false;

     if (get_int(err, AS_PY_HLL_INDEX_BIT_COUNT, op_dict, &index_bit_count) != AEROSPIKE_OK) {
-        return err->code;
+        goto cleanup;
     }

     if (get_int(err, AS_PY_HLL_MH_BIT_COUNT_KEY, op_dict, &mh_bit_count) != AEROSPIKE_OK) {
-        return err->code;
+        goto cleanup;
     }

     if (get_hll_policy(err, op_dict, &hll_policy, &policy_in_use) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_val_list(self, err, AS_PY_VALUES_KEY, op_dict, &value_list, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (as_operations_hll_add_mh(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, value_list, index_bit_count, mh_bit_count) != AEROSPIKE_OK) {
-        //TODO destroy val_list
-        return err->code;
-    }
-
-    if (ctx_in_use) {
-        as_cdt_ctx_destroy(&ctx);
+        goto cleanup;
+    }
+
+    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (get_val_list(self, err, AS_PY_VALUES_KEY, op_dict, &value_list, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (! as_operations_hll_add_mh(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, value_list, index_bit_count, mh_bit_count)) {\
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_add_mh operation.");
+        goto cleanup;
+    }
+
+cleanup:
+    if (ctx_in_use) {
+        as_cdt_ctx_destroy(&ctx);
+    }
+
+    if (value_list) {
+        as_val_destroy(value_list);
     }

     return err->code;
@@ -267,21 +278,23 @@
     bool policy_in_use = false;

     if (get_int(err, AS_PY_HLL_INDEX_BIT_COUNT, op_dict, &index_bit_count) != AEROSPIKE_OK) {
-        return err->code;
+        goto cleanup;
     }

     if (get_hll_policy(err, op_dict, &hll_policy, &policy_in_use) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (as_operations_hll_init(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, index_bit_count) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
+        goto cleanup;
+    }
+
+    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (! as_operations_hll_init(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, index_bit_count)) {
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_init operation.");
+        goto cleanup;
+    }
+
+cleanup:
     if (ctx_in_use) {
         as_cdt_ctx_destroy(&ctx);
     }
@@ -302,25 +315,27 @@
     bool policy_in_use = false;

     if (get_int(err, AS_PY_HLL_INDEX_BIT_COUNT, op_dict, &index_bit_count) != AEROSPIKE_OK) {
-        return err->code;
+        goto cleanup;
     }

     if (get_int(err, AS_PY_HLL_MH_BIT_COUNT_KEY, op_dict, &mh_bit_count) != AEROSPIKE_OK) {
-        return err->code;
+        goto cleanup;
     }

     if (get_hll_policy(err, op_dict, &hll_policy, &policy_in_use) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (as_operations_hll_init_mh(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, index_bit_count, mh_bit_count) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
+        goto cleanup;
+    }
+
+    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (! as_operations_hll_init_mh(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, index_bit_count, mh_bit_count)) {
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_init_mh operation.");
+        goto cleanup;
+    }
+
+cleanup:
     if (ctx_in_use) {
         as_cdt_ctx_destroy(&ctx);
     }
@@ -340,7 +355,8 @@
         goto cleanup;
     }

-    if (as_operations_hll_get_count(ops, bin, NULL) != AEROSPIKE_OK){
+    if (! as_operations_hll_get_count(ops, bin, NULL)){
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_get_count operation.");
         goto cleanup;
     }

@@ -361,13 +377,15 @@
     bool ctx_in_use = false;

     if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (as_operations_hll_describe(ops, bin, NULL) != AEROSPIKE_OK){
-        return err->code;
-    }
-
+        goto cleanup;
+    }
+
+    if (! as_operations_hll_describe(ops, bin, NULL)){
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_describe operation.");
+        goto cleanup;
+    }
+
+cleanup:
     if (ctx_in_use) {
         as_cdt_ctx_destroy(&ctx);
     }
@@ -385,17 +403,19 @@
     int index_bit_count;

     if (get_int(err, AS_PY_HLL_INDEX_BIT_COUNT, op_dict, &index_bit_count) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (as_operations_hll_fold(ops, bin, NULL, index_bit_count) != AEROSPIKE_OK){
-        return err->code;
-    }
-
+        goto cleanup;
+    }
+
+    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (! as_operations_hll_fold(ops, bin, NULL, index_bit_count)){
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_fold operation.");
+        goto cleanup;
+    }
+
+cleanup:
     if (ctx_in_use) {
         as_cdt_ctx_destroy(&ctx);
     }
@@ -420,7 +440,8 @@
         goto cleanup;
     }

-    if (as_operations_hll_get_intersect_count(ops, bin, NULL, value_list) != AEROSPIKE_OK){
+    if (! as_operations_hll_get_intersect_count(ops, bin, NULL, value_list)){
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_get_intersect_count operation.");
         goto cleanup;
     }

@@ -453,7 +474,8 @@
         goto cleanup;
     }

-    if (as_operations_hll_get_similarity(ops, bin, NULL, value_list) != AEROSPIKE_OK){
+    if (! as_operations_hll_get_similarity(ops, bin, NULL, value_list)){
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_get_similarity operation.");
         goto cleanup;
     }

@@ -486,7 +508,8 @@
         goto cleanup;
     }

-    if (as_operations_hll_get_union(ops, bin, NULL, value_list) != AEROSPIKE_OK){
+    if (! as_operations_hll_get_union(ops, bin, NULL, value_list)){
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_get_union operation.");
         goto cleanup;
     }

@@ -520,7 +543,8 @@
         goto cleanup;
     }

-    if (as_operations_hll_get_union_count(ops, bin, NULL, value_list) != AEROSPIKE_OK){
+    if (! as_operations_hll_get_union_count(ops, bin, NULL, value_list)){
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_get_union_count operation.");
         goto cleanup;
     }

@@ -545,13 +569,15 @@
     bool ctx_in_use = false;

     if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (as_operations_hll_refresh_count(ops, bin, NULL) != AEROSPIKE_OK){
-        return err->code;
-    }
-
+        goto cleanup;
+    }
+
+    if (! as_operations_hll_refresh_count(ops, bin, NULL)){
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_refresh_count operation.");
+        goto cleanup;
+    }
+
+cleanup:
     if (ctx_in_use) {
         as_cdt_ctx_destroy(&ctx);
     }
@@ -575,14 +601,15 @@
     }

     if (get_hll_policy(err, op_dict, &hll_policy, &policy_in_use) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_val_list(self, err, AS_PY_VALUES_KEY, op_dict, &value_list, static_pool, serializer_type) != AEROSPIKE_OK) {
-        goto cleanup;
-    }
-
-    if (as_operations_hll_set_union(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, value_list) != AEROSPIKE_OK){
+        goto cleanup;
+    }
+
+    if (get_val_list(self, err, AS_PY_VALUES_KEY, op_dict, &value_list, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (! as_operations_hll_set_union(ops, bin, NULL, policy_in_use ? &hll_policy : NULL, value_list)){
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_set_union operation.");
         goto cleanup;
     }

@@ -610,23 +637,29 @@
     bool policy_in_use = false;

     if (get_hll_policy(err, op_dict, &hll_policy, &policy_in_use) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (get_val_list(self, err, AS_PY_VALUES_KEY, op_dict, &value_list, static_pool, serializer_type) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (as_operations_hll_update(ops, bin, NULL, &hll_policy, value_list) != AEROSPIKE_OK) {
-        return err->code;
-    }
-
-    if (ctx_in_use) {
-        as_cdt_ctx_destroy(&ctx);
+        goto cleanup;
+    }
+
+    if (get_cdt_ctx(self, err, &ctx, op_dict, &ctx_in_use, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (get_val_list(self, err, AS_PY_VALUES_KEY, op_dict, &value_list, static_pool, serializer_type) != AEROSPIKE_OK) {
+        goto cleanup;
+    }
+
+    if (! as_operations_hll_update(ops, bin, NULL, &hll_policy, value_list)) {
+        as_error_update(err, AEROSPIKE_ERR_CLIENT, "Failed to add hll_update operation.");
+        goto cleanup;
+    }
+
+cleanup:
+    if (ctx_in_use) {
+        as_cdt_ctx_destroy(&ctx);
+    }
+
+    if (value_list) {
+        as_val_destroy(value_list);
     }

     return err->code;


message buffer size pre-calculated, fixes aplite


Fixed a typo in cbor_value_is_byte_string documentation

--- src/cborparser.c
+++ src/cborparser.c
@@ -935,7 +935,7 @@
 /**
  * \fn bool cbor_value_is_byte_string(const CborValue *value)
  *
- * Returns true if the iterator \a value is valid and points to a CBOR text
+ * Returns true if the iterator \a value is valid and points to a CBOR byte
  * string. CBOR byte strings are binary data with no specified encoding or
  * format.
  *


cgi-client: remove redundant eof check from _direct()

At this point, the previous call should have detected EOF already.

--- src/cgi-client.c
+++ src/cgi-client.c
@@ -362,15 +362,6 @@
     cgi->had_input = true;
     cgi->had_output = true;

-    if (cgi->remaining == 0) {
-        stopwatch_event(cgi->stopwatch, "end");
-        stopwatch_dump(cgi->stopwatch);
-
-        istream_close_handler(cgi->input);
-        istream_deinit_eof(&cgi->output);
-        return ISTREAM_RESULT_CLOSED;
-    }
-
     if (cgi->remaining != -1 && (off_t)max_length > cgi->remaining)
         max_length = (size_t)cgi->remaining;


initialization of var a,b int;

initialization of
var a,b int;

R=r
OCL=16318
CL=16318

--- src/cmd/6g/gen.c
+++ src/cmd/6g/gen.c
@@ -896,11 +896,15 @@
 	if(nl == N)
 		return;

-	tl = nl->type;
-	if(tl == T)
-		return;
-
 	if(nr == N || isnil(nr)) {
+		if(nl->op == OLIST) {
+			cgen_as(nl->left, nr, op);
+			cgen_as(nl->right, nr, op);
+			return;
+		}
+		tl = nl->type;
+		if(tl == T)
+			return;
 		if(isfat(tl)) {
 			/* clear a fat object */
 			if(debug['g'])
@@ -977,6 +981,10 @@
 		nr->addable = 1;
 		ullmancalc(nr);
 	}
+
+	tl = nl->type;
+	if(tl == T)
+		return;

 	cgen(nr, nl);


typeswitch - expression evaluated
twice instead of once.

R=r
OCL=27015
CL=27015

--- src/cmd/gc/swt.c
+++ src/cmd/gc/swt.c
@@ -788,7 +788,7 @@

 	a = syslook("ifacethash", 1);
 	argtype(a, sw->ntest->right->type);
-	a = nod(OCALL, a, sw->ntest->right);
+	a = nod(OCALL, a, facename);
 	a = nod(OAS, hashname, a);
 	cas = list(cas, a);


playing with mouse colors

playing with mouse colors

--- src/game.c
+++ src/game.c
@@ -13,7 +13,7 @@
     int mx,my;
     float mf = 0;
     Sprite *mouse;
-    Vector4D mouseColor = {100,255,255,200};
+    Vector4D mouseColor = {255,100,255,200};

     /*program initializtion*/
     init_logger("gf2d.log");


Allocate and clean perft moves at each stage otherwise we run out of heap

--- src/game.c
+++ src/game.c
@@ -11,7 +11,7 @@
 #include "moves/king_moves.h"
 #include "moves/pawn_attacks.h"

-int board_perft(Board* board, MoveNode* moves, int level);
+int board_perft(Board* board, int level);

 int is_valid_pseudo_move(Board* board, Move move);
 void filter_pseudo_moves(Board* board, MoveNode* movenode);
@@ -63,7 +63,7 @@

 int perft(Game* game, int level)
 {
-    return board_perft(&game->board, &game->moves, level);
+    return board_perft(&game->board, level);
 }

 void divide(Game* game, int level)
@@ -75,34 +75,28 @@
     	return;
     }

-    if (!game->moves.children)
-    {
-		MoveNode* genMoves = generate_moves(&game->board);
-		game->moves.children = genMoves->children;
-		game->moves.numChildren = genMoves->numChildren;
-		game->moves.maxChildren = genMoves->maxChildren;
-		free(genMoves);
-    }
-
-    for (i = 0; i < game->moves.numChildren; ++i)
+	MoveNode* genMoves = generate_moves(&game->board);
+
+    for (i = 0; i < genMoves->numChildren; ++i)
     {
     	int numMoves = 0;
     	char moveString[8];
-    	sprint_move(moveString, game->moves.children[i].move);
-
-    	make_move(&game->board, &game->moves.children[i].move);
-    	numMoves = board_perft(&game->board, &game->moves.children[i], level - 1);
-    	unmake_move(&game->board, game->moves.children[i].move);
+    	sprint_move(moveString, genMoves->children[i].move);
+    	printf("%s ", moveString);
+
+    	make_move(&game->board, &genMoves->children[i].move);
+    	numMoves = board_perft(&game->board, level - 1);
+    	unmake_move(&game->board, genMoves->children[i].move);

     	totalMoves += numMoves;
-    	printf("%s: %i\n", moveString, numMoves);
+    	printf("%i\n", numMoves);
     }

-    printf("\nMoves: %i\n", game->moves.numChildren);
+    printf("\nMoves: %i\n", genMoves->numChildren);
     printf("Nodes: %i\n", totalMoves);
 }

-int board_perft(Board* board, MoveNode* moves, int level)
+int board_perft(Board* board, int level)
 {
 	int i;
 	int perft = 0;
@@ -112,21 +106,16 @@
 		return 1;
 	}

-	if (!moves->children)
-	{
-		MoveNode* genMoves = generate_moves(board);
-		moves->children = genMoves->children;
-		moves->numChildren = genMoves->numChildren;
-		moves->maxChildren = genMoves->maxChildren;
-		free(genMoves);
-	}
-
-	for (i = 0; i < moves->numChildren; ++i)
-	{
-		make_move(board, &moves->children[i].move);
-		perft += board_perft(board, &moves->children[i], level - 1);
-		unmake_move(board, moves->children[i].move);
-	}
+	MoveNode* genMoves = generate_moves(board);
+
+	for (i = 0; i < genMoves->numChildren; ++i)
+	{
+		make_move(board, &genMoves->children[i].move);
+		perft += board_perft(board, level - 1);
+		unmake_move(board, genMoves->children[i].move);
+	}
+
+	free_move_node(genMoves);

 	return perft;
 }
@@ -536,7 +525,7 @@
 			add_move(movenode, move);

 			captures = clear_lsb(captures);
-		}
+		}
 		allRooks = clear_lsb(allRooks);
 	}
 }


Adding doxygen comments and a new field to keep authorization string.

--- src/gcal.c
+++ src/gcal.c
@@ -27,10 +27,16 @@
 static const char TRAILING_FIELD[] = "service=cl&source=libgcal";

+/** Library structure. It holds resources (curl, buffer, etc).
+ */
 struct gcal_resource {
-
+	/** Memory buffer */
 	char *buffer;
+	/** Its length */
 	size_t length;
+	/** gcalendar authorization */
+	char *auth;
+	/** curl data structure */
 	CURL *curl;
 };


Updated code formatting under gdns_thread_create().

--- src/gdns.c
+++ src/gdns.c
@@ -286,12 +286,11 @@
 void
 gdns_thread_create (void)
 {
-  int thread;
+  int th;

   active_gdns = 1;
-  thread =
-    pthread_create (&(gdns_thread.thread), NULL, (void *) &dns_worker, NULL);
-  if (thread)
-    FATAL ("Return code from pthread_create(): %d", thread);
+  th = pthread_create (&(gdns_thread.thread), NULL, (void *) &dns_worker, NULL);
+  if (th)
+    FATAL ("Return code from pthread_create(): %d", th);
   pthread_detach (gdns_thread.thread);
 }


info_man_systems_lab1: small fixes

info_man_systems_lab1: small fixes

--- info_man_systems/lab1/src/src/lab.c
+++ info_man_systems/lab1/src/src/lab.c
@@ -15,29 +15,27 @@

 #define LAB_DIP_VALUE 0x44
 #define MAX_TICKS 6
+#define LEFT 0xC0
+#define RIGHT 0x07
 void main( void ) {
-	unsigned char animation_counter = 0x07;
 	unsigned char left = 0xC0;
 	unsigned char right = 0x07;
 	unsigned char cnt = 0;
-

 	while(1) {
 		unsigned char dip_value = dip();

 		if(dip_value == LAB_DIP_VALUE) {

-			leds(0x00);
-			if(cnt < 6){
-				leds((left >> cnt) | (right << cnt));
+			if(cnt < MAX_TICKS){
+				leds((LEFT >> cnt) | (RIGHT << cnt));
 			}else{
-				leds((left >> (12 - cnt)) | (right << (12 - cnt)));
+				leds((LEFT >> (MAX_TICKS * 2 - cnt)) | (RIGHT << (MAX_TICKS * 2 - cnt)));
 			}
 			cnt++;
-			if(cnt > 12) cnt = 0;
+			if(cnt > MAX_TICKS * 2) cnt = 0;
 		} else {
 			leds(~dip_value);
-			animation_counter = 0x07;
 		}

 		delay(100);


Antialiasing;

Antialiasing;

Why not.

--- src/glfw.c
+++ src/glfw.c
@@ -18,6 +18,7 @@
   glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
   glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
   glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
+  glfwWindowHint(GLFW_SAMPLES, 4);

   window = glfwCreateWindow(800, 600, "Window", NULL, NULL);


Abramo Bagnara <abramo@alsa-project.org> Thu, 09 Dec 1999 09:56:47 +0100 Rate plugin is now ready for optimizations (I've verified reading asm generated that loop unrolling is not fully satisfactory, I'll try another solution later today).

--- src/pcm/plugin/rate.c
+++ src/pcm/plugin/rate.c
@@ -56,38 +56,42 @@
 {
 	unsigned int pos;
 	signed int val;
-	signed short *S1, *S2;
+	signed short S1, S2;
 	int voice;
+	signed short *src, *dst;
+	int size;

-	pos = data->pos;
-	S1 = data->last_S1;
-	S2 = data->last_S2;
-	if (pos >> SHIFT) {
-		src_ptr += ((pos >> SHIFT) - 1) * voices; pos &= MASK;
-		for (voice = 0; voice < voices; ++voice) {
-			S1[voice] = S2[voice];
-			S2[voice] = src_ptr[voice];
+	for (voice = 0; voice < voices; ++voice) {
+		pos = data->pos;
+		S1 = data->last_S1[voice];
+		S2 = data->last_S2[voice];
+		src = src_ptr + voice;
+		dst = dst_ptr + voice;
+		size = dst_size;
+		if (pos >> SHIFT) {
+			src += ((pos >> SHIFT) - 1) * voices;
+			pos &= MASK;
+			S1 = S2;
+			S2 = *src;
 		}
-	}
-	while (dst_size-- > 0) {
-		if (pos >> SHIFT) {
-			src_ptr += (pos >> SHIFT) * voices; pos &= MASK;
-			for (voice = 0; voice < voices; ++voice) {
-				S1[voice] = S2[voice];
-				S2[voice] = src_ptr[voice];
+		while (size-- > 0) {
+			if (pos >> SHIFT) {
+				src += (pos >> SHIFT) * voices;
+				pos &= MASK;
+				S1 = S2;
+				S2 = *src;
 			}
-		}
-
-		for (voice = 0; voice < voices; ++voice) {
-			val = S1[voice] + ((S2[voice] - S1[voice]) * (signed int)pos) / BITS;
+			val = S1 + ((S2 - S1) * (signed int)pos) / BITS;
 			if (val < -32768)
 				val = -32768;
 			else if (val > 32767)
 				val = 32767;
-			*dst_ptr++ = val;
+			*dst = val;
+			dst += voices;
+			pos += data->pitch;
 		}
-
-		pos += data->pitch;
+		data->last_S1[voice] = S1;
+		data->last_S2[voice] = S2;
 	}
 	data->pos = pos;
 }


base: switch to cURL multi API for curl fetch and handle signals, https://trac.macports.org/ticket/43280

This allows users to cancel fetch using SIGINT and SIGTERM (or any other
signal, really) where they'd previously have to wait for the curl operation to
finish completely.
With this change the progress finish callback is always called, even if an
error occurs, which was previously not the case.

git-svn-id: 620571fa9b4bd0cbce9a0cf901e91ef896adbf27@118713 d073be05-634f-4543-b044-5fe20cf6d1d6

--- src/pextlib1.0/curl.c
+++ src/pextlib1.0/curl.c
@@ -41,6 +41,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/select.h>
 #include <utime.h>

 #include <curl/curl.h>
@@ -64,9 +65,15 @@
 #pragma mark Definitions

 /* ------------------------------------------------------------------------- **
- * Global cURL handle
+ * Global cURL handles
  * ------------------------------------------------------------------------- */
-/* we use a single global handle rather than creating and destroying handles to
+/* If we want to use TclX' signal handling mechanism we need cURL to return
+ * control to our code from time to time so we can call Tcl_AsyncInvoke to
+ * process pending signals. To do that, we could either abuse the curl progress
+ * callback (which would mean we could no longer use the default curl progress
+ * callback, or we need to use the cURL multi API. */
+static CURLM* theMHandle = NULL;
+/* We use a single global handle rather than creating and destroying handles to
  * take advantage of HTTP pipelining, especially to the packages servers. */
 static CURL* theHandle = NULL;

@@ -74,6 +81,7 @@
  * Prototypes
  * ------------------------------------------------------------------------- */
 int SetResultFromCurlErrorCode(Tcl_Interp* interp, CURLcode inErrorCode);
+int SetResultFromCurlMErrorCode(Tcl_Interp* interp, CURLMcode inErrorCode);
 int CurlFetchCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
 int CurlIsNewerCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
 int CurlGetSizeCmd(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
@@ -114,6 +122,29 @@
 		result = TCL_OK;
 	} else {
 		Tcl_SetResult(interp, (char *)curl_easy_strerror(inErrorCode), TCL_VOLATILE);
+	}
+
+	return result;
+}
+
+/**
+ * Set the result if a libcurl multi error occurred return TCL_ERROR.
+ * Otherwise, set the result to "" and return TCL_OK.
+ *
+ * @param interp		pointer to the interpreter.
+ * @param inErrorCode	code of the multi error.
+ * @return TCL_OK if inErrorCode is 0, TCL_ERROR otherwise.
+ */
+int
+SetResultFromCurlMErrorCode(Tcl_Interp *interp, CURLMcode inErrorCode)
+{
+	int result = TCL_ERROR;
+
+	if (inErrorCode == CURLM_OK) {
+		Tcl_SetResult(interp, "", TCL_STATIC);
+		result = TCL_OK;
+	} else {
+		Tcl_SetResult(interp, (char *)curl_multi_strerror(inErrorCode), TCL_VOLATILE);
 	}

 	return result;
@@ -133,7 +164,6 @@
 {
 	int theResult = TCL_OK;
 	FILE* theFile = NULL;
-	bool performFailed = false;
 	char theErrorString[CURL_ERROR_SIZE];

 	do {
@@ -156,7 +186,10 @@
 		const char* theFilePath;
 		long theFileTime = 0;
 		CURLcode theCurlCode;
+		CURLMcode theCurlMCode;
 		struct curl_slist *headers = NULL;
+		struct CURLMsg *info = NULL;
+		int running; /* number of running transfers */

 		/* we might have options and then the url and the file */
 		/* let's process the options first */
@@ -260,10 +293,25 @@
 			break;
 		}

-		/* Create the CURL handle */
+		/* Create the CURL handles */
+		if (theMHandle == NULL) {
+			/* Re-use existing multi handle if theMHandle isn't NULL */
+			theMHandle = curl_multi_init();
+			if (theMHandle == NULL) {
+				theResult = TCL_ERROR;
+				Tcl_SetResult(interp, "error in curl_multi_init", TCL_STATIC);
+				break;
+			}
+		}
+
 		if (theHandle == NULL) {
 			/* Re-use existing handle if theHandle isn't NULL */
 			theHandle = curl_easy_init();
+			if (theHandle == NULL) {
+				theResult = TCL_ERROR;
+				Tcl_SetResult(interp, "error in curl_easy_init", TCL_STATIC);
+				break;
+			}
 		}
 		/* If we're re-using a handle, the previous call did ensure to reset it
 		 * to the default state using curl_easy_reset(3) */
@@ -432,16 +480,117 @@
 			break;
 		}

-		/* actually fetch the resource */
-		theCurlCode = curl_easy_perform(theHandle);
-		if (theCurlCode != CURLE_OK) {
-			performFailed = true;
-			break;
-		}
+		/* add the easy handle to the multi handle */
+		theCurlMCode = curl_multi_add_handle(theMHandle, theHandle);
+		if (theCurlMCode != CURLM_OK) {
+			theResult = SetResultFromCurlMErrorCode(interp, theCurlMCode);
+			break;
+		}
+
+		/* select(2) the file descriptors used by curl and interleave with
+		 * checks for TclX signals */
+		do {
+			int rc; /* select() return code */
+
+			/* arguments for select(2) */
+			int nfds;
+			fd_set readfds;
+			fd_set writefds;
+			fd_set errorfds;
+			struct timeval timeout;
+
+			long curl_timeout = -1;
+
+			/* use at most half a second as timeout */
+			timeout.tv_sec = 0;
+			timeout.tv_usec = 500 * 1000;
+
+			/* get the next timeout */
+			theCurlMCode = curl_multi_timeout(theMHandle, &curl_timeout);
+			if (theCurlMCode != CURLM_OK) {
+				theResult = SetResultFromCurlMErrorCode(interp, theCurlMCode);
+				break;
+			}
+
+			/* convert the timeout into a suitable format for select(2) and
+			 * limit the timeout to 500 msecs at most */
+			if (curl_timeout >= 0 && curl_timeout < 500) {
+				timeout.tv_usec = curl_timeout * 1000;
+			} else {
+				timeout.tv_usec = 500 * 1000;
+			}
+
+			/* get the fd sets for select(2) */
+			theCurlMCode = curl_multi_fdset(theMHandle, &readfds, &writefds, &errorfds, &nfds);
+			if (theCurlMCode != CURLM_OK) {
+				theResult = SetResultFromCurlMErrorCode(interp, theCurlMCode);
+				break;
+			}
+
+			/* The value of nfds is guaranteed to be >= -1. Passing nfds + 1 to
+			 * select(2) makes the case of nfds == -1 a sleep. */
+			rc = select(nfds + 1, &readfds, &writefds, &errorfds, &timeout);
+			if (-1 == rc) {
+				/* select error */
+				Tcl_SetResult(interp, strerror(errno), TCL_VOLATILE);
+				theResult = TCL_ERROR;
+				break;
+			}
+
+			/* timeout or activity */
+			theCurlMCode = curl_multi_perform(theMHandle, &running);
+
+			/* process signals from TclX */
+			if (Tcl_AsyncReady()) {
+				theResult = Tcl_AsyncInvoke(interp, theResult);
+				if (theResult != TCL_OK) {
+					break;
+				}
+			}
+		} while (running > 0);
+
+		/* Find out whether the transfer succeeded or failed. */
+		info = curl_multi_info_read(theMHandle, &running);
+		if (running > 0) {
+			fprintf(stderr, "Warning: curl_multi_info_read has %d more structs available\n", running);
+		}
+
+		/* Remove the handle from the multi handle, but ignore errors to avoid
+		 * cluttering the real error info that might be somewhere further up */
+		curl_multi_remove_handle(theMHandle, theHandle);
+
+		/* free header memory */
+		curl_slist_free_all(headers);

 		/* signal cleanup to the progress callback */
 		if (noprogress == 0 && strcmp(progressCallback.proc, "builtin") != 0) {
 			CurlProgressCleanup(&progressCallback);
+		}
+
+		/* check for errors in the loop */
+		if (theResult != TCL_OK || theCurlMCode != CURLM_OK) {
+			break;
+		}
+
+		/* we should always get CURLMSG_DONE unless we aborted due to a Tcl
+		 * signal */
+		if (info == NULL) {
+			Tcl_SetResult(interp, "curl_multi_info_read() returned NULL", TCL_STATIC);
+			theResult = TCL_ERROR;
+			break;
+		}
+
+		if (info->msg != CURLMSG_DONE) {
+			Tcl_SetResult(interp, "curl_multi_info_read() returned an unexpected value", TCL_STATIC);
+			theResult = TCL_ERROR;
+			break;
+		}
+
+		if (info->data.result != CURLE_OK) {
+			/* execution failed, use the error string */
+			Tcl_SetResult(interp, theErrorString, TCL_VOLATILE);
+			theResult = TCL_ERROR;
+			break;
 		}

 		/* close the file */
@@ -497,22 +646,13 @@
 			}
 		}

-		/* free header memory */
-		curl_slist_free_all(headers);
-
 		/* If --effective-url option was given, set given variable name to last effective url used by curl */
 		if (effectiveURLVarName != NULL) {
 			theCurlCode = curl_easy_getinfo(theHandle, CURLINFO_EFFECTIVE_URL, &effectiveURL);
 			Tcl_SetVar(interp, effectiveURLVarName,
-				(effectiveURL == NULL || theCurlCode != CURLE_OK) ? "" : effectiveURL,
-				0);
+				(effectiveURL == NULL || theCurlCode != CURLE_OK) ? "" : effectiveURL, 0);
 		}
 	} while (0);
-
-	if (performFailed) {
-		Tcl_SetResult(interp, theErrorString, TCL_VOLATILE);
-		theResult = TCL_ERROR;
-	}

 	/* reset the connection */
 	if (theHandle != NULL) {
@@ -1187,14 +1327,15 @@

 		/* actually perform the POST */
 		theCurlCode = curl_easy_perform(theHandle);
-		if (theCurlCode != CURLE_OK) {
-			theResult = SetResultFromCurlErrorCode(interp, theCurlCode);
-			break;
-		}

 		/* signal cleanup to the progress callback */
 		if (noprogress == 0 && strcmp(progressCallback.proc, "builtin") != 0) {
 			CurlProgressCleanup(&progressCallback);
+		}
+
+		if (theCurlCode != CURLE_OK) {
+			theResult = SetResultFromCurlErrorCode(interp, theCurlCode);
+			break;
 		}

 		/* close the file */
@@ -1409,6 +1550,7 @@
 	/*
 	 * Transfer complete, signal the progress callback
 	 */
+	Tcl_InterpState state;

 	/*
 	 * Command string, a space followed "finish" plus the trailing \0.
@@ -1423,5 +1565,9 @@
 		abort();
 	}

+	/* make sure to save and restore the interpreter state so a potential error
+	 * message doesn't get lost */
+	state = Tcl_SaveInterpState(callback->interp, 0);
 	Tcl_EvalEx(callback->interp, commandBuffer, len, TCL_EVAL_GLOBAL);
+	Tcl_RestoreInterpState(callback->interp, state);
 }


misc/parse_number.h: add parse_unsigned_integer_cstr() for parsing a cstring

--- misc/parse_number.h
+++ misc/parse_number.h
@@ -40,12 +40,14 @@
 #include <limits.h>

 #include <misc/debug.h>
+#include <misc/cstring.h>

 // public parsing functions
 static int decode_decimal_digit (char c);
 static int decode_hex_digit (char c);
 static int parse_unsigned_integer_bin (const char *str, size_t str_len, uintmax_t *out) WARN_UNUSED;
 static int parse_unsigned_integer (const char *str, uintmax_t *out) WARN_UNUSED;
+static int parse_unsigned_integer_cstr (b_cstring cstr, size_t offset, size_t length, uintmax_t *out) WARN_UNUSED;
 static int parse_unsigned_hex_integer_bin (const char *str, size_t str_len, uintmax_t *out) WARN_UNUSED;
 static int parse_unsigned_hex_integer (const char *str, uintmax_t *out) WARN_UNUSED;
 static int parse_signmag_integer_bin (const char *str, size_t str_len, int *out_sign, uintmax_t *out_mag) WARN_UNUSED;
@@ -153,6 +155,37 @@
     return parse_unsigned_integer_bin(str, strlen(str), out);
 }

+int parse_unsigned_integer_cstr (b_cstring cstr, size_t offset, size_t length, uintmax_t *out)
+{
+    b_cstring_assert_range(cstr, offset, length);
+
+    if (length == 0) {
+        return 0;
+    }
+
+    uintmax_t n = 0;
+
+    B_CSTRING_LOOP_RANGE(cstr, offset, length, pos, chunk_data, chunk_length, {
+        for (size_t i = 0; i < chunk_length; i++) {
+            int digit = decode_decimal_digit(chunk_data[i]);
+            if (digit < 0) {
+                return 0;
+            }
+            if (n > UINTMAX_MAX / 10) {
+                return 0;
+            }
+            n *= 10;
+            if (digit > UINTMAX_MAX - n) {
+                return 0;
+            }
+            n += digit;
+        }
+    })
+
+    *out = n;
+    return 1;
+}
+
 int parse_unsigned_hex_integer_bin (const char *str, size_t str_len, uintmax_t *out)
 {
     uintmax_t n = 0;


Update test_barrier_1.c

Update test_barrier_1.c

--- test/test_barrier/test_barrier_1.c
+++ test/test_barrier/test_barrier_1.c
@@ -1,6 +1,6 @@
 #include "test.h"

-static_BAR(bar3, 4);
+static_BAR(bar3, 5);

 static void proc3()
 {
@@ -14,7 +14,7 @@
 {
 	unsigned event;
 		                                         assert_dead(tsk3);
-	        tsk_startFrom(tsk3, proc3);
+	        tsk_startFrom(tsk3, proc3);          assert_ready(tsk3);
 	event = bar_wait(bar2);                      assert_success(event);
 	event = bar_wait(bar3);                      assert_success(event);
 	event = tsk_join(tsk3);                      assert_success(event);
@@ -25,7 +25,7 @@
 {
 	unsigned event;
 		                                         assert_dead(tsk2);
-	        tsk_startFrom(tsk2, proc2);
+	        tsk_startFrom(tsk2, proc2);          assert_ready(tsk2);
 	event = bar_wait(bar1);                      assert_success(event);
 	event = bar_wait(bar2);                      assert_success(event);
 	event = bar_wait(bar3);                      assert_success(event);
@@ -37,7 +37,7 @@
 {
 	unsigned event;
 		                                         assert_dead(tsk1);
-	        tsk_startFrom(tsk1, proc1);
+	        tsk_startFrom(tsk1, proc1);          assert_ready(tsk1);
 	event = bar_wait(&bar0);                     assert_success(event);
 	event = bar_wait(bar1);                      assert_success(event);
 	event = bar_wait(bar2);                      assert_success(event);
@@ -50,15 +50,19 @@
 {
 	unsigned event;
 		                                         assert_dead(&tsk0);
-	        tsk_startFrom(&tsk0, proc0);
+	        tsk_startFrom(&tsk0, proc0);         assert_ready(&tsk0);
+	event = bar_wait(&bar0);                     assert_success(event);
+	event = bar_wait(bar1);                      assert_success(event);
+	event = bar_wait(bar2);                      assert_success(event);
+	event = bar_wait(bar3);                      assert_success(event);
 	event = tsk_join(&tsk0);                     assert_success(event);
 }

 void test_barrier_1()
 {
 	TEST_Notify();
-	bar_init(&bar0, 1);
-	bar_init(bar1, 2);
-	bar_init(bar2, 3);
+	bar_init(&bar0, 2);
+	bar_init(bar1, 3);
+	bar_init(bar2, 4);
 	TEST_Call();
 }


writeback: dirty position control - bdi reserve area

Keep a minimal pool of dirty pages for each bdi, so that the disk IO
queues won't underrun. Also gently increase a small bdi_thresh to avoid
it stuck in 0 for some light dirtied bdi.

It's particularly useful for JBOD and small memory system.

It may result in (pos_ratio > 1) at the setpoint and push the dirty
pages high. This is more or less intended because the bdi is in the
danger of IO queue underflow.

Signed-off-by: Wu Fengguang <24f7fe9d205c8a9f6ade0c2894e14303ca16087f@intel.com>

--- mm/page-writeback.c
+++ mm/page-writeback.c
@@ -599,6 +599,7 @@
 	 */
 	if (unlikely(bdi_thresh > thresh))
 		bdi_thresh = thresh;
+	bdi_thresh = max(bdi_thresh, (limit - dirty) / 8);
 	/*
 	 * scale global setpoint to bdi's:
 	 *	bdi_setpoint = setpoint * bdi_thresh / thresh
@@ -621,6 +622,20 @@
 		do_div(pos_ratio, x_intercept - bdi_setpoint + 1);
 	} else
 		pos_ratio /= 4;
+
+	/*
+	 * bdi reserve area, safeguard against dirty pool underrun and disk idle
+	 * It may push the desired control point of global dirty pages higher
+	 * than setpoint.
+	 */
+	x_intercept = bdi_thresh / 2;
+	if (bdi_dirty < x_intercept) {
+		if (bdi_dirty > x_intercept / 8) {
+			pos_ratio *= x_intercept;
+			do_div(pos_ratio, bdi_dirty);
+		} else
+			pos_ratio *= 8;
+	}

 	return pos_ratio;
 }


add dat table test for dump command

add dat table test for dump command

--- test/unit/core/test-command-dump.c
+++ test/unit/core/test-command-dump.c
@@ -184,6 +184,17 @@
 }

 static void
+data_double_array_trie_create(void)
+{
+  ADD_DATA("double-array trie",
+           "table_create Blog TABLE_DAT_KEY ShortText",
+           "Blog",
+           GRN_OBJ_TABLE_DAT_KEY,
+           "ShortText",
+           NULL);
+}
+
+static void
 data_array_create(void)
 {
   ADD_DATA("array",
@@ -216,6 +227,7 @@
 {
   data_hash_table_create();
   data_patricia_trie_create();
+  data_double_array_trie_create();
   data_array_create();
   data_view_create();
 }


BUG(326): Fixed typo in OSS plugin.

BUG(326): Fixed typo in OSS plugin.

--- src/plugins/oss/oss.c
+++ src/plugins/oss/oss.c
@@ -145,7 +145,7 @@
 	                                   NULL,
 	                                   NULL);

-#if !defined(XMMS_OS_NETBSD) || !defined(XMMS_OS_OPENBSD)
+#if !defined(XMMS_OS_NETBSD) && !defined(XMMS_OS_OPENBSD)
 	xmms_plugin_config_value_register (plugin,
 	                                   "device",
 	                                   "/dev/dsp",


Allow image preview to be zoomed in and out

--- src/plugins/preview.c
+++ src/plugins/preview.c
@@ -36,6 +36,7 @@

 	char * path;
 	guint source;
+	unsigned int size;

 	/* widgets */
 	GtkWidget * widget;
@@ -43,6 +44,9 @@
 	GtkWidget * toolbar;
 	GtkToolItem * open;
 	GtkToolItem * edit;
+	GtkToolItem * zoom_fit;
+	GtkToolItem * zoom_out;
+	GtkToolItem * zoom_in;
 	GtkWidget * view_image;
 	GtkWidget * view_text;
 	GtkTextBuffer * view_text_buffer;
@@ -61,6 +65,9 @@
 static gboolean _preview_on_idle_image(gpointer data);
 static gboolean _preview_on_idle_text(gpointer data);
 static void _preview_on_open(gpointer data);
+static void _preview_on_zoom_fit(gpointer data);
+static void _preview_on_zoom_in(gpointer data);
+static void _preview_on_zoom_out(gpointer data);

 /* public */
@@ -92,6 +99,7 @@
 	preview->helper = helper;
 	preview->path = NULL;
 	preview->source = 0;
+	preview->size = 96;
 	/* widgets */
 	vbox = gtk_vbox_new(FALSE, 4);
 	preview->widget = vbox;
@@ -107,6 +115,21 @@
 	g_signal_connect_swapped(preview->edit, "clicked", G_CALLBACK(
 				_preview_on_edit), preview);
 	gtk_toolbar_insert(GTK_TOOLBAR(preview->toolbar), preview->edit, -1);
+	/* zoom */
+	preview->zoom_fit = gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_FIT);
+	g_signal_connect_swapped(preview->zoom_fit, "clicked", G_CALLBACK(
+				_preview_on_zoom_fit), preview);
+	gtk_toolbar_insert(GTK_TOOLBAR(preview->toolbar), preview->zoom_fit,
+			-1);
+	preview->zoom_out = gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_OUT);
+	g_signal_connect_swapped(preview->zoom_out, "clicked", G_CALLBACK(
+				_preview_on_zoom_out), preview);
+	gtk_toolbar_insert(GTK_TOOLBAR(preview->toolbar), preview->zoom_out,
+			-1);
+	preview->zoom_in = gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_IN);
+	g_signal_connect_swapped(preview->zoom_in, "clicked", G_CALLBACK(
+				_preview_on_zoom_in), preview);
+	gtk_toolbar_insert(GTK_TOOLBAR(preview->toolbar), preview->zoom_in, -1);
 	gtk_box_pack_start(GTK_BOX(vbox), preview->toolbar, FALSE, TRUE, 0);
 	/* name */
 	preview->name = gtk_label_new(NULL);
@@ -236,9 +259,13 @@
 	if(preview->source != 0)
 		g_source_remove(preview->source);
 	preview->source = 0;
+	preview->size = 96;
 	gtk_widget_hide(preview->toolbar);
 	gtk_widget_hide(GTK_WIDGET(preview->open));
 	gtk_widget_hide(GTK_WIDGET(preview->edit));
+	gtk_widget_hide(GTK_WIDGET(preview->zoom_fit));
+	gtk_widget_hide(GTK_WIDGET(preview->zoom_out));
+	gtk_widget_hide(GTK_WIDGET(preview->zoom_in));
 	gtk_widget_hide(preview->view_image);
 	gtk_widget_hide(preview->view_text);
 }
@@ -265,12 +292,17 @@
 	GError * error = NULL;

 	preview->source = 0;
+	gtk_widget_show(GTK_WIDGET(preview->zoom_fit));
+	gtk_widget_show(GTK_WIDGET(preview->zoom_out));
+	gtk_widget_show(GTK_WIDGET(preview->zoom_in));
 #if GTK_CHECK_VERSION(2, 6, 0)
-	if((pixbuf = gdk_pixbuf_new_from_file_at_scale(preview->path, 96, 96,
-					TRUE, &error)) == NULL)
+	if((pixbuf = gdk_pixbuf_new_from_file_at_scale(preview->path,
+					preview->size, preview->size, TRUE,
+					&error)) == NULL)
 #else
-	if((pixbuf = gdk_pixbuf_new_from_file_at_size(preview->path, 96, 96,
-					&error)) == NULL)
+	if((pixbuf = gdk_pixbuf_new_from_file_at_size(preview->path,
+					preview->size, preview->size, &error))
+			== NULL)
 #endif
 	{
 		helper->error(helper->browser, error->message, 1);
@@ -326,3 +358,45 @@
 	if(preview->path != NULL)
 		mime_action(mime, "open", preview->path);
 }
+
+
+/* preview_on_zoom_fit */
+static void _preview_on_zoom_fit(gpointer data)
+{
+	Preview * preview = data;
+
+	preview->size = 96;
+	if(preview->source != 0)
+		g_source_remove(preview->source);
+	/* XXX may not always be an image */
+	preview->source = g_idle_add(_preview_on_idle_image, preview);
+}
+
+
+/* preview_on_zoom_in */
+static void _preview_on_zoom_in(gpointer data)
+{
+	Preview * preview = data;
+
+	preview->size = preview->size * 2;
+	if(preview->source != 0)
+		g_source_remove(preview->source);
+	/* XXX may not always be an image */
+	preview->source = g_idle_add(_preview_on_idle_image, preview);
+}
+
+
+/* preview_on_zoom_out */
+static void _preview_on_zoom_out(gpointer data)
+{
+	Preview * preview = data;
+
+	preview->size = preview->size / 2;
+	/* stick with a divider of 96 */
+	if(preview->size < 3)
+		preview->size = 3;
+	if(preview->source != 0)
+		g_source_remove(preview->source);
+	/* XXX may not always be an image */
+	preview->source = g_idle_add(_preview_on_idle_image, preview);
+}


Avoid a few Gtk+ warnings while compiling

--- src/plugins/preview.c
+++ src/plugins/preview.c
@@ -41,8 +41,8 @@
 	GtkWidget * widget;
 	GtkWidget * name;
 	GtkWidget * toolbar;
-	GtkWidget * open;
-	GtkWidget * edit;
+	GtkToolItem * open;
+	GtkToolItem * edit;
 	GtkWidget * view_image;
 	GtkWidget * view_text;
 	GtkTextBuffer * view_text_buffer;
@@ -102,13 +102,11 @@
 	preview->open = gtk_tool_button_new_from_stock(GTK_STOCK_OPEN);
 	g_signal_connect_swapped(preview->open, "clicked", G_CALLBACK(
 				_preview_on_open), preview);
-	gtk_toolbar_insert(GTK_TOOLBAR(preview->toolbar),
-			GTK_TOOL_ITEM(preview->open), -1);
+	gtk_toolbar_insert(GTK_TOOLBAR(preview->toolbar), preview->open, -1);
 	preview->edit = gtk_tool_button_new_from_stock(GTK_STOCK_EDIT);
 	g_signal_connect_swapped(preview->edit, "clicked", G_CALLBACK(
 				_preview_on_edit), preview);
-	gtk_toolbar_insert(GTK_TOOLBAR(preview->toolbar),
-			GTK_TOOL_ITEM(preview->edit), -1);
+	gtk_toolbar_insert(GTK_TOOLBAR(preview->toolbar), preview->edit, -1);
 	gtk_box_pack_start(GTK_BOX(vbox), preview->toolbar, FALSE, TRUE, 0);
 	/* name */
 	preview->name = gtk_label_new(NULL);
@@ -210,12 +208,12 @@
 	if(mime_get_handler(mime, type, "open") != NULL)
 	{
 		gtk_widget_show(preview->toolbar);
-		gtk_widget_show(preview->open);
+		gtk_widget_show(GTK_WIDGET(preview->open));
 	}
 	if(mime_get_handler(mime, type, "edit") != NULL)
 	{
 		gtk_widget_show(preview->toolbar);
-		gtk_widget_show(preview->edit);
+		gtk_widget_show(GTK_WIDGET(preview->edit));
 	}
 }

@@ -239,8 +237,8 @@
 		g_source_remove(preview->source);
 	preview->source = 0;
 	gtk_widget_hide(preview->toolbar);
-	gtk_widget_hide(preview->open);
-	gtk_widget_hide(preview->edit);
+	gtk_widget_hide(GTK_WIDGET(preview->open));
+	gtk_widget_hide(GTK_WIDGET(preview->edit));
 	gtk_widget_hide(preview->view_image);
 	gtk_widget_hide(preview->view_text);
 }


Silently deal with a lack of any server side SSL configuration

This will be a common case, no doubt, so spurious messages in
pmcd.log will not be helpful (esp. now that pmconfig -L tells
us whether libpcp support is present).  Also makes several QA
tests pass once more.

--- src/pmcd/src/secure.c
+++ src/pmcd/src/secure.c
@@ -189,6 +189,12 @@
     } else {
 	/* -2 here ensures result is NULL terminated */
 	strncat(database_path, dbpath, MAXPATHLEN-2);
+    }
+
+    if (access(database_path, R_OK) < 0 && oserror() == ENOENT) {
+	/* Handle the common case - pmcd supports secure sockets, */
+	/* but no configuration has been performed on the server. */
+	return 0;
     }

     secsts = NSS_Init(database_path);


Assign papi help text in papi_internal_init and only lookup values in papi_text

Assigning the values of {short,long}_descr can be done within papi_internal_init,
which allows us to simply recall the values in papi_text.

--- src/pmdas/papi/papi.c
+++ src/pmdas/papi/papi.c
@@ -939,9 +939,6 @@
 static int
 papi_text(int ident, int type, char **buffer, pmdaExt *ep)
 {
-    int ec;
-    int i;
-    int position = -1;
     __pmID_int *pmidp = (__pmID_int*)&ident;

     /* no indoms - we only deal with metric help text */
@@ -949,28 +946,13 @@
 	return PM_ERR_TEXT;

     if(pmidp->cluster == CLUSTER_PAPI){
-	ec = 0 | PAPI_PRESET_MASK;
-	PAPI_enum_event(&ec, PAPI_ENUM_FIRST);
-	for (i = 0; i < number_of_events; i++) {
-	    if (((__pmID_int *)&papi_info[i].pmid)->item == pmidp->item) {
-		position = i;
-		break;
-	    }
+	if(pmidp->item < number_of_events){
+	    if (type & PM_TEXT_ONELINE)
+		*buffer = papi_info[pmidp->item].info.short_descr;
+	    else
+		*buffer = papi_info[pmidp->item].info.long_descr;
+	    return 0;
 	}
-
-	do {
-	    if (PAPI_get_event_info(ec, &papi_info[position].info) == PAPI_OK) {
-		if (papi_info[position].info.count && PAPI_PRESET_ENUM_AVAIL){
-		    if (papi_info[position].info.event_code == papi_info[position].papi_event_code) {
-			if (type & PM_TEXT_ONELINE)
-			    *buffer = papi_info[position].info.short_descr;
-			else
-			    *buffer = papi_info[position].info.long_descr;
-			return 0;
-		    }
-		}
-	    }
-	} while (PAPI_enum_event(&ec, 0) == PAPI_OK);
 	return pmdaText(ident, type, buffer, ep);
     }
     else
@@ -1060,9 +1042,8 @@
     do {
 	if (PAPI_get_event_info(ec, &info) == PAPI_OK) {
 	    if (info.count && PAPI_PRESET_ENUM_AVAIL){
-		i++;
 		expand_papi_info(i);
-		papi_info[i-1].papi_event_code = info.event_code;
+		papi_info[i].papi_event_code = info.event_code;
 		substr = strtok(info.symbol, "_");
 		while (substr != NULL) {
 		    addunderscore = 0;
@@ -1075,14 +1056,17 @@
 			strcat(concatstr, "_");
 		    }
 		}
-		strcpy(papi_info[i-1].papi_string_code, concatstr);
+		strcpy(papi_info[i].papi_string_code, concatstr);
 		memset(&concatstr[0], 0, sizeof(concatstr));
-		papi_info[i-1].position = -1;
-		papi_info[i-1].pmid = i-1;
+		papi_info[i].position = -1;
+		papi_info[i].pmid = i;
+		strcpy(papi_info[i].info.short_descr,info.short_descr);
+		strcpy(papi_info[i].info.long_descr, info.long_descr);
+		expand_values(i);
+		i++;
 	    }
 	}
     } while(PAPI_enum_event(&ec, 0) == PAPI_OK);
-    expand_values(i);
     if (PAPI_create_eventset(&EventSet) != PAPI_OK) {
 	__pmNotifyErr(LOG_ERR, "PAPI_create_eventset error!\n");
 	return PM_ERR_GENERIC;


Allow control variable access in the fetchcallback even if papi is not running

Also fix a small issue in papi_store for papi.control.disable, we shouldn't
return PM_ERR_CONV if it's the first metric we compare against.

*src/pmdas/papi/papi.c

--- src/pmdas/papi/papi.c
+++ src/pmdas/papi/papi.c
@@ -970,9 +970,10 @@

     /* this will probably need to be expanded to fit the domains as well */
     sts = check_papi_state(sts);
-    if (sts != PAPI_RUNNING)
+    if (sts != PAPI_RUNNING && idp->cluster == CLUSTER_PAPI){
 	return PMDA_FETCH_NOVALUES;
-    else {
+    }
+    else if(sts == PAPI_RUNNING){
 	sts = PAPI_read(EventSet, values);
 	if (sts != PAPI_OK) {
 	    __pmNotifyErr(LOG_ERR, "PAPI_read: %s\n", PAPI_strerror(sts));
@@ -1220,7 +1221,6 @@
 		    else {
 			if (pmDebug & DBG_TRACE_APPL0)
 			    __pmNotifyErr(LOG_DEBUG, "metric name %s does not match any known metrics\n", substring);
-			return PM_ERR_CONV;
 		    }
 		}
 		substring = strtok(NULL, delim);


pmprobe - improve guard in error case

pmprobe - improve guard in error case

If the context is valid, but access controls prevent fetching
information from pmcd, then the number of metrics found in a
PMNS traversal may be 0.  Avoid calling pmLookupName() in this
case.

--- src/pmprobe/pmprobe.c
+++ src/pmprobe/pmprobe.c
@@ -202,7 +202,7 @@
      * Cull out names that were unsuccessfully looked up.
      * However, it is unlikely to fail because names come from a traverse PMNS.
      */
-    if ((sts = pmLookupName(numpmid, namelist, pmidlist)) < 0) {
+    if (numpmid > 0 && (sts = pmLookupName(numpmid, namelist, pmidlist)) < 0) {
 	for (i = j = 0; i < numpmid; i++) {
 	    if (pmidlist[i] == PM_ID_NULL) {
 		printf("%s %d %s\n", namelist[i], sts, pmErrStr(sts));


ppb_audio_input: update status of enumerate_devices()

it's implemented already

--- src/ppb_audio_input.c
+++ src/ppb_audio_input.c
@@ -277,7 +277,7 @@
 trace_ppb_audio_input_enumerate_devices(PP_Resource audio_input, struct PP_ArrayOutput output,
                                         struct PP_CompletionCallback callback)
 {
-    trace_info("[PPB] {fake} %s audio_input=%d, output={.GetDataBuffer=%p, .user_data=%p}, "
+    trace_info("[PPB] {full} %s audio_input=%d, output={.GetDataBuffer=%p, .user_data=%p}, "
                "callback={.func=%p, .user_data=%p, .flags=%u}\n", __func__+6, audio_input,
                output.GetDataBuffer, output.user_data, callback.func, callback.user_data,
                callback.flags);


Garbage collect memory pool at end of job and before sm_dump

--- bacula/src/filed/job.c
+++ bacula/src/filed/job.c
@@ -402,11 +402,13 @@
    free_jcr(jcr);                     /* destroy JCR record */
    Dmsg0(100, "Done with free_jcr\n");
    Dsm_check(1);
+   garbage_collect_memory_pool();
    return NULL;
 }

 static int sm_dump_cmd(JCR *jcr)
 {
+   garbage_collect_memory_pool();
    sm_dump(false, true);
    jcr->dir_bsock->fsend("2000 sm_dump OK\n");
    return 1;


fix compilation in debug mode

fix compilation in debug mode

--- bar/tests/rescueTest.c
+++ bar/tests/rescueTest.c
@@ -127,7 +127,6 @@
             while (segment != NULL) {
                 int64_t start = stPinchSegment_getStart(segment);
                 int64_t end = start + stPinchSegment_getLength(segment);
-                assert(end <= threadStart + threadLen);
                 bool covered = false;
                 if (stPinchSegment_getBlock(segment) != NULL) {
                     covered = true;


ab-bench-scale: execute forall rr step sizes

--- bench/ab-bench-scale.c
+++ bench/ab-bench-scale.c
@@ -138,7 +138,7 @@
                 cores[idx++] = p;
                 choosen++;

-                dbg_printf("Choosing %" PRIuCOREID "\n", p);
+                dbg_printf("Choosing %" PRIuCOREID " on node %zu\n", p, i);
             }
         }
     }
@@ -242,6 +242,11 @@
     for (size_t i=0; i<gl_total; i++) {
         gl_msg[i] = smlt_message_alloc(56);
     }
+
+    // Determine NUMA properties
+    size_t max_node = numa_max_node();
+    size_t num_cores = numa_num_configured_cpus();
+    size_t cores_per_node = num_cores/(max_node+1);

     chan = (struct smlt_channel**) malloc(sizeof(struct smlt_channel*)*total);
     for (size_t i = 0; i < total; i++) {
@@ -301,65 +306,73 @@
         }
     }

+    // Foreach topology
     for (int top = 0; top < NUM_TOPO; top++) {
-        for (size_t num_threads = 2; num_threads < total+1; num_threads++) {
-
-            coreid_t cores[num_threads];
-
-            // Make available globally
-            gl_num_threads = num_threads;
-            gl_cores = cores;
-
-            placement(num_threads, -1, cores);
-
-            printf("Cores (%zu threads): ", num_threads);
-            for (size_t dbg=0; dbg<num_threads; dbg++) {
-                printf(" %" PRIuCOREID, cores[dbg]);
-            }
-            printf("\n");
-
-            pthread_barrier_init(&bar, NULL, num_threads);
-            struct smlt_generated_model* model = NULL;
-
-            fprintf(stderr, "%s nthreads %zu \n", topo_names[top], num_threads);
-            err = smlt_generate_model(cores, num_threads, topo_names[top], &model);
-
-            if (smlt_err_is_fail(err)) {
-                printf("Failed to generated model, aborting\n");
-                return 1;
-            }
-
-            struct smlt_topology *topo = NULL;
-            smlt_topology_create(model, topo_names[top], &topo);
-            active_topo = topo;
-
-            err = smlt_context_create(topo, &context);
-            if (smlt_err_is_fail(err)) {
-                printf("FAILED TO INITIALIZE CONTEXT !\n");
-                return 1;
-            }
-
-            for (int i = 0; i < NUM_EXP; i++){
-
-
-                printf("----------------------------------------\n");
-                printf("Executing experiment %s\n", labels[i]);
-                printf("----------------------------------------\n");
-
-                struct smlt_node *node;
-                for (uint64_t j = 0; j < num_threads; j++) {
-                    node = smlt_get_node_by_id(cores[j]);
-                    err = smlt_node_start(node, workers[i], (void*)(uint64_t) cores[j]);
-                    if (smlt_err_is_fail(err)) {
-                        printf("Staring node failed \n");
+
+        // For an increasing number of threads
+        for (size_t num_threads = 2; num_threads<total+1; num_threads++) {
+
+            // For an increasing round-robin batch size
+            for (size_t step=1; step<=cores_per_node; step++) {
+
+                coreid_t cores[num_threads];
+
+                // Make available globally
+                gl_num_threads = num_threads;
+                gl_cores = cores;
+                gl_step = step;
+
+                placement(num_threads, step, cores);
+
+                printf("Cores (%zu threads): ", num_threads);
+                for (size_t dbg=0; dbg<num_threads; dbg++) {
+                    printf(" %" PRIuCOREID, cores[dbg]);
+                }
+                printf("\n");
+
+                pthread_barrier_init(&bar, NULL, num_threads);
+                struct smlt_generated_model* model = NULL;
+
+                fprintf(stderr, "%s nthreads %zu \n", topo_names[top], num_threads);
+                err = smlt_generate_model(cores, num_threads, topo_names[top], &model);
+
+                if (smlt_err_is_fail(err)) {
+                    printf("Failed to generated model, aborting\n");
+                    return 1;
+                }
+
+                struct smlt_topology *topo = NULL;
+                smlt_topology_create(model, topo_names[top], &topo);
+                active_topo = topo;
+
+                err = smlt_context_create(topo, &context);
+                if (smlt_err_is_fail(err)) {
+                    printf("FAILED TO INITIALIZE CONTEXT !\n");
+                    return 1;
+                }
+
+                for (int i = 0; i < NUM_EXP; i++){
+
+
+                    printf("----------------------------------------\n");
+                    printf("Executing experiment %s\n", labels[i]);
+                    printf("----------------------------------------\n");
+
+                    struct smlt_node *node;
+                    for (uint64_t j = 0; j < num_threads; j++) {
+                        node = smlt_get_node_by_id(cores[j]);
+                        err = smlt_node_start(node, workers[i], (void*)(uint64_t) cores[j]);
+                        if (smlt_err_is_fail(err)) {
+                            printf("Staring node failed \n");
+                        }
                     }
-                }
-
-                for (unsigned int j=0; j < num_threads; j++) {
-                    node = smlt_get_node_by_id(cores[j]);
-                    smlt_node_join(node);
-                }
-           }
+
+                    for (unsigned int j=0; j < num_threads; j++) {
+                        node = smlt_get_node_by_id(cores[j]);
+                        smlt_node_join(node);
+                    }
+                }
+            }
         }
     }


Checking __STDC_VERSION__ rather than __STRICT_ANSI__

`__STRICT_ANSI__` is a gnuish flag macro that indicates if `-ansi`
was given on the command line.  To check the C version, it's better
to check the macro `__STDC_VERSION__`.

Reviewed-by: Hugo Landau <ce9fa1e55a72fc9b85dd06e47ea2c07848fb7d2c@openssl.org>
Reviewed-by: Shane Lontis <452ce16516ceed26291fe7de3f8b53540d83864e@oracle.com>
Reviewed-by: Tomas Mraz <2bc6038c3dfca09b2da23c8b6da8ba884dc2dcc2@openssl.org>
Reviewed-by: Todd Short <0267f0ecbdb3e99cdfd94eb139bf30919fa04d2f@me.com>
(Merged from https://github.com/openssl/openssl/pull/19197)

--- apps/lib/log.c
+++ apps/lib/log.c
@@ -56,18 +56,31 @@
     BIO_free(pre);
 }

+/*
+ * Unfortunately, C before C99 does not define va_copy, so we must
+ * check if it can be assumed to be present.  We do that with an internal
+ * antifeature macro.
+ * C versions since C94 define __STDC_VERSION__, so it's enough to
+ * check its existence and value.
+ */
+#undef OSSL_NO_C99
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ + 0 < 199900L
+# define OSSL_NO_C99
+#endif
+
 void trace_log_message(int category,
                        const char *prog, int level, const char *fmt, ...)
 {
     va_list ap;
     va_start(ap, fmt);
-#ifdef __STRICT_ANSI__ /* unfortuantely, ANSI does not define va_copy */
+
+#ifdef OSSL_NO_C99
     if (verbosity >= level)
         category = -1; /* disabling trace output in addition to logging */
 #endif
     if (category >= 0 && OSSL_trace_enabled(category)) {
         BIO *out = OSSL_trace_begin(category);
-#ifndef __STRICT_ANSI__
+#ifndef OSSL_NO_C99
         va_list ap_copy;

         va_copy(ap_copy, ap);


More EOF new line clean up

More EOF new line clean up

Change-Id: I1ef29ccae243230d859bd48204cd5eea3e1233de

--- Filters/ParallelStatistics/vtkPDescriptiveStatistics.h
+++ Filters/ParallelStatistics/vtkPDescriptiveStatistics.h
@@ -65,4 +65,3 @@
 };

 #endif
-


added QmitkSimpleCheckedDataTreeView

added QmitkSimpleCheckedDataTreeView

--- QFunctionalities/QmitkDataManager/QmitkDataTreeViewItem.h
+++ QFunctionalities/QmitkDataManager/QmitkDataTreeViewItem.h
@@ -14,15 +14,18 @@

 class QmitkDataTreeViewItem : public QListViewItem
 {
-  public:
+
+	public:
     QmitkDataTreeViewItem( QListView *parent, const QString &s1 = 0, const QString &s2 = 0, mitk::DataTreeIterator * nodeIt = 0 );
     QmitkDataTreeViewItem( QmitkDataTreeViewItem * parent, mitk::DataTreeIterator * nodeIt );
     mitk::DataTreeNode::ConstPointer GetDataTreeNode() const;
     mitk::DataTreeIterator* GetDataTreeIterator() {return m_DataTreeIterator;}
-  protected:
-    mitk::DataTreeNode::ConstPointer m_TreeNode;
+
+	protected:
+    mitk::DataTreeNode::ConstPointer m_TreeNode;
     mitk::DataTreeIterator* m_DataTreeIterator;
 };
+

 class QmitkNodeViewBaseItem {
   public:
@@ -60,7 +63,7 @@
         boolProp->SetValue(state);
 	mitk::RenderWindow::UpdateAllInstances();
       };
-
+
        QCheckListItem::stateChange(state);
       listView()->repaintContents();
     };


Create generateRandStrings.c

Create generateRandStrings.c

error: pathspec 'April-6th-2016/generateRandStrings.c' did not match any file(s) known to git

--- April-6th-2016/generateRandStrings.c
+++ April-6th-2016/generateRandStrings.c
@@ -0,0 +1,34 @@
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <time.h>
+
+int main(void)
+{
+    static const char *ASCII_CHARSET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+    const size_t ASCII_CHARSET_COUNT = strlen(ASCII_CHARSET);
+
+    unsigned int seed = (unsigned int)time(NULL);
+
+    size_t randStringCount = 10;
+    size_t randStringLength = 10;
+
+    char *stringBuffer = (char*)calloc(randStringCount * (randStringLength + 1), sizeof(char*));
+    if (!stringBuffer) {
+        errno = ENOMEM;
+        return errno;
+    }
+    for (size_t i = 0; i < randStringCount; ++i) {
+        for (size_t j = 0; j < randStringLength; ++j) {
+            size_t randIndex = rand() % ASCII_CHARSET_COUNT;
+            stringBuffer[i * (randStringLength + 1) + j] = ASCII_CHARSET[randIndex];
+        }
+        puts(&stringBuffer[i * (randStringLength + 1)]);
+    }
+
+    free(stringBuffer);
+    getchar();
+
+    return 0;
+}


fixes bug #385044

fixes bug #385044

--- Common/Source/CFGrowlAdditions.c
+++ Common/Source/CFGrowlAdditions.c
@@ -345,9 +345,11 @@
 					NSLog(CFSTR("in createURLByMakingDirectoryAtURLWithName in CFGrowlAdditions: could not create directory '%@' in parent directory at %@: FSCreateDirectoryUnicode returned %li (please tell the Growl developers)"), name, parent, (long)err);
 			}

+		} //if (name)
+		if(parent)
 			CFRelease(parent);
-		} //if (name)
-		CFRelease(name);
+		if(name)
+			CFRelease(name);
 	} //if (parent)

 end:


add stm32f4xx_hal_conf.h from STM32Cube_FW_F4_V1.9.0\Projects\STM32F4-Discovery\Templates\Inc\stm32f4xx_hal_conf.h.

error: pathspec 'mbed-hal-st-stm32f407vg/stm32f4xx_hal_conf.h' did not match any file(s) known to git

--- mbed-hal-st-stm32f407vg/stm32f4xx_hal_conf.h
+++ mbed-hal-st-stm32f407vg/stm32f4xx_hal_conf.h
@@ -0,0 +1,407 @@
+/**
+  ******************************************************************************
+  * @file    stm32f4xx_hal_conf.h
+  * @author  MCD Application Team
+  * @version V1.2.2
+  * @date    09-October-2015
+  * @brief   HAL configuration file
+  ******************************************************************************
+  * @attention
+  *
+  *
© COPYRIGHT(c) 2015 STMicroelectronics

+  *
+  * 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. Neither the name of STMicroelectronics nor the names of its contributors
+  *      may be used to endorse or promote products derived from this software
+  *      without specific prior written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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.
+  *
+  ******************************************************************************
+  */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F4xx_HAL_CONF_H
+#define __STM32F4xx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+  * @brief This is the list of modules to be used in the HAL driver
+  */
+#define HAL_MODULE_ENABLED
+#define HAL_ADC_MODULE_ENABLED
+#define HAL_CAN_MODULE_ENABLED
+#define HAL_CRC_MODULE_ENABLED
+#define HAL_CRYP_MODULE_ENABLED
+#define HAL_DAC_MODULE_ENABLED
+#define HAL_DCMI_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+/* #define HAL_DMA2D_MODULE_ENABLED */
+#define HAL_ETH_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_NAND_MODULE_ENABLED
+#define HAL_NOR_MODULE_ENABLED
+#define HAL_PCCARD_MODULE_ENABLED
+#define HAL_SRAM_MODULE_ENABLED
+/* #define HAL_SDRAM_MODULE_ENABLED */
+#define HAL_HASH_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_I2C_MODULE_ENABLED
+#define HAL_I2S_MODULE_ENABLED
+#define HAL_IWDG_MODULE_ENABLED
+#define HAL_LTDC_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+#define HAL_RNG_MODULE_ENABLED
+#define HAL_RTC_MODULE_ENABLED
+/* #define HAL_SAI_MODULE_ENABLED */
+#define HAL_SD_MODULE_ENABLED
+#define HAL_SPI_MODULE_ENABLED
+#define HAL_TIM_MODULE_ENABLED
+#define HAL_UART_MODULE_ENABLED
+#define HAL_USART_MODULE_ENABLED
+#define HAL_IRDA_MODULE_ENABLED
+#define HAL_SMARTCARD_MODULE_ENABLED
+#define HAL_WWDG_MODULE_ENABLED
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_PCD_MODULE_ENABLED
+#define HAL_HCD_MODULE_ENABLED
+
+
+/* ########################## HSE/HSI Values adaptation ##################### */
+/**
+  * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+  *        This value is used by the RCC HAL module to compute the system frequency
+  *        (when HSE is used as system clock source, directly or through the PLL).
+  */
+#if !defined  (HSE_VALUE)
+  #define HSE_VALUE    ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined  (HSE_STARTUP_TIMEOUT)
+  #define HSE_STARTUP_TIMEOUT    ((uint32_t)5000)   /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+  * @brief Internal High Speed oscillator (HSI) value.
+  *        This value is used by the RCC HAL module to compute the system frequency
+  *        (when HSI is used as system clock source, directly or through the PLL).
+  */
+#if !defined  (HSI_VALUE)
+  #define HSI_VALUE    ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+  * @brief Internal Low Speed oscillator (LSI) value.
+  */
+#if !defined  (LSI_VALUE)
+ #define LSI_VALUE  ((uint32_t)32000)
+#endif /* LSI_VALUE */                      /*!< Value of the Internal Low Speed oscillator in Hz
+                                             The real value may vary depending on the variations
+                                             in voltage and temperature.  */
+/**
+  * @brief External Low Speed oscillator (LSE) value.
+  */
+#if !defined  (LSE_VALUE)
+ #define LSE_VALUE  ((uint32_t)32768)    /*!< Value of the External Low Speed oscillator in Hz */
+#endif /* LSE_VALUE */
+
+/**
+  * @brief External clock source for I2S peripheral
+  *        This value is used by the I2S HAL module to compute the I2S clock source
+  *        frequency, this source is inserted directly through I2S_CKIN pad.
+  */
+#if !defined  (EXTERNAL_CLOCK_VALUE)
+  #define EXTERNAL_CLOCK_VALUE    ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/
+#endif /* EXTERNAL_CLOCK_VALUE */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+   ===  you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+  * @brief This is the HAL system configuration section
+  */
+#define  VDD_VALUE                    ((uint32_t)3300) /*!< Value of VDD in mv */
+#define  TICK_INT_PRIORITY            ((uint32_t)0x0F) /*!< tick interrupt priority */
+#define  USE_RTOS                     0
+#define  PREFETCH_ENABLE              0 /* The prefetch will be enabled in SystemClock_Config(), depending on the used
+                                           STM32F405/415/07/417 device: RevA (prefetch must be off) or RevZ (prefetch can be on/off) */
+#define  INSTRUCTION_CACHE_ENABLE     1
+#define  DATA_CACHE_ENABLE            1
+
+/* ########################## Assert Selection ############################## */
+/**
+  * @brief Uncomment the line below to expanse the "assert_param" macro in the
+  *        HAL drivers code
+  */
+/* #define USE_FULL_ASSERT    1 */
+
+/* ################## Ethernet peripheral configuration ##################### */
+
+/* Section 1 : Ethernet peripheral configuration */
+
+/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
+#define MAC_ADDR0   2
+#define MAC_ADDR1   0
+#define MAC_ADDR2   0
+#define MAC_ADDR3   0
+#define MAC_ADDR4   0
+#define MAC_ADDR5   0
+
+/* Definition of the Ethernet driver buffers size and count */
+#define ETH_RX_BUF_SIZE                ETH_MAX_PACKET_SIZE /* buffer size for receive               */
+#define ETH_TX_BUF_SIZE                ETH_MAX_PACKET_SIZE /* buffer size for transmit              */
+#define ETH_RXBUFNB                    ((uint32_t)4)       /* 4 Rx buffers of size ETH_RX_BUF_SIZE  */
+#define ETH_TXBUFNB                    ((uint32_t)4)       /* 4 Tx buffers of size ETH_TX_BUF_SIZE  */
+
+/* Section 2: PHY configuration section */
+
+/* DP83848 PHY Address*/
+#define DP83848_PHY_ADDRESS             0x01
+/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
+#define PHY_RESET_DELAY                 ((uint32_t)0x000000FF)
+/* PHY Configuration delay */
+#define PHY_CONFIG_DELAY                ((uint32_t)0x00000FFF)
+
+#define PHY_READ_TO                     ((uint32_t)0x0000FFFF)
+#define PHY_WRITE_TO                    ((uint32_t)0x0000FFFF)
+
+/* Section 3: Common PHY Registers */
+
+#define PHY_BCR                         ((uint16_t)0x00)    /*!< Transceiver Basic Control Register   */
+#define PHY_BSR                         ((uint16_t)0x01)    /*!< Transceiver Basic Status Register    */
+
+#define PHY_RESET                       ((uint16_t)0x8000)  /*!< PHY Reset */
+#define PHY_LOOPBACK                    ((uint16_t)0x4000)  /*!< Select loop-back mode */
+#define PHY_FULLDUPLEX_100M             ((uint16_t)0x2100)  /*!< Set the full-duplex mode at 100 Mb/s */
+#define PHY_HALFDUPLEX_100M             ((uint16_t)0x2000)  /*!< Set the half-duplex mode at 100 Mb/s */
+#define PHY_FULLDUPLEX_10M              ((uint16_t)0x0100)  /*!< Set the full-duplex mode at 10 Mb/s  */
+#define PHY_HALFDUPLEX_10M              ((uint16_t)0x0000)  /*!< Set the half-duplex mode at 10 Mb/s  */
+#define PHY_AUTONEGOTIATION             ((uint16_t)0x1000)  /*!< Enable auto-negotiation function     */
+#define PHY_RESTART_AUTONEGOTIATION     ((uint16_t)0x0200)  /*!< Restart auto-negotiation function    */
+#define PHY_POWERDOWN                   ((uint16_t)0x0800)  /*!< Select the power down mode           */
+#define PHY_ISOLATE                     ((uint16_t)0x0400)  /*!< Isolate PHY from MII                 */
+
+#define PHY_AUTONEGO_COMPLETE           ((uint16_t)0x0020)  /*!< Auto-Negotiation process completed   */
+#define PHY_LINKED_STATUS               ((uint16_t)0x0004)  /*!< Valid link established               */
+#define PHY_JABBER_DETECTION            ((uint16_t)0x0002)  /*!< Jabber condition detected            */
+
+/* Section 4: Extended PHY Registers */
+
+#define PHY_SR                          ((uint16_t)0x10)    /*!< PHY status register Offset                      */
+#define PHY_MICR                        ((uint16_t)0x11)    /*!< MII Interrupt Control Register                  */
+#define PHY_MISR                        ((uint16_t)0x12)    /*!< MII Interrupt Status and Misc. Control Register */
+
+#define PHY_LINK_STATUS                 ((uint16_t)0x0001)  /*!< PHY Link mask                                   */
+#define PHY_SPEED_STATUS                ((uint16_t)0x0002)  /*!< PHY Speed mask                                  */
+#define PHY_DUPLEX_STATUS               ((uint16_t)0x0004)  /*!< PHY Duplex mask                                 */
+
+#define PHY_MICR_INT_EN                 ((uint16_t)0x0002)  /*!< PHY Enable interrupts                           */
+#define PHY_MICR_INT_OE                 ((uint16_t)0x0001)  /*!< PHY Enable output interrupt events              */
+
+#define PHY_MISR_LINK_INT_EN            ((uint16_t)0x0020)  /*!< Enable Interrupt on change of link status       */
+#define PHY_LINK_INTERRUPT              ((uint16_t)0x2000)  /*!< PHY link status interrupt mask                  */
+
+/* Includes ------------------------------------------------------------------*/
+/**
+  * @brief Include module's header file
+  */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+  #include "stm32f4xx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+  #include "stm32f4xx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_DMA_MODULE_ENABLED
+  #include "stm32f4xx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+  #include "stm32f4xx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+  #include "stm32f4xx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_CAN_MODULE_ENABLED
+  #include "stm32f4xx_hal_can.h"
+#endif /* HAL_CAN_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+  #include "stm32f4xx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_CRYP_MODULE_ENABLED
+  #include "stm32f4xx_hal_cryp.h"
+#endif /* HAL_CRYP_MODULE_ENABLED */
+
+#ifdef HAL_DMA2D_MODULE_ENABLED
+  #include "stm32f4xx_hal_dma2d.h"
+#endif /* HAL_DMA2D_MODULE_ENABLED */
+
+#ifdef HAL_DAC_MODULE_ENABLED
+  #include "stm32f4xx_hal_dac.h"
+#endif /* HAL_DAC_MODULE_ENABLED */
+
+#ifdef HAL_DCMI_MODULE_ENABLED
+  #include "stm32f4xx_hal_dcmi.h"
+#endif /* HAL_DCMI_MODULE_ENABLED */
+
+#ifdef HAL_ETH_MODULE_ENABLED
+  #include "stm32f4xx_hal_eth.h"
+#endif /* HAL_ETH_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+  #include "stm32f4xx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_SRAM_MODULE_ENABLED
+  #include "stm32f4xx_hal_sram.h"
+#endif /* HAL_SRAM_MODULE_ENABLED */
+
+#ifdef HAL_NOR_MODULE_ENABLED
+  #include "stm32f4xx_hal_nor.h"
+#endif /* HAL_NOR_MODULE_ENABLED */
+
+#ifdef HAL_NAND_MODULE_ENABLED
+  #include "stm32f4xx_hal_nand.h"
+#endif /* HAL_NAND_MODULE_ENABLED */
+
+#ifdef HAL_PCCARD_MODULE_ENABLED
+  #include "stm32f4xx_hal_pccard.h"
+#endif /* HAL_PCCARD_MODULE_ENABLED */
+
+#ifdef HAL_SDRAM_MODULE_ENABLED
+  #include "stm32f4xx_hal_sdram.h"
+#endif /* HAL_SDRAM_MODULE_ENABLED */
+
+#ifdef HAL_HASH_MODULE_ENABLED
+ #include "stm32f4xx_hal_hash.h"
+#endif /* HAL_HASH_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+ #include "stm32f4xx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_I2S_MODULE_ENABLED
+ #include "stm32f4xx_hal_i2s.h"
+#endif /* HAL_I2S_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+ #include "stm32f4xx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_LTDC_MODULE_ENABLED
+ #include "stm32f4xx_hal_ltdc.h"
+#endif /* HAL_LTDC_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+ #include "stm32f4xx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_RNG_MODULE_ENABLED
+ #include "stm32f4xx_hal_rng.h"
+#endif /* HAL_RNG_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+ #include "stm32f4xx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_SAI_MODULE_ENABLED
+ #include "stm32f4xx_hal_sai.h"
+#endif /* HAL_SAI_MODULE_ENABLED */
+
+#ifdef HAL_SD_MODULE_ENABLED
+ #include "stm32f4xx_hal_sd.h"
+#endif /* HAL_SD_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+ #include "stm32f4xx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+ #include "stm32f4xx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+ #include "stm32f4xx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+ #include "stm32f4xx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+ #include "stm32f4xx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+ #include "stm32f4xx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+ #include "stm32f4xx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+ #include "stm32f4xx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_HCD_MODULE_ENABLED
+ #include "stm32f4xx_hal_hcd.h"
+#endif /* HAL_HCD_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef  USE_FULL_ASSERT
+/**
+  * @brief  The assert_param macro is used for function's parameters check.
+  * @param  expr: If expr is false, it calls assert_failed function
+  *         which reports the name of the source file and the source
+  *         line number of the call that failed.
+  *         If expr is true, it returns no value.
+  * @retval None
+  */
+  #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+  void assert_failed(uint8_t* file, uint32_t line);
+#else
+  #define assert_param(expr) ((void)0)
+#endif /* USE_FULL_ASSERT */
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F4xx_HAL_CONF_H */
+
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


Removing outdated comment

Removing outdated comment

Review URL: https://webrtc-codereview.appspot.com/1025007

git-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@3376 4adac7df-926f-26a2-2b94-8c16560cd09d

--- video_engine/include/vie_rtp_rtcp.h
+++ video_engine/include/vie_rtp_rtcp.h
@@ -231,8 +231,6 @@
   // Enables transmission smoothening, i.e. packets belonging to the same frame
   // will be sent over a longer period of time instead of sending them
   // back-to-back.
-  // NOTE: This is still experimental functionality.
-  // TODO(mflodman) Remove this note when BUG=818 is closed.
   virtual int SetTransmissionSmoothingStatus(int video_channel,
                                              bool enable) = 0;


more cleanups

more cleanups

Signed-off-by: Jens Nyberg <7200009990a46d4bb36e24284136c70d739d75fd@gmail.com>

--- src/kernel/abi.c
+++ src/kernel/abi.c
@@ -12,14 +12,14 @@
 static struct container_mount *getmount(struct container *container, unsigned int mount)
 {

-    return &container->mounts[mount];
+    return &container->mounts[mount & (CONTAINER_MOUNTS - 1)];

 }

 static struct task_descriptor *getdescriptor(struct task *task, unsigned int descriptor)
 {

-    return &task->descriptors[descriptor];
+    return &task->descriptors[descriptor & (TASK_DESCRIPTORS - 1)];

 }

@@ -314,7 +314,7 @@
 unsigned int abi_call(unsigned int index, struct container *container, struct task *task, void *stack)
 {

-    return calls[index & 0x0F](container, task, stack);
+    return calls[index & (CALLS - 1)](container, task, stack);

 }


kclient: fix mds request reference after free bug

--- src/kernel/dir.c
+++ src/kernel/dir.c
@@ -615,7 +615,6 @@

 	ceph_mdsc_lease_release(mdsc, dir, NULL, CEPH_LOCK_ICONTENT);
 	err = ceph_mdsc_do_request(mdsc, req);
-	ceph_mdsc_put_request(req);
 	if (err) {
 		d_drop(dentry);
 	} else if (req->r_reply_info.trace_numd == 0) {
@@ -626,6 +625,7 @@
 		dget(dentry);
 		d_instantiate(dentry, inode);
 	}
+	ceph_mdsc_put_request(req);
 	return err;
 }


Moved implemenation of Krylov member functions into class body

Originally, these functions were implemented outside of the class body
in the belief that it would make the code more readable. In retrospect,
I'm thinking it's quite the opposite.

--- src/solvers/Krylov.h
+++ src/solvers/Krylov.h
@@ -40,9 +40,53 @@
 	 typedef linalg::Vector<T> VecType;
 	 typedef linalg::HessMatrix<T> HessType;

-	 Krylov(Size n_, Size mmax_);
+	 Krylov(Size n_, Size mmax_):n(n_),m(0),mmax(mmax_),krylovSpace(n_,mmax_)
+     {
+        ASSERT(mmax <= n);
+     }

-	 T solve(const L & linO, VecType & x, const VecType & b, const T & tol);
+	 T solve(const L & linO, VecType & x, const VecType & b, const T & tol)
+     {
+        // Initialize working data structure...
+
+        T zero(0);    // zero element of type T
+        VecType r(b); // Residual vector initialized to RHS vector, b
+
+        // Compute residual due to initial guess x...
+
+        T xn = norm2(x);
+        if(xn > zero) r -= prod(linO, x);
+
+        T beta = norm2(r);
+        T rn = beta;
+
+        // Construct Krylov suspace...
+
+        krylovSpace.buildSpace(linO, r, tol); /* Arnoldi or Housholder */
+
+        m = krylovSpace.size();
+
+        // Get the projection of A (i.e. 'linO') on the Krylov subspace...
+
+        HessType hess(m, true);
+        krylovSpace.projA(hess);
+
+        // Compute correction vector...
+
+        VecType y(m);
+        VecType z(n);
+        rn = projectionScheme.solve(beta, hess, y); /* GMRES or Galerkin projection */
+        krylovSpace.map(y, z);
+
+        // Apply correction to intial guess...
+
+        x += z;
+
+        // Return residual norm...
+
+        return rn;
+
+     }

 	 Size subSpaceDim() const {return m;}

@@ -62,62 +106,6 @@

 };

-/*----------------------------------------------------------------------------*/
-/*                                                             IMPLEMENTATION */
-
-template<class T, class L, class K, class P>
-Krylov<T,L,K,P>::Krylov(Size n_, Size mmax_):
-  n(n_),m(0),mmax(mmax_),krylovSpace(n_,mmax_)
-{
-  ASSERT(mmax <= n);
-}
-
-template<class T, class L, class K, class P>
-T Krylov<T,L,K,P>::solve(const L & linO, VecType & x,
-					   const VecType & b, const T & tol)
-{
-
-  // Initialize working data structure...
-
-  T zero(0);    // zero element of type T
-  VecType r(b); // Residual vector initialized to RHS vector, b
-
-  // Compute residual due to initial guess x...
-
-  T xn = norm2(x);
-  if(xn > zero) r -= prod(linO, x);
-
-  T beta = norm2(r);
-  T rn = beta;
-
-  // Construct Krylov suspace...
-
-  krylovSpace.buildSpace(linO, r, tol); /* Arnoldi or Housholder */
-
-  m = krylovSpace.size();
-
-  // Get the projection of A (i.e. 'linO') on the Krylov subspace...
-
-  HessType hess(m, true);
-  krylovSpace.projA(hess);
-
-  // Compute correction vector...
-
-  VecType y(m);
-  VecType z(n);
-  rn = projectionScheme.solve(beta, hess, y); /* GMRES or Galerkin projection */
-  krylovSpace.map(y, z);
-
-  // Apply correction to intial guess...
-
-  x += z;
-
-  // Return residual norm...
-
-  return rn;
-
-}
-
 }}//::numlib::solver

 #endif


* contrib/client-side/svn-push/svn-push.c: Thoughrough overhaul.   Update copyright year. Miscellaneous formatting cleanup.   (my_commit_callback): Update to new api-rev svn_commit_callback2_t.   (open_tmp_file): New function.   (do_job): Fix pool argument to be in conventional last place.     Update many uses of deprecated APIs.     Add proper authentication support using svn_cmdline_setup_auth_baton.     Avoid allocating structures on the stack, because it makes the use of them     look unusual.   (main): Use conventional name 'pool' for apr_pool_t. General tidying up and     simplification.

--- contrib/client-side/svn-push/svn-push.c
+++ contrib/client-side/svn-push/svn-push.c
@@ -2,7 +2,7 @@
  * a different (networked) repository.
  *
  * ====================================================================
- * Copyright (c) 2000-2003 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2006 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -18,128 +18,117 @@
 #include <stdio.h>

 #include "svn_pools.h"
+#include "svn_path.h"
 #include "svn_ra.h"
 #include "svn_delta.h"
 #include "svn_config.h"
 #include "svn_cmdline.h"

+/* Implements svn_commit_callback2_t. */
 static svn_error_t *
-my_commit_callback (svn_revnum_t new_revision,
-		    const char *date, const char *author, void *baton)
+my_commit_callback (const svn_commit_info_t *ci, void *baton, apr_pool_t *pool)
 {
   printf ("Commiting Rev. %" SVN_REVNUM_T_FMT " at date \"%s\", by "
-          "author \"%s\"", new_revision, date, author);
+          "author \"%s\"\n", ci->revision, ci->date, ci->author);
+  if (ci->post_commit_err)
+    printf ("Post-commit Error: %s\n", ci->post_commit_err);
+  return SVN_NO_ERROR;
+}
+
+
+/* Implements svn_ra_callbacks2_t.open_tmp_file */
+static svn_error_t *
+open_tmp_file (apr_file_t **fp, void *callback_baton, apr_pool_t *pool)
+{
+  const char *path;
+
+  SVN_ERR (svn_io_temp_dir (&path, pool));
+  path = svn_path_join (path, "tempfile", pool);
+  SVN_ERR (svn_io_open_unique_file (fp, NULL, path, ".tmp", TRUE, pool));

   return SVN_NO_ERROR;
 }

+
 svn_error_t *(*old_change_file_prop) (void *file_baton,
-				      const char *name,
-				      const svn_string_t * value,
-				      apr_pool_t * pool);
+                                      const char *name,
+                                      const svn_string_t *value,
+                                      apr_pool_t *pool);

-svn_error_t *(*old_change_dir_prop) (void *dir_baton,
-				     const char *name,
-				     const svn_string_t * value,
-				     apr_pool_t * pool);
-
+/* Implements svn_ra_callbacks2_t.change_file_prop */
 static svn_error_t *
-new_change_file_prop (void *file_baton,
-		      const char *name,
-		      const svn_string_t * value, apr_pool_t * pool)
+new_change_file_prop (void *file_baton, const char *name,
+                      const svn_string_t *value, apr_pool_t *pool)
 {
   if (svn_property_kind (NULL, name) != svn_prop_regular_kind)
-    {
-      /* Do nothing */
-      return SVN_NO_ERROR;
-    }
+    return SVN_NO_ERROR;
   else
     return old_change_file_prop (file_baton, name, value, pool);
 }

+
+svn_error_t *(*old_change_dir_prop) (void *dir_baton,
+                                     const char *name,
+                                     const svn_string_t *value,
+                                     apr_pool_t *pool);
+
+/* Implements svn_ra_callbacks2_t.change_dir_prop */
 static svn_error_t *
-new_change_dir_prop (void *dir_baton,
-		     const char *name,
-		     const svn_string_t * value, apr_pool_t * pool)
+new_change_dir_prop (void *dir_baton, const char *name,
+                     const svn_string_t *value, apr_pool_t *pool)
 {
   if (svn_property_kind (NULL, name) != svn_prop_regular_kind)
-    {
-      return SVN_NO_ERROR;	/* Do nothing */
-    }
+    return SVN_NO_ERROR;
   else
     return old_change_dir_prop (dir_baton, name, value, pool);
 }

-
 static svn_error_t *
-do_job (apr_pool_t * pool, const char *src_url, const char *dest_url,
-	int start_rev, int end_rev)
+do_job (const char *src_url, const char *dest_url, int start_rev, int end_rev,
+        apr_pool_t *pool)
 {
-  svn_ra_plugin_t *ra_src, *ra_dest;
-  void *ra_src_sess_baton, *ra_dest_sess_baton;
-  const svn_delta_editor_t *delta_editor;
-  svn_delta_editor_t my_delta_editor;
+  apr_hash_t *config;
+  svn_config_t *cfg;
+  svn_auth_baton_t *ab;
+  svn_ra_callbacks2_t *callbacks;
+  svn_ra_session_t *ra_src, *ra_dest;
+  const svn_delta_editor_t *editor;
+  svn_delta_editor_t *my_editor;
   void *edit_baton;
-  void *ra_baton;
-  const svn_ra_reporter_t *reporter;
+  const svn_ra_reporter2_t *reporter;
   void *report_baton;
-  apr_hash_t *config;
-  svn_ra_callbacks_t dest_callbacks;
-
-#if 0
-  svn_auth_baton_t *ab;
-  apr_array_header_t *providers;
-#endif

   SVN_ERR (svn_config_get_config (&config, NULL, pool));
+  cfg = apr_hash_get (config, SVN_CONFIG_CATEGORY_CONFIG, APR_HASH_KEY_STRING);

-  SVN_ERR (svn_ra_init_ra_libs (&ra_baton, pool));
+  SVN_ERR (svn_cmdline_setup_auth_baton (&ab, FALSE, NULL, NULL, NULL, FALSE,
+                                         cfg, NULL, NULL, pool));
+  SVN_ERR (svn_ra_create_callbacks (&callbacks, pool));
+  callbacks->open_tmp_file = open_tmp_file;
+  callbacks->auth_baton = ab;

-  SVN_ERR (svn_ra_get_ra_library (&ra_src, ra_baton, src_url, pool));
+  SVN_ERR (svn_ra_open2 (&ra_dest, dest_url, callbacks, NULL, config, pool));
+  SVN_ERR (svn_ra_open2 (&ra_src, src_url, callbacks, NULL, config, pool));

-  SVN_ERR (svn_ra_get_ra_library (&ra_dest, ra_baton, dest_url, pool));
+  SVN_ERR (svn_ra_get_commit_editor2 (ra_dest, &editor, &edit_baton,
+                                      "Hello World!", my_commit_callback,
+                                      NULL, NULL, TRUE, pool));

-  memset ((void *) &dest_callbacks, '\0', sizeof (dest_callbacks));
+  /* Create a copy of the editor so we can hook some calls. */
+  my_editor = apr_palloc (pool, sizeof (*my_editor));
+  *my_editor = *editor;

-#if 0
-  providers
-    = apr_array_make (pool, 10, sizeof (svn_auth_provider_object_t *));
+  /* Install the editor hooks. */
+  old_change_file_prop = editor->change_file_prop;
+  my_editor->change_file_prop = new_change_file_prop;
+  old_change_dir_prop = editor->change_dir_prop;
+  my_editor->change_dir_prop = new_change_dir_prop;

-
-  svn_auth_open (&ab, providers, pool);
-#endif
-
-  SVN_ERR (ra_dest->open (&ra_dest_sess_baton,
-			  dest_url, &dest_callbacks, NULL, config, pool));
-
-  SVN_ERR (ra_src->open (&ra_src_sess_baton,
-			 src_url, &dest_callbacks, NULL, config, pool));
-
-
-  SVN_ERR (ra_dest->get_commit_editor (ra_dest_sess_baton,
-				       &delta_editor,
-				       &edit_baton,
-				       "Hello World!",
-				       my_commit_callback, NULL, pool));
-
-  my_delta_editor = *delta_editor;
-
-  old_change_dir_prop = my_delta_editor.change_dir_prop;
-  my_delta_editor.change_dir_prop = new_change_dir_prop;
-
-  old_change_file_prop = my_delta_editor.change_file_prop;
-  my_delta_editor.change_file_prop = new_change_file_prop;
-
-  SVN_ERR (ra_src->do_diff (ra_src_sess_baton,
-			    &reporter,
-			    &report_baton,
-			    end_rev,
-			    "",
-			    1, 1, src_url, &my_delta_editor, edit_baton, pool));
-
-  SVN_ERR (reporter->set_path (report_baton, "", start_rev, 0, pool));
-
+  SVN_ERR (svn_ra_do_diff (ra_src, &reporter, &report_baton,
+                           end_rev, "", TRUE, TRUE, src_url,
+                           my_editor, edit_baton, pool));
+  SVN_ERR (reporter->set_path (report_baton, "", start_rev, 0, NULL, pool));
   SVN_ERR (reporter->finish_report (report_baton, pool));

   return SVN_NO_ERROR;
@@ -166,64 +155,38 @@
 int
 main (int argc, char *argv[])
 {
-  apr_pool_t *top_pool;
+  apr_pool_t *pool;
   svn_error_t *error = NULL;
   int start_rev, end_rev;
   char *src_url, *dest_url;

-
-  /* Initialize the app.  Send all error messages to 'stderr'.  */
-  if (svn_cmdline_init ("minimal_client", stderr) != EXIT_SUCCESS)
+  if (svn_cmdline_init ("svn-push", stderr) != EXIT_SUCCESS)
     return EXIT_FAILURE;

-  top_pool = svn_pool_create (NULL);
-
-  /* Check library versions */
-  error = check_lib_versions ();
-  if (error)
+  if (argc != 5 ||
+      strcmp (argv[1], "-r") != 0 ||
+      sscanf (argv[2], "%i:%i", &start_rev, &end_rev) != 2)
     {
-      svn_handle_error2 (error, stderr, FALSE, "svn-push");
+      fprintf(stderr, "%s", "Usage : svn-push -r N:M SRC_URL DEST_URL\n");
       return EXIT_FAILURE;
-    }
-
-#define CMD_LINE_ERROR \
-        { \
-        fprintf(stderr, "%s",  \
-                "Usage : svn-push -r N:M [SRC_URL] [DEST_URL]\n"); \
-        goto error; \
-        } \
-
-  if (argc != 5)
-    {
-    CMD_LINE_ERROR
-    }
-
-  if (strcmp (argv[1], "-r"))
-    {
-    CMD_LINE_ERROR
-    }
-
-  if (sscanf (argv[2], "%i:%i", &start_rev, &end_rev) != 2)
-    {
-    CMD_LINE_ERROR
     }

   src_url = argv[3];
   dest_url = argv[4];

-  error = do_job (top_pool, src_url, dest_url, start_rev, end_rev);
+  pool = svn_pool_create (NULL);

-  if (error)
-    {
-      svn_handle_error2 (error, stderr, FALSE, "svn-push: ");
-      return EXIT_FAILURE;
-    }
+  /* Check library versions */
+  error = check_lib_versions ();
+  if (error) goto error;

+  error = do_job (src_url, dest_url, start_rev, end_rev, pool);
+  if (error) goto error;
+
+  svn_pool_destroy (pool);
+  return EXIT_SUCCESS;

 error:
-  svn_pool_destroy (top_pool);
-
-  return 0;
+  svn_handle_error2 (error, stderr, FALSE, "svn-push: ");
+  return EXIT_FAILURE;
 }
-
-


[core] typo in trace

[core] typo in trace

--- src/configfile.c
+++ src/configfile.c
@@ -1460,7 +1460,7 @@
 			}
 			if (0 != wstatus) {
 				log_error_write(srv, __FILE__, __LINE__, "SSsd",
-						"commaned \"", cmd, "\" exited non-zero:", WEXITSTATUS(wstatus));
+						"command \"", cmd, "\" exited non-zero:", WEXITSTATUS(wstatus));
 				ret = -1;
 			}


Remove a debug print.

Remove a debug print.

--- src/connection.c
+++ src/connection.c
@@ -760,8 +760,6 @@
     conn->buf[BUFFER_SIZE] = '\0';  // always cap it off

     while(finished != 1 && remaining >= 0) {
-        debug("READ: %d of %d", conn->nread, remaining);
-
         n = fdrecv(conn->fd, cur_buf, remaining);
         check_debug(n > 0, "Failed to read from socket after %d read: %d parsed.",
                     conn->nread, (int)conn->nparsed);


connection: Use uin32_t for circular buffer indexes

We rely on well-defined unsigned overflow behaviour so let's make the
index fields actually unsigned.  Signed ints aren't guaranteed to have the
behavior we want (could be either ones or twos complement).

--- src/connection.c
+++ src/connection.c
@@ -44,7 +44,7 @@

 struct wl_buffer {
 	char data[4096];
-	int head, tail;
+	uint32_t head, tail;
 };

 #define MASK(i) ((i) & 4095)
@@ -70,7 +70,7 @@
 static void
 wl_buffer_put(struct wl_buffer *b, const void *data, size_t count)
 {
-	int head, size;
+	uint32_t head, size;

 	head = MASK(b->head);
 	if (head + count <= sizeof b->data) {
@@ -87,7 +87,7 @@
 static void
 wl_buffer_put_iov(struct wl_buffer *b, struct iovec *iov, int *count)
 {
-	int head, tail;
+	uint32_t head, tail;

 	head = MASK(b->head);
 	tail = MASK(b->tail);
@@ -111,7 +111,7 @@
 static void
 wl_buffer_get_iov(struct wl_buffer *b, struct iovec *iov, int *count)
 {
-	int head, tail;
+	uint32_t head, tail;

 	head = MASK(b->head);
 	tail = MASK(b->tail);
@@ -135,7 +135,7 @@
 static void
 wl_buffer_copy(struct wl_buffer *b, void *data, size_t count)
 {
-	int tail, size;
+	uint32_t tail, size;

 	tail = MASK(b->tail);
 	if (tail + count <= sizeof b->data) {
@@ -147,7 +147,7 @@
 	}
 }

-static int
+static uint32_t
 wl_buffer_size(struct wl_buffer *b)
 {
 	return b->head - b->tail;


[Edited the empty_main app test]

[Edited the empty_main app test]

--- tests/apps/empty_main/empty_main.c
+++ tests/apps/empty_main/empty_main.c
@@ -1,4 +1,8 @@
+#include "carbon_user.h"
+
 int main(int argc, char **argv)
 {
+   CarbonStartSim(argc, argv);
+   CarbonStopSim();
    return 0;
 }