freedreno/compiler/a3xx: remove lowered instructions

Signed-off-by: Rob Clark <6f78cdb10adbe0a7fbbf4098125a51f401c77a5f@freedesktop.org>

--- src/gallium/drivers/freedreno/a3xx/fd3_compiler.c
+++ src/gallium/drivers/freedreno/a3xx/fd3_compiler.c
@@ -418,20 +418,6 @@
 	return tmp_src;
 }

-/* same as get_internal_temp, but w/ src.xxxx (for instructions that
- * replicate their results)
- */
-static struct tgsi_src_register *
-get_internal_temp_repl(struct fd3_compile_context *ctx,
-		struct tgsi_dst_register *tmp_dst)
-{
-	struct tgsi_src_register *tmp_src =
-			get_internal_temp(ctx, tmp_dst);
-	tmp_src->SwizzleX = tmp_src->SwizzleY =
-		tmp_src->SwizzleZ = tmp_src->SwizzleW = TGSI_SWIZZLE_X;
-	return tmp_src;
-}
-
 static inline bool
 is_const(struct tgsi_src_register *src)
 {
@@ -706,227 +692,6 @@
  * native instructions:
  */

-/* LIT - Light Coefficients:
- *   dst.x = 1.0
- *   dst.y = max(src.x, 0.0)
- *   dst.z = (src.x > 0.0) ? max(src.y, 0.0)^{clamp(src.w, -128.0, 128.0))} : 0.0
- *   dst.w = 1.0
- *
- *   max.f tmp.y, src.y, {0.0}
- *   nop
- *   max.f tmp.z, src.w, {-128.0}
- *   cmps.f.ge tmp.w, (neg)src.x, {0.0}
- *   max.f dst.y, src.x, {0.0}
- *   nop
- *   min.f tmp.x, tmp.z, {128.0}
- *   add.s tmp.z, tmp.w, -1
- *   log2 tmp.y, tmp.y
- *   (rpt1)nop
- *   (ss)mul.f tmp.x, tmp.x, tmp.y
- *   mov.f16f16 dst.x, {1.0}
- *   mov.f16f16 dst.w, {1.0}
- *   (rpt3)nop
- *   exp2 tmp.x, tmp.x
- *   (ss)sel.f16 dst.z, {0.0}, tmp.z, tmp.x
- */
-static void
-trans_lit(const struct instr_translater *t,
-		struct fd3_compile_context *ctx,
-		struct tgsi_full_instruction *inst)
-{
-	struct ir3_instruction *instr;
-	struct ir3_register *r;
-	struct tgsi_dst_register tmp_dst;
-	struct tgsi_src_register *tmp_src;
-	struct tgsi_src_register constval0, constval1, constval128;
-	struct tgsi_src_register *src = &inst->Src[0].Register;
-	struct tgsi_dst_register *dst = get_dst(ctx, inst);
-
-	tmp_src = get_internal_temp_repl(ctx, &tmp_dst);
-
-	if (is_const(src))
-		src = get_unconst(ctx, src);
-
-	get_immediate(ctx, &constval0, fui(0.0));
-	get_immediate(ctx, &constval1, fui(1.0));
-	get_immediate(ctx, &constval128, fui(128.0));
-
-	/* max.f tmp.y, src.y, {0.0} */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_MAX_F);
-	add_dst_reg(ctx, instr, &tmp_dst, TGSI_SWIZZLE_Y);
-	add_src_reg(ctx, instr, src, TGSI_SWIZZLE_Y);
-	add_src_reg(ctx, instr, &constval0, constval0.SwizzleX);
-
-	/* nop */
-	ir3_instr_create(ctx->ir, 0, OPC_NOP);
-
-	/* max.f tmp.z, src.w, {-128.0} */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_MAX_F);
-	add_dst_reg(ctx, instr, &tmp_dst, TGSI_SWIZZLE_Z);
-	add_src_reg(ctx, instr, src, TGSI_SWIZZLE_W);
-	add_src_reg(ctx, instr, &constval128,
-			constval128.SwizzleX)->flags |= IR3_REG_NEGATE;
-
-	/* cmps.f.ge tmp.w, (neg)src.x, {0.0} */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_CMPS_F);
-	add_dst_reg(ctx, instr, &tmp_dst, TGSI_SWIZZLE_W);
-	add_src_reg(ctx, instr, src, TGSI_SWIZZLE_X)->flags |= IR3_REG_NEGATE;
-	add_src_reg(ctx, instr, &constval0, constval0.SwizzleX);
-	instr->cat2.condition = IR3_COND_GE;
-
-	/* max.f dst.y, src.x, {0.0} */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_MAX_F);
-	add_dst_reg(ctx, instr, dst, TGSI_SWIZZLE_Y);
-	add_src_reg(ctx, instr, src, TGSI_SWIZZLE_X);
-	add_src_reg(ctx, instr, &constval0, constval0.SwizzleX);
-
-	/* nop */
-	ir3_instr_create(ctx->ir, 0, OPC_NOP);
-
-	/* min.f tmp.x, tmp.z, {128.0} */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_MIN_F);
-	add_dst_reg(ctx, instr, &tmp_dst, TGSI_SWIZZLE_X);
-	add_src_reg(ctx, instr, tmp_src, TGSI_SWIZZLE_Z);
-	add_src_reg(ctx, instr, &constval128, constval128.SwizzleX);
-
-	/* add.s tmp.z, tmp.w, -1 */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_ADD_S);
-	add_dst_reg(ctx, instr, &tmp_dst, TGSI_SWIZZLE_Z);
-	add_src_reg(ctx, instr, tmp_src, TGSI_SWIZZLE_W);
-	ir3_reg_create(instr, 0, IR3_REG_IMMED)->iim_val = -1;
-
-	/* log2 tmp.y, tmp.y */
-	instr = ir3_instr_create(ctx->ir, 4, OPC_LOG2);
-	r = add_dst_reg(ctx, instr, &tmp_dst, TGSI_SWIZZLE_Y);
-	add_src_reg(ctx, instr, tmp_src, TGSI_SWIZZLE_Y);
-	regmask_set(ctx->needs_ss, r, TGSI_WRITEMASK_Y);
-
-	/* (rpt1)nop */
-	ir3_instr_create(ctx->ir, 0, OPC_NOP)->repeat = 1;
-
-	/* (ss)mul.f tmp.x, tmp.x, tmp.y */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_MUL_F);
-	add_dst_reg(ctx, instr, &tmp_dst, TGSI_SWIZZLE_X);
-	add_src_reg(ctx, instr, tmp_src, TGSI_SWIZZLE_X);
-	add_src_reg(ctx, instr, tmp_src, TGSI_SWIZZLE_Y);
-
-	/* mov.f16f16 dst.x, {1.0} */
-	instr = ir3_instr_create(ctx->ir, 1, 0);
-	instr->cat1.src_type = get_ftype(ctx);
-	instr->cat1.dst_type = get_ftype(ctx);
-	add_dst_reg(ctx, instr, dst, TGSI_SWIZZLE_X);
-	add_src_reg(ctx, instr, &constval1, constval1.SwizzleX);
-
-	/* mov.f16f16 dst.w, {1.0} */
-	instr = ir3_instr_create(ctx->ir, 1, 0);
-	instr->cat1.src_type = get_ftype(ctx);
-	instr->cat1.dst_type = get_ftype(ctx);
-	add_dst_reg(ctx, instr, dst, TGSI_SWIZZLE_W);
-	add_src_reg(ctx, instr, &constval1, constval1.SwizzleX);
-
-	/* (rpt3)nop */
-	ir3_instr_create(ctx->ir, 0, OPC_NOP)->repeat = 3;
-
-	/* exp2 tmp.x, tmp.x */
-	instr = ir3_instr_create(ctx->ir, 4, OPC_EXP2);
-	r = add_dst_reg(ctx, instr, &tmp_dst, TGSI_SWIZZLE_X);
-	add_src_reg(ctx, instr, tmp_src, TGSI_SWIZZLE_X);
-	regmask_set(ctx->needs_ss, r, TGSI_WRITEMASK_X);
-
-	/* (ss)sel.f16 dst.z, {0.0}, tmp.z, tmp.x */
-	instr = ir3_instr_create(ctx->ir, 3,
-			ctx->so->half_precision ? OPC_SEL_F16 : OPC_SEL_F32);
-	add_dst_reg(ctx, instr, dst, TGSI_SWIZZLE_Z);
-	add_src_reg(ctx, instr, &constval0, constval0.SwizzleX);
-	add_src_reg(ctx, instr, tmp_src, TGSI_SWIZZLE_Z);
-	add_src_reg(ctx, instr, tmp_src, TGSI_SWIZZLE_X);
-
-	put_dst(ctx, inst, dst);
-}
-
-static inline void
-get_swiz(unsigned *swiz, struct tgsi_src_register *src)
-{
-	swiz[0] = src->SwizzleX;
-	swiz[1] = src->SwizzleY;
-	swiz[2] = src->SwizzleZ;
-	swiz[3] = src->SwizzleW;
-}
-
-static void
-trans_dotp(const struct instr_translater *t,
-		struct fd3_compile_context *ctx,
-		struct tgsi_full_instruction *inst)
-{
-	struct ir3_instruction *instr;
-	struct tgsi_dst_register tmp_dst;
-	struct tgsi_src_register *tmp_src;
-	struct tgsi_dst_register *dst  = &inst->Dst[0].Register;
-	struct tgsi_src_register *src0 = &inst->Src[0].Register;
-	struct tgsi_src_register *src1 = &inst->Src[1].Register;
-	unsigned swiz0[4];
-	unsigned swiz1[4];
-	opc_t opc_mad    = ctx->so->half_precision ? OPC_MAD_F16 : OPC_MAD_F32;
-	unsigned n = t->arg;     /* number of components */
-	unsigned i, swapped = 0;
-
-	tmp_src = get_internal_temp_repl(ctx, &tmp_dst);
-
-	/* in particular, can't handle const for src1 for cat3/mad:
-	 */
-	if (is_rel_or_const(src1)) {
-		if (!is_rel_or_const(src0)) {
-			struct tgsi_src_register *tmp;
-			tmp = src0;
-			src0 = src1;
-			src1 = tmp;
-			swapped = 1;
-		} else {
-			src0 = get_unconst(ctx, src0);
-		}
-	}
-
-	get_swiz(swiz0, src0);
-	get_swiz(swiz1, src1);
-
-	instr = ir3_instr_create(ctx->ir, 2, OPC_MUL_F);
-	add_dst_reg(ctx, instr, &tmp_dst, 0);
-	add_src_reg(ctx, instr, src0, swiz0[0]);
-	add_src_reg(ctx, instr, src1, swiz1[0]);
-
-	for (i = 1; i < n; i++) {
-		ir3_instr_create(ctx->ir, 0, OPC_NOP);
-
-		instr = ir3_instr_create(ctx->ir, 3, opc_mad);
-		add_dst_reg(ctx, instr, &tmp_dst, 0);
-		add_src_reg(ctx, instr, src0, swiz0[i]);
-		add_src_reg(ctx, instr, src1, swiz1[i]);
-		add_src_reg(ctx, instr, tmp_src, 0);
-	}
-
-	/* DPH(a,b) = (a.x * b.x) + (a.y * b.y) + (a.z * b.z) + b.w */
-	if (t->tgsi_opc == TGSI_OPCODE_DPH) {
-		ir3_instr_create(ctx->ir, 0, OPC_NOP)->repeat = 1;
-
-		instr = ir3_instr_create(ctx->ir, 2, OPC_ADD_F);
-		add_dst_reg(ctx, instr, &tmp_dst, 0);
-		if (swapped)
-			add_src_reg(ctx, instr, src0, swiz0[i]);
-		else
-			add_src_reg(ctx, instr, src1, swiz1[i]);
-		add_src_reg(ctx, instr, tmp_src, 0);
-
-		n++;
-	}
-
-	ir3_instr_create(ctx->ir, 0, OPC_NOP)->repeat = 2;
-
-	/* because of get_internal_temp_repl(), this will replicate
-	 * the results to all components of dst:
-	 */
-	create_mov(ctx, dst, tmp_src);
-}
-
 static void
 trans_clamp(const struct instr_translater *t,
 		struct fd3_compile_context *ctx,
@@ -940,73 +705,6 @@
 	create_clamp(ctx, dst, src0, src1, src2);

 	put_dst(ctx, inst, dst);
-}
-
-/* LRP(a,b,c) = (a * b) + ((1 - a) * c) */
-static void
-trans_lrp(const struct instr_translater *t,
-		struct fd3_compile_context *ctx,
-		struct tgsi_full_instruction *inst)
-{
-	struct ir3_instruction *instr;
-	struct tgsi_dst_register tmp_dst1, tmp_dst2;
-	struct tgsi_src_register *tmp_src1, *tmp_src2;
-	struct tgsi_src_register tmp_const;
-	struct tgsi_src_register *src0 = &inst->Src[0].Register;
-	struct tgsi_src_register *src1 = &inst->Src[1].Register;
-
-	if (is_const(src0) && is_const(src1))
-		src0 = get_unconst(ctx, src0);
-
-	tmp_src1 = get_internal_temp(ctx, &tmp_dst1);
-	tmp_src2 = get_internal_temp(ctx, &tmp_dst2);
-
-	get_immediate(ctx, &tmp_const, fui(1.0));
-
-	/* tmp1 = (a * b) */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_MUL_F);
-	vectorize(ctx, instr, &tmp_dst1, 2, src0, 0, src1, 0);
-
-	/* tmp2 = (1 - a) */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_ADD_F);
-	vectorize(ctx, instr, &tmp_dst2, 2, &tmp_const, 0,
-			src0, IR3_REG_NEGATE);
-
-	/* tmp2 = tmp2 * c */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_MUL_F);
-	vectorize(ctx, instr, &tmp_dst2, 2,
-			tmp_src2, 0,
-			&inst->Src[2].Register, 0);
-
-	/* dst = tmp1 + tmp2 */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_ADD_F);
-	vectorize(ctx, instr, &inst->Dst[0].Register, 2,
-			tmp_src1, 0,
-			tmp_src2, 0);
-}
-
-/* FRC(x) = x - FLOOR(x) */
-static void
-trans_frac(const struct instr_translater *t,
-		struct fd3_compile_context *ctx,
-		struct tgsi_full_instruction *inst)
-{
-	struct ir3_instruction *instr;
-	struct tgsi_dst_register tmp_dst;
-	struct tgsi_src_register *tmp_src;
-
-	tmp_src = get_internal_temp(ctx, &tmp_dst);
-
-	/* tmp = FLOOR(x) */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_FLOOR_F);
-	vectorize(ctx, instr, &tmp_dst, 1,
-			&inst->Src[0].Register, 0);
-
-	/* dst = x - tmp */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_ADD_F);
-	vectorize(ctx, instr, &inst->Dst[0].Register, 2,
-			&inst->Src[0].Register, 0,
-			tmp_src, IR3_REG_NEGATE);
 }

 /* ARL(x) = x, but mova from hrN.x to a0.. */
@@ -1053,50 +751,6 @@

 	/* need to ensure 5 instr slots before a0 is used: */
 	ir3_instr_create(ctx->ir, 0, OPC_NOP)->repeat = 5;
-}
-
-/* POW(a,b) = EXP2(b * LOG2(a)) */
-static void
-trans_pow(const struct instr_translater *t,
-		struct fd3_compile_context *ctx,
-		struct tgsi_full_instruction *inst)
-{
-	struct ir3_instruction *instr;
-	struct ir3_register *r;
-	struct tgsi_dst_register tmp_dst;
-	struct tgsi_src_register *tmp_src;
-	struct tgsi_dst_register *dst  = &inst->Dst[0].Register;
-	struct tgsi_src_register *src0 = &inst->Src[0].Register;
-	struct tgsi_src_register *src1 = &inst->Src[1].Register;
-
-	tmp_src = get_internal_temp_repl(ctx, &tmp_dst);
-
-	/* log2 Rtmp, Rsrc0 */
-	ir3_instr_create(ctx->ir, 0, OPC_NOP)->repeat = 5;
-	instr = ir3_instr_create(ctx->ir, 4, OPC_LOG2);
-	r = add_dst_reg(ctx, instr, &tmp_dst, 0);
-	add_src_reg(ctx, instr, src0, src0->SwizzleX);
-	regmask_set(ctx->needs_ss, r, TGSI_WRITEMASK_X);
-
-	/* mul.f Rtmp, Rtmp, Rsrc1 */
-	instr = ir3_instr_create(ctx->ir, 2, OPC_MUL_F);
-	add_dst_reg(ctx, instr, &tmp_dst, 0);
-	add_src_reg(ctx, instr, tmp_src, 0);
-	add_src_reg(ctx, instr, src1, src1->SwizzleX);
-
-	/* blob compiler seems to ensure there are at least 6 instructions
-	 * between a "simple" (non-cat4) instruction and a dependent cat4..
-	 * probably we need to handle this in some other places too.
-	 */
-	ir3_instr_create(ctx->ir, 0, OPC_NOP)->repeat = 5;
-
-	/* exp2 Rdst, Rtmp */
-	instr = ir3_instr_create(ctx->ir, 4, OPC_EXP2);
-	r = add_dst_reg(ctx, instr, &tmp_dst, 0);
-	add_src_reg(ctx, instr, tmp_src, 0);
-	regmask_set(ctx->needs_ss, r, TGSI_WRITEMASK_X);
-
-	create_mov(ctx, dst, tmp_src);
 }

 /* texture fetch/sample instructions: */
@@ -1591,30 +1245,22 @@
 	[TGSI_OPCODE_ ## n] = { .fxn = (f), .tgsi_opc = TGSI_OPCODE_ ## n, ##__VA_ARGS__ }

 	INSTR(MOV,          instr_cat1),
-	INSTR(LIT,          trans_lit),
 	INSTR(RCP,          instr_cat4, .opc = OPC_RCP),
 	INSTR(RSQ,          instr_cat4, .opc = OPC_RSQ),
 	INSTR(SQRT,         instr_cat4, .opc = OPC_SQRT),
 	INSTR(MUL,          instr_cat2, .opc = OPC_MUL_F),
 	INSTR(ADD,          instr_cat2, .opc = OPC_ADD_F),
 	INSTR(SUB,          instr_cat2, .opc = OPC_ADD_F),
-	INSTR(DP2,          trans_dotp, .arg = 2),
-	INSTR(DP3,          trans_dotp, .arg = 3),
-	INSTR(DP4,          trans_dotp, .arg = 4),
-	INSTR(DPH,          trans_dotp, .arg = 3),   /* almost like DP3 */
 	INSTR(MIN,          instr_cat2, .opc = OPC_MIN_F),
 	INSTR(MAX,          instr_cat2, .opc = OPC_MAX_F),
 	INSTR(MAD,          instr_cat3, .opc = OPC_MAD_F32, .hopc = OPC_MAD_F16),
 	INSTR(TRUNC,        instr_cat2, .opc = OPC_TRUNC_F),
-	INSTR(LRP,          trans_lrp),
-	INSTR(FRC,          trans_frac),
 	INSTR(CLAMP,        trans_clamp),
 	INSTR(FLR,          instr_cat2, .opc = OPC_FLOOR_F),
 	INSTR(ROUND,        instr_cat2, .opc = OPC_RNDNE_F),
 	INSTR(ARL,          trans_arl),
 	INSTR(EX2,          instr_cat4, .opc = OPC_EXP2),
 	INSTR(LG2,          instr_cat4, .opc = OPC_LOG2),
-	INSTR(POW,          trans_pow),
 	INSTR(ABS,          instr_cat2, .opc = OPC_ABSNEG_F),
 	INSTR(COS,          instr_cat4, .opc = OPC_COS),
 	INSTR(SIN,          instr_cat4, .opc = OPC_SIN),


changed method of adressing bucket map data to write

--- src/dictionary/linear_hash/linear_hash.c
+++ src/dictionary/linear_hash/linear_hash.c
@@ -160,7 +160,7 @@
 		return err_file_write_error;
 	}

-	if (1 != fwrite(&linear_hash->bucket_map->data, sizeof(ion_fpos_t) * linear_hash->num_buckets, 1, linear_hash->state)) {
+	if (1 != fwrite(&linear_hash->bucket_map->data, sizeof(ion_fpos_t) * (linear_hash->bucket_map->current_size - 1), 1, linear_hash->state)) {
 		return err_file_write_error;
 	}

@@ -1339,9 +1339,9 @@
 ) {
 	array_list->current_size	= init_size;
 	array_list->data			= malloc(init_size * sizeof(ion_fpos_t));
-    memset(array_list->data, 0, sizeof(ion_fpos_t) * init_size);
-
-    if (NULL == array_list->data) {
+	memset(array_list->data, 0, sizeof(ion_fpos_t) * init_size);
+
+	if (NULL == array_list->data) {
 		return err_out_of_memory;
 	}

@@ -1370,7 +1370,7 @@
 		array_list->current_size	= array_list->current_size * 2;

 		array_list->data			= (ion_fpos_t *) realloc(array_list->data, array_list->current_size * sizeof(ion_fpos_t));
-        memset(array_list->data + sizeof(ion_fpos_t) * bucket_idx, 0, sizeof(ion_fpos_t) * array_list->current_size - bucket_idx);
+		memset(array_list->data + sizeof(ion_fpos_t) * bucket_idx, 0, sizeof(ion_fpos_t) * array_list->current_size - bucket_idx);

 		if (NULL == array_list->data) {
 			free(array_list->data);


modify temperature converter

modify temperature converter

hi, i'm extended text and i'm optional.

--- ch1/temperature_converter.c
+++ ch1/temperature_converter.c
@@ -1,25 +1,25 @@
 #include <stdio.h>

 int fahrToCels(void) {
-    float tempCelsius = 0, tempFahrenheit = 0;
+    //float tempCelsius = 0, tempFahrenheit = 0;

     printf("Fahrenheit \t Celsius \n");
-    for(int i = 0; i <= 300; i += 20) {
-        tempFahrenheit = i;
-        tempCelsius = (5.0/9.0) * (tempFahrenheit - 32.0);
-        printf("%6.0f \t\t %6.1f \n", tempFahrenheit, tempCelsius);
+    for(int i = 300; i >= 00; i -= 20) {
+        //tempFahrenheit = i;
+        //tempCelsius = (5.0/9.0) * (tempFahrenheit - 32.0);
+        printf("%6d \t\t %6.1f \n", i, (5.0/9.0) * (i - 32.0));
     }
     return 0;
 }

 int celsToFahr(void) {
-    float tempCelsius = 0, tempFahrenheit = 0;
+    //float tempCelsius = 0, tempFahrenheit = 0;

     printf("Celsius \t Fahrenheit \n");
     for(int i = 0; i <= 300; i += 20) {
-        tempCelsius = i;
-        tempFahrenheit = (9.0/5.0) * (tempCelsius + 32.0);
-        printf("%6.0f \t\t %6.1f \n", tempCelsius, tempFahrenheit);
+        //tempCelsius = i;
+        //tempFahrenheit = (9.0/5.0) * (tempCelsius + 32.0);
+        printf("%6d \t\t %6.1f \n", i, (9.0/5.0) * (i + 32.0));
     }
     return 0;
 }


implemented upsert in linear_hash_update

--- src/dictionary/linear_hash/linear_hash.c
+++ src/dictionary/linear_hash/linear_hash.c
@@ -529,8 +529,9 @@
 	}

 	if (status.count == 0) {
-		printf("Record not found\n");
+		printf("Record not found, performing upsert\n");
 		status.error = err_item_not_found;
+		return linear_hash_insert(key, value, insert_hash_to_bucket(key, linear_hash), linear_hash);
 	}
 	else {
 		status.error = err_ok;


avoid compound logic

avoid compound logic

--- msctl/msctl.c
+++ msctl/msctl.c
@@ -325,13 +325,14 @@
 	/* parse I/O systems */
 	ra.nios = 0;
 	for (ios = iosv; ios; ios = next) {
-		if ((next = strchr(ios, ',')) != NULL)
+		next = strchr(ios, ',');
+		if (next)
 			*next++ = '\0';
 		if (ra.nios >= (int)nitems(ra.iosv))
 			errx(1, "%s: too many replicas specified",
 			    replrqspec);
 		if (strchr(ios, '@') == NULL)
-			errx(1, "%s: no I/O system site specified", ios);
+			errx(1, "%s: no site specified", ios);
 		if (strlcpy(ra.iosv[ra.nios++], ios,
 		    sizeof(ra.iosv[0])) >= sizeof(ra.iosv[0]))
 			errx(1, "%s: I/O system name too long", ios);


dsync: Improved debug logging.

dsync: Improved debug logging.

--- src/doveadm/dsync/dsync-mailbox-import.c
+++ src/doveadm/dsync/dsync-mailbox-import.c
@@ -1318,17 +1318,22 @@

 static int
 dsync_mailbox_import_match_msg(struct dsync_mailbox_importer *importer,
-			       const struct dsync_mail_change *change)
-{
-	const char *hdr_hash;
+			       const struct dsync_mail_change *change,
+			       const char **result_r)
+{
+	const char *hdr_hash, *cmp_guid;

 	if (*change->guid != '\0' && *importer->cur_guid != '\0') {
 		/* we have GUIDs, verify them */
 		if (dsync_mail_change_guid_equals(importer, change,
-						  importer->cur_guid, NULL))
+						  importer->cur_guid, &cmp_guid)) {
+			*result_r = "GUIDs match";
 			return 1;
-		else
+		} else {
+			*result_r = t_strdup_printf("GUIDs don't match (%s vs %s)",
+						    change->guid, cmp_guid);
 			return 0;
+		}
 	}

 	/* verify hdr_hash if it exists */
@@ -1337,20 +1342,30 @@
 		if (change->type == DSYNC_MAIL_CHANGE_TYPE_EXPUNGE) {
 			/* the message was already expunged, so we don't know
 			   its header. return "unknown". */
+			*result_r = "Unknown match for expunge";
 			return -1;
 		}
 		i_error("Mailbox %s: GUIDs not supported, "
 			"sync with header hashes instead",
 			mailbox_get_vname(importer->box));
 		importer->failed = TRUE;
+		*result_r = "Error, invalid parameters";
 		return -1;
 	}

 	if (dsync_mail_get_hdr_hash(importer->cur_mail, &hdr_hash) < 0) {
 		dsync_mail_error(importer, importer->cur_mail, "hdr-stream");
+		*result_r = "Error fetching header stream";
 		return -1;
 	}
-	return strcmp(change->hdr_hash, hdr_hash) == 0 ? 1 : 0;
+	if (strcmp(change->hdr_hash, hdr_hash) == 0) {
+		*result_r = "Headers hashes match";
+		return 1;
+	} else {
+		*result_r = t_strdup_printf("Headers hashes don't match (%s vs %s)",
+					    change->hdr_hash, hdr_hash);
+		return 0;
+	}
 }

 static bool
@@ -1447,18 +1462,15 @@
 	if (importer->cur_mail->uid == change->uid) {
 		/* we have a matching local UID. check GUID to see if it's
 		   really the same mail or not */
-		if ((ret = dsync_mailbox_import_match_msg(importer, change)) < 0) {
+		if ((ret = dsync_mailbox_import_match_msg(importer, change, result_r)) < 0) {
 			/* unknown */
-			*result_r = "Error while verifying mail GUID";
 			return;
 		}
 		if (ret == 0) {
 			/* mismatch - found the first non-common UID */
 			dsync_mailbox_common_uid_found(importer);
-			*result_r = "Mail GUID mismatch";
 		} else {
 			importer->last_common_uid = change->uid;
-			*result_r = "Mail exists locally";
 		}
 		return;
 	}


doveadm backup: When deleting a mailbox, log a warning, not just a debug message. Because we're also returning temporary failure in any case, so there needs to be some kind of a warning/error logged.

--- src/doveadm/dsync/dsync-mailbox-import.c
+++ src/doveadm/dsync/dsync-mailbox-import.c
@@ -1412,7 +1412,7 @@
 	/* mail exists on remote, but not locally. we'll need to
 	   insert this mail back, which means deleting the whole
 	   mailbox and resyncing. */
-	imp_debug(importer, "Deleting mailbox '%s': UID=%u GUID=%s is missing locally",
+	i_warning("Deleting mailbox '%s': UID=%u GUID=%s is missing locally",
 		  mailbox_get_vname(importer->box),
 		  change->uid, change->guid);
 	importer->delete_mailbox = TRUE;


update source code. module is named `musicplayer` now

--- musicplayer.c
+++ musicplayer.c
@@ -5,8 +5,8 @@
 // This code is under the 2-clause BSD license, see License.txt in the root directory of this project.

 // compile:
-// gcc -c ffmpeg*.{c,cpp} -I /System/Library/Frameworks/Python.framework/Headers/
-// libtool -dynamic -o ffmpeg.so ffmpeg*.o -framework Python -lavformat -lavutil -lavcodec -lswresample -lportaudio -lc
+// gcc -c musicplayer*.{c,cpp} -I /System/Library/Frameworks/Python.framework/Headers/
+// libtool -dynamic -o musicplayer.so musicplayer*.o -framework Python -lavformat -lavutil -lavcodec -lswresample -lportaudio -lc

 // loosely based on ffplay.c
 // https://github.com/FFmpeg/ffmpeg/blob/master/ffplay.c
@@ -58,7 +58,7 @@
 };

 PyDoc_STRVAR(module_doc,
-"FFmpeg player.");
+"Music player.");

 static PyObject* EventClass = NULL;

@@ -70,15 +70,15 @@

 PyMODINIT_FUNC
-initffmpeg(void)
+initmusicplayer(void)
 {
-	//printf("initffmpeg\n");
+	//printf("initmusicplayer\n");
 	init();
 	if (PyType_Ready(&Player_Type) < 0)
 		Py_FatalError("Can't initialize player type");
-	PyObject* m = Py_InitModule3("ffmpeg", module_methods, module_doc);
+	PyObject* m = Py_InitModule3("musicplayer", module_methods, module_doc);
 	if(!m) {
-		Py_FatalError("Can't initialize ffmpeg module");
+		Py_FatalError("Can't initialize musicplayer module");
 		return;
 	}


Minor To Do comment.

Minor To Do comment.

--- examples/unix/aiko_timer.c
+++ examples/unix/aiko_timer.c
@@ -12,7 +12,7 @@
  *
  * To Do
  * ~~~~~
- * - None, yet.
+ * - Command line arguments to change "period" and "maximum count".
  */

 #include <stdio.h>


Bug 1042408: Compilation fix for Android > API level 19. After 19, the NDK includes mmap64. r=wtc.

--- pr/src/md/unix/unix.c
+++ pr/src/md/unix/unix.c
@@ -19,6 +19,10 @@

 #ifdef _PR_POLL_AVAILABLE
 #include <poll.h>
+#endif
+
+#if defined(ANDROID)
+#include <android/api-level.h>
 #endif

 /* To get FIONREAD */
@@ -2709,8 +2713,8 @@
 }  /* _MD_Unix_mmap64 */
 #endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */

-/* Android doesn't have mmap64. */
-#if defined(ANDROID)
+/* Android <= 19 doesn't have mmap64. */
+#if defined(ANDROID) && __ANDROID_API__ <= 19
 extern void *__mmap2(void *, size_t, int, int, int, size_t);

 #define ANDROID_PAGE_SIZE 4096


speed up ngx_http_charset_recode() for 25%: google-perftools reported that CPU usage of charset body filter has decreased from 7.5% to 5.5% if gzipping is disabled

--- src/http/modules/ngx_http_charset_filter_module.c
+++ src/http/modules/ngx_http_charset_filter_module.c
@@ -561,25 +561,33 @@
 static ngx_uint_t
 ngx_http_charset_recode(ngx_buf_t *b, u_char *table)
 {
-    u_char  *p;
-
-    for (p = b->pos; p < b->last; p++) {
-
-        if (*p == table[*p]) {
-            continue;
-        }
-
-        while (p < b->last) {
+    u_char  *p, *last;
+
+    last = b->last;
+
+    for (p = b->pos; p < last; p++) {
+
+        if (*p != table[*p]) {
+            goto recode;
+        }
+    }
+
+    return 0;
+
+recode:
+
+    do {
+        if (*p != table[*p]) {
             *p = table[*p];
-            p++;
-        }
-
-        b->in_file = 0;
-
-        return 1;
-    }
-
-    return 0;
+        }
+
+        p++;
+
+    } while (p < last);
+
+    b->in_file = 0;
+
+    return 1;
 }


cairo: Don't use #ifdefs inside macros

cairo: Don't use #ifdefs inside macros

--- ext/cairo/gstcairorender.c
+++ ext/cairo/gstcairorender.c
@@ -264,52 +264,63 @@
   return TRUE;
 }

+
+#define SIZE_CAPS "width = (int) [ 1, MAX], height = (int) [ 1, MAX] "
+#if CAIRO_HAS_PDF_SURFACE
+#define PDF_CAPS "application/pdf, " SIZE_CAPS
+#else
+#define PDF_CAPS
+#endif
+#if CAIRO_HAS_PDF_SURFACE && (CAIRO_HAS_PS_SURFACE || CAIRO_HAS_SVG_SURFACE || CAIRO_HAS_PNG_FUNCTIONS)
+#define JOIN1 ";"
+#else
+#define JOIN1
+#endif
+#if CAIRO_HAS_PS_SURFACE
+#define PS_CAPS "application/postscript, " SIZE_CAPS
+#else
+#define PS_CAPS
+#endif
+#if (CAIRO_HAS_PDF_SURFACE || CAIRO_HAS_PS_SURFACE) && (CAIRO_HAS_SVG_SURFACE || CAIRO_HAS_PNG_FUNCTIONS)
+#define JOIN2 ";"
+#else
+#define JOIN2
+#endif
+#if CAIRO_HAS_SVG_SURFACE
+#define SVG_CAPS "image/svg+xml, " SIZE_CAPS
+#else
+#define SVG_CAPS
+#endif
+#if (CAIRO_HAS_PDF_SURFACE || CAIRO_HAS_PS_SURFACE || CAIRO_HAS_SVG_SURFACE) && CAIRO_HAS_PNG_FUNCTIONS
+#define JOIN3 ";"
+#else
+#define JOIN3
+#endif
+#if CAIRO_HAS_PNG_FUNCTIONS
+#define PNG_CAPS "image/png, " SIZE_CAPS
+#define PNG_CAPS2 "; image/png, " SIZE_CAPS
+#else
+#define PNG_CAPS
+#define PNG_CAPS2
+#endif
+
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define ARGB_CAPS GST_VIDEO_CAPS_BGRx " ; " GST_VIDEO_CAPS_BGRA " ; "
+#else
+#define ARGB_CAPS GST_VIDEO_CAPS_xRGB " ; " GST_VIDEO_CAPS_ARGB " ; "
+#endif
 static GstStaticPadTemplate t_src = GST_STATIC_PAD_TEMPLATE ("src",
-    GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (
-#if CAIRO_HAS_PDF_SURFACE
-        "application/pdf, "
-        "width = (int) [ 1, MAX], " "height = (int) [ 1, MAX] "
-#endif
-#if CAIRO_HAS_PDF_SURFACE && (CAIRO_HAS_PS_SURFACE || CAIRO_HAS_SVG_SURFACE || CAIRO_HAS_PNG_FUNCTIONS)
-        ";"
-#endif
-#if CAIRO_HAS_PS_SURFACE
-        "application/postscript, "
-        "width = (int) [ 1, MAX], " "height = (int) [ 1, MAX] "
-#endif
-#if (CAIRO_HAS_PDF_SURFACE || CAIRO_HAS_PS_SURFACE) && (CAIRO_HAS_SVG_SURFACE || CAIRO_HAS_PNG_FUNCTIONS)
-        ";"
-#endif
-#if CAIRO_HAS_SVG_SURFACE
-        "image/svg+xml, "
-        "width = (int) [ 1, MAX], " "height = (int) [ 1, MAX] "
-#endif
-#if (CAIRO_HAS_PDF_SURFACE || CAIRO_HAS_PS_SURFACE || CAIRO_HAS_SVG_SURFACE) && CAIRO_HAS_PNG_FUNCTIONS
-        ";"
-#endif
-#if CAIRO_HAS_PNG_FUNCTIONS
-        "image/png, " "width = (int) [ 1, MAX], " "height = (int) [ 1, MAX] "
-#endif
-    ));
+    GST_PAD_SRC, GST_PAD_ALWAYS,
+    GST_STATIC_CAPS (PDF_CAPS JOIN1 PS_CAPS JOIN2 SVG_CAPS JOIN3 PNG_CAPS));
 static GstStaticPadTemplate t_snk = GST_STATIC_PAD_TEMPLATE ("sink",
-    GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-        GST_VIDEO_CAPS_BGRx " ; " GST_VIDEO_CAPS_BGRA " ; "
-#else
-        GST_VIDEO_CAPS_xRGB " ; " GST_VIDEO_CAPS_ARGB " ; "
-#endif
+    GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (ARGB_CAPS
         GST_VIDEO_CAPS_YUV ("Y800") " ; "
         "video/x-raw-gray, "
         "bpp = 8, "
         "depth = 8, "
         "width = " GST_VIDEO_SIZE_RANGE ", "
         "height = " GST_VIDEO_SIZE_RANGE ", " "framerate = " GST_VIDEO_FPS_RANGE
-        " ; "
-#if CAIRO_HAS_PNG_FUNCTIONS
-        "image/png, "
-        "width = " GST_VIDEO_SIZE_RANGE ", " "height = " GST_VIDEO_SIZE_RANGE
-#endif
-    ));
+        PNG_CAPS2));

 GST_BOILERPLATE (GstCairoRender, gst_cairo_render, GstElement,
     GST_TYPE_ELEMENT);


Whitespace cleanup.

Whitespace cleanup.

--- ext/mri/scrypt_calibrate.c
+++ ext/mri/scrypt_calibrate.c
@@ -32,23 +32,23 @@
 	double opslimit;
 	double maxN, maxrp;
 	int rc;
-
+
 	/* Figure out how much memory to use. */
 	if (memtouse(maxmem, maxmemfrac, &memlimit))
 		return (1);
-
+
 	/* Figure out how fast the CPU is. */
 	if ((rc = scryptenc_cpuperf(&opps)) != 0)
 		return (rc);
 	opslimit = opps * maxtime;
-
+
 	/* Allow a minimum of 2^15 salsa20/8 cores. */
 	if (opslimit < 32768)
 		opslimit = 32768;
-
+
 	/* Fix r = 8 for now. */
 	*r = 8;
-
+
 	/*
 	 * The memory limit requires that 128Nr <= memlimit, while the CPU
 	 * limit requires that 4Nrp <= opslimit.  If opslimit < memlimit/32,
@@ -73,19 +73,19 @@
 			if ((uint64_t)(1) << *logN > maxN / 2)
 				break;
 		}
-
+
 		/* Choose p based on the CPU limit. */
 		maxrp = (opslimit / 4) / ((uint64_t)(1) << *logN);
 		if (maxrp > 0x3fffffff)
 			maxrp = 0x3fffffff;
 		*p = (uint32_t)(maxrp) / *r;
 	}
-
+
 #ifdef DEBUG
 	fprintf(stderr, "N = %zu r = %d p = %d\n",
 			(size_t)(1) << *logN, (int)(*r), (int)(*p));
 #endif
-
+
 	/* Success! */
 	return (0);
 }
@@ -99,6 +99,6 @@
 	if (result == 0)
 	{
 		*n = (uint64_t)(1) << logN;
-	}
+	}
 	return result;
 }


Use new `git_config_get_string_buf`.

Use new `git_config_get_string_buf`.

`git_config_get_string` can only be used on config snapshots.

--- ext/rugged/rugged_config.c
+++ ext/rugged/rugged_config.c
@@ -87,18 +87,22 @@
 static VALUE rb_git_config_get(VALUE self, VALUE rb_key)
 {
 	git_config *config;
-	const char *value;
-	int error;
+	git_buf buf = { NULL };
+	int error;
+	VALUE rb_result;

 	Data_Get_Struct(self, git_config, config);
 	Check_Type(rb_key, T_STRING);

-	error = git_config_get_string(&value, config, StringValueCStr(rb_key));
+	error = git_config_get_string_buf(&buf, config, StringValueCStr(rb_key));
 	if (error == GIT_ENOTFOUND)
 		return Qnil;

 	rugged_exception_check(error);
-	return rb_str_new_utf8(value);
+	rb_result = rb_str_new_utf8(buf.ptr);
+	git_buf_free(&buf);
+
+	return rb_result;
 }

 /*


Don't allow renaming a file to a directory/ or vice versa, or a deleted file.

--- lib/zip_rename.c
+++ lib/zip_rename.c
@@ -1,6 +1,6 @@
 /*
   zip_rename.c -- rename file in zip archive
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner

   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip@nih.at>
@@ -34,6 +34,8 @@

+#include <string.h>
+
 #include "zipint.h"

 @@ -42,7 +44,21 @@
 ZIP_EXTERN int
 zip_rename(struct zip *za, int idx, const char *name)
 {
-    if (idx >= za->nentry || idx < 0) {
+    const char *old_name;
+    int old_is_dir, new_is_dir;
+
+    if (idx >= za->nentry || idx < 0 || name[0] == '\0') {
+	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+	return -1;
+    }
+
+    if ((old_name=zip_get_name(za, idx, 0)) == NULL)
+	return -1;
+
+    new_is_dir = (name[strlen(name)-1] == '/');
+    old_is_dir = (old_name[strlen(old_name)-1] == '/');
+
+    if (new_is_dir != old_is_dir) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }


If we encounter read errors reading the duid or iaid after successfully opening the file, print an error and exit.

--- ndhc/duiaid.c
+++ ndhc/duiaid.c
@@ -175,6 +175,9 @@
                     cc->interface, __func__);
     } else {
         iaid_len = safe_read(fd, iaid, sizeof iaid);
+        if (iaid_len < 0)
+            suicide("%s: (%s) failed to read IAID from file",
+                    cc->interface, __func__);
     }
     close(fd);

@@ -188,6 +191,9 @@
                     cc->interface, __func__);
     } else {
         duid_len = safe_read(fd, duid, sizeof duid);
+        if (duid_len < 0)
+            suicide("%s: (%s) failed to read DUID from file",
+                    cc->interface, __func__);
     }
     close(fd);


out_kafka: add cast to parameter

out_kafka: add cast to parameter

Signed-off-by: Eduardo Silva <81f705dc2ce1a61a2621e0e4b442a9474e1d0c70@treasure-data.com>

--- plugins/out_kafka/kafka.c
+++ plugins/out_kafka/kafka.c
@@ -137,7 +137,7 @@
         if (ctx->topic_key && !topic && val.type == MSGPACK_OBJECT_STR) {
             if (key.via.str.size == ctx->topic_key_len &&
                 strncmp(key.via.str.ptr, ctx->topic_key, ctx->topic_key_len) == 0) {
-                topic = flb_kafka_topic_lookup(val.via.str.ptr,
+                topic = flb_kafka_topic_lookup((char *) val.via.str.ptr,
                                                val.via.str.size,
                                                ctx);
             }


Fix a typo introduced when refactoring the raw socket code.

--- ndhc/packet.c
+++ ndhc/packet.c
@@ -302,7 +302,7 @@

     // Ignoring error since kernel may lack support for BPF.
     if (filter_prog && (setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER,
-                        &filter_prog, sizeof filter_prog) >= 0))
+                        filter_prog, sizeof *filter_prog) >= 0))
         log_line("Attached filter to raw socket fd %d", fd);

     int opt = 1;


out_kafka: add support to force flush when shutdown. (fluent#5593)

When fluent-bit shutdown for out_kafka plugin with rdkafka.linger.ms and
rdkafka.batch.size and then we show the warn message and lose the message.

So, this patch fixes the issue of not flushing due to the rdkafka linger.ms
option.

The 'rd_kafka_flush' function is linger.ms time will be ignored for the
duration of the call, queued messages will be sent to the broker as soon as
possible.

Signed-off-by: jinyong.choi <d446520bcd83aa5f750534d7b5c5b96886e31602@gmail.com>

--- plugins/out_kafka/kafka.c
+++ plugins/out_kafka/kafka.c
@@ -495,10 +495,29 @@
     FLB_OUTPUT_RETURN(FLB_OK);
 }

+static void kafka_flush_force(struct flb_out_kafka *ctx,
+                              struct flb_config *config)
+{
+    int ret;
+
+    if (!ctx) {
+        return;
+    }
+
+    if (ctx->kafka.rk) {
+        ret = rd_kafka_flush(ctx->kafka.rk, config->grace * 1000);
+        if (ret != RD_KAFKA_RESP_ERR_NO_ERROR) {
+            flb_plg_warn(ctx->ins, "Failed to force flush: %s",
+                         rd_kafka_err2str(ret));
+        }
+    }
+}
+
 static int cb_kafka_exit(void *data, struct flb_config *config)
 {
     struct flb_out_kafka *ctx = data;

+    kafka_flush_force(ctx, config);
     flb_out_kafka_destroy(ctx);
     return 0;
 }


Fixed the indentation in json_value_store.h.

--- keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h
+++ keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h
@@ -133,321 +133,309 @@
  * Value store where the value consists of a single integer.
  */
 class JsonValueStore final : public IValueStoreWriter {
+ public:
+
+  struct RawPointer final {
    public:
-
-    struct RawPointer
-    final {
-       public:
-        RawPointer()
-            : RawPointer(0, 0, 0) {
-        }
-
-        RawPointer(uint64_t offset, int hashcode, size_t length)
-            : offset_(offset),
-              hashcode_(hashcode),
-              length_(length) {
-
-          if (length > USHRT_MAX) {
-            length_ = USHRT_MAX;
-          }
-
-        }
-
-        int GetHashcode() const {
-          return hashcode_;
-        }
-
-        uint64_t GetOffset() const {
-          return offset_;
-        }
-
-        ushort GetLength() const {
-          return length_;
-        }
-
-        int GetCookie() const {
-          return cookie_;
-        }
-
-        void SetCookie(int value) {
-          cookie_ = static_cast<ushort>(value);
-        }
-
-        bool IsEmpty() const {
-          return offset_ == 0 && hashcode_ == 0 && length_ == 0;
-        }
-
-        bool operator==(const RawPointer& l) {
-          return offset_ == l.offset_;
-        }
-
-        static size_t GetMaxCookieSize() {
-          return MaxCookieSize;
-        }
-
-       private:
-        static const size_t MaxCookieSize = 0xFFFF;
-
-        uint64_t offset_;
-        int32_t hashcode_;
-        ushort length_;
-        ushort cookie_ = 0;
-
-      };
-
-      template<class PersistenceT>
-      struct RawPointerForCompare
-      final
-      {
-         public:
-          RawPointerForCompare(const std::string& value,
-                               PersistenceT* persistence)
-              : value_(value),
-                persistence_(persistence) {
-            hashcode_ = std::hash<value_t>()(value);
-            length_ = value.size();
-          }
-
-          int GetHashcode() const {
-            return hashcode_;
-          }
-
-          bool operator==(const RawPointer& l) const {
-            // First filter - check if hash code  is the same
-            if (l.GetHashcode() != hashcode_) {
-              return false;
-            }
-            TRACE("check");
-            size_t length_l = l.GetLength();
-
-            if (length_l < USHRT_MAX && length_l != length_) {
-              return false;
-            }
-
-            TRACE("Compare values at data level length: %d %d", l.GetOffset(), value_.size());
-
-            return persistence_->Compare(l.GetOffset(), (void*) value_.data(), value_.size());
-          }
-
-         private:
-          std::string value_;
-          PersistenceT* persistence_;
-          int32_t hashcode_;
-          size_t length_;
-        };
-
-        typedef std::string value_t;
-        static const uint64_t no_value = 0;
-        static const bool inner_weight = false;
-
-        // boost::filesystem::path temporary_path,
-        JsonValueStore(const vs_param_t& parameters,
-                       size_t memory_limit = 104857600)
-            : IValueStoreWriter(parameters), hash_(memory_limit) {
-          temporary_directory_ = parameters_[TEMPORARY_PATH_KEY];
-          temporary_directory_ /= boost::filesystem::unique_path(
-              "dictionary-fsa-json_value_store-%%%%-%%%%-%%%%-%%%%");
-          boost::filesystem::create_directory(temporary_directory_);
-
-          if (parameters_.count(COMPRESSION_THRESHOLD_KEY) > 0) {
-            compression_threshold_ = boost::lexical_cast<size_t>(
-                parameters_[COMPRESSION_THRESHOLD_KEY]);
-          } else {
-            compression_threshold_ = 32;
-          }
-
-          std::string compressor;
-          if (parameters_.count(COMPRESSION_KEY) > 0) {
-            compressor = parameters_[COMPRESSION_KEY];
-          }
-          compressor_.reset(compression::compression_strategy(compressor));
-          raw_compressor_.reset(compression::compression_strategy("raw"));
-          // This is beyond ugly, but needed for EncodeJsonValue :(
-          long_compress_ = std::bind(
-              static_cast<compression::compress_mem_fn_t> (&compression::CompressionStrategy::Compress),
-              compressor_.get(), std::placeholders::_1, std::placeholders::_2);
-          short_compress_ = std::bind(
-              static_cast<compression::compress_mem_fn_t> (&compression::CompressionStrategy::Compress),
-              raw_compressor_.get(), std::placeholders::_1, std::placeholders::_2);
-
-          size_t external_memory_chunk_size = 1073741824;
-
-          values_extern_ = new MemoryMapManager(external_memory_chunk_size,
-                                                temporary_directory_,
-                                                "json_values_filebuffer");
-        }
-
-        ~JsonValueStore() {
-          delete values_extern_;
-          boost::filesystem::remove_all(temporary_directory_);
-        }
-
-        JsonValueStore() = delete;
-        JsonValueStore& operator=(JsonValueStore const&) = delete;
-        JsonValueStore(const JsonValueStore& that) = delete;
-
-        /**
-         * Simple implementation of a value store for json values:
-         * todo: performance improvements?
-         */
-        uint64_t GetValue(const value_t& value, bool& no_minimization) {
-          msgpack_buffer_.clear();
-          std::string compressed = EncodeJsonValue(
-              long_compress_, short_compress_, msgpack_buffer_, value,
-              compression_threshold_);
-          std::string packed_value;
-          dictionary::util::encodeVarint(compressed.size() + 1, packed_value);
-          packed_value += compressed;
-
-          ++number_of_values_;
-
-          const RawPointerForCompare<MemoryMapManager> stp(packed_value,
-                                                           values_extern_);
-          const RawPointer p = hash_.Get(stp);
-
-          if (!p.IsEmpty()) {
-            // found the same value again, minimize
-            TRACE("Minimized value");
-            return p.GetOffset();
-          } // else persist string value
-
-          no_minimization = true;
-          TRACE("New unique value");
-          ++number_of_unique_values_;
-
-          uint64_t pt = static_cast<uint64_t>(values_buffer_size_);
-
-          values_extern_->Append(values_buffer_size_, (void*)packed_value.data(), packed_value.size());
-          values_buffer_size_ += packed_value.size();
-
-          TRACE("add value to hash at %d, length %d", pt, packed_value.size());
-          hash_.Add(RawPointer(pt, stp.GetHashcode(), packed_value.size()));
-
-          return pt;
-        }
-
-        uint32_t GetWeightValue(value_t value) const {
-          return 0;
-        }
-
-        value_store_t GetValueStoreType() const {
-          return JSON_VALUE_STORE;
-        }
-
-        void Write(std::ostream& stream) {
-
-          boost::property_tree::ptree pt;
-          pt.put("size", std::to_string(values_buffer_size_));
-          pt.put("values", std::to_string(number_of_values_));
-          pt.put("unique_values", std::to_string(number_of_unique_values_));
-          pt.put(std::string("__") + COMPRESSION_KEY, compressor_->name());
-          pt.put(std::string("__") + COMPRESSION_THRESHOLD_KEY, compression_threshold_);
-
-          internal::SerializationUtils::WriteJsonRecord(stream, pt);
-          TRACE("Wrote JSON header, stream at %d", stream.tellp());
-
-          values_extern_->Write(stream, values_buffer_size_);
-        }
-
-       private:
-        MemoryMapManager* values_extern_;
-
-        /*
-         * Compressors & the associated compression functions. Ugly, but
-         * needed for EncodeJsonValue.
-         */
-        std::unique_ptr<compression::CompressionStrategy> compressor_;
-        std::unique_ptr<compression::CompressionStrategy> raw_compressor_;
-        std::function<std::string(const char*, size_t)> long_compress_;
-        std::function<std::string(const char*, size_t)> short_compress_;
-        size_t compression_threshold_;
-
-        LeastRecentlyUsedGenerationsCache<RawPointer> hash_;
-        msgpack::sbuffer msgpack_buffer_;
-        size_t number_of_values_ = 0;
-        size_t number_of_unique_values_ = 0;
-        size_t values_buffer_size_ = 0;
-        boost::filesystem::path temporary_directory_;
-      };
-
-      class JsonValueStoreReader final: public IValueStoreReader {
-       public:
-        using IValueStoreReader::IValueStoreReader;
-
-        JsonValueStoreReader(std::istream& stream,
-                             boost::interprocess::file_mapping* file_mapping,
-                             bool load_lazy = false)
-            : IValueStoreReader(stream, file_mapping) {
-
-          TRACE("JsonValueStoreReader construct");
-
-          properties_ =
-              internal::SerializationUtils::ReadJsonRecord(stream);
-
-          size_t offset = stream.tellg();
-          size_t strings_size = properties_.get<size_t>("size");
-
-          // check for file truncation
-          if (strings_size > 0) {
-            stream.seekg(strings_size - 1, stream.cur);
-            if (stream.peek() == EOF) {
-              throw std::invalid_argument("file is corrupt(truncated)");
-            }
-          }
-
-          boost::interprocess::map_options_t map_options =
-              boost::interprocess::default_map_options | MAP_HUGETLB;
-
-          if (!load_lazy) {
-            map_options |= MAP_POPULATE;
-          }
-
-          strings_region_ = new boost::interprocess::mapped_region(
-              *file_mapping, boost::interprocess::read_only, offset,
-              strings_size, 0, map_options);
-
-          strings_ = (const char*) strings_region_->get_address();
-        }
-
-        ~JsonValueStoreReader() {
-          delete strings_region_;
-        }
-
-        virtual attributes_t GetValueAsAttributeVector(uint64_t fsa_value)
-            override {
-          attributes_t attributes(new attributes_raw_t());
-
-          std::string raw_value = util::decodeVarintString(strings_ + fsa_value);
-
-          //auto length = util::decodeVarint((uint8_t*) strings_ + fsa_value);
-          //std::string raw_value(strings_ + fsa_value, length);
-
-          (*attributes)["value"] = raw_value;
-          return attributes;
-        }
-
-        virtual std::string GetRawValueAsString(uint64_t fsa_value) override {
-          return util::decodeVarintString(strings_ + fsa_value);
-        }
-
-        virtual std::string GetValueAsString(uint64_t fsa_value) override {
-          TRACE("JsonValueStoreReader GetValueAsString");
-          std::string packed_string = util::decodeVarintString(strings_ + fsa_value);
-
-          return DecodeJsonValue(packed_string);
-        }
-
-        virtual std::string GetStatistics() const {
-          std::ostringstream buf;
-          boost::property_tree::write_json (buf, properties_, false);
-          return buf.str();
-        }
-
-       private:
-        boost::interprocess::mapped_region* strings_region_;
-        const char* strings_;
-        boost::property_tree::ptree properties_;
-      };
+    RawPointer() : RawPointer(0, 0, 0) {}
+
+    RawPointer(uint64_t offset, int hashcode, size_t length)
+        : offset_(offset), hashcode_(hashcode), length_(length) {
+      if (length > USHRT_MAX) {
+        length_ = USHRT_MAX;
+      }
+    }
+
+    int GetHashcode() const {
+      return hashcode_;
+    }
+
+    uint64_t GetOffset() const {
+      return offset_;
+    }
+
+    ushort GetLength() const {
+      return length_;
+    }
+
+    int GetCookie() const {
+      return cookie_;
+    }
+
+    void SetCookie(int value) {
+      cookie_ = static_cast<ushort>(value);
+    }
+
+    bool IsEmpty() const {
+      return offset_ == 0 && hashcode_ == 0 && length_ == 0;
+    }
+
+    bool operator==(const RawPointer& l) {
+      return offset_ == l.offset_;
+    }
+
+    static size_t GetMaxCookieSize() {
+      return MaxCookieSize;
+    }
+
+   private:
+    static const size_t MaxCookieSize = 0xFFFF;
+
+    uint64_t offset_;
+    int32_t hashcode_;
+    ushort length_;
+    ushort cookie_ = 0;
+
+  };
+
+  template<class PersistenceT>
+  struct RawPointerForCompare final {
+   public:
+    RawPointerForCompare(const std::string& value, PersistenceT* persistence)
+        : value_(value), persistence_(persistence) {
+      hashcode_ = std::hash<value_t>()(value);
+      length_ = value.size();
+    }
+
+    int GetHashcode() const {
+      return hashcode_;
+    }
+
+    bool operator==(const RawPointer& l) const {
+      // First filter - check if hash code  is the same
+      if (l.GetHashcode() != hashcode_) {
+        return false;
+      }
+
+      TRACE("check");
+      size_t length_l = l.GetLength();
+
+      if (length_l < USHRT_MAX && length_l != length_) {
+        return false;
+      }
+
+      TRACE("Compare values at data level length: %d %d", l.GetOffset(), value_.size());
+      return persistence_->Compare(l.GetOffset(), (void*) value_.data(), value_.size());
+    }
+
+   private:
+    std::string value_;
+    PersistenceT* persistence_;
+    int32_t hashcode_;
+    size_t length_;
+  };
+
+  typedef std::string value_t;
+  static const uint64_t no_value = 0;
+  static const bool inner_weight = false;
+
+  // boost::filesystem::path temporary_path,
+  JsonValueStore(const vs_param_t& parameters, size_t memory_limit = 104857600)
+      : IValueStoreWriter(parameters), hash_(memory_limit) {
+    temporary_directory_ = parameters_[TEMPORARY_PATH_KEY];
+    temporary_directory_ /= boost::filesystem::unique_path(
+        "dictionary-fsa-json_value_store-%%%%-%%%%-%%%%-%%%%");
+    boost::filesystem::create_directory(temporary_directory_);
+
+    if (parameters_.count(COMPRESSION_THRESHOLD_KEY) > 0) {
+      compression_threshold_ = boost::lexical_cast<size_t>(
+          parameters_[COMPRESSION_THRESHOLD_KEY]);
+    } else {
+      compression_threshold_ = 32;
+    }
+
+    std::string compressor;
+    if (parameters_.count(COMPRESSION_KEY) > 0) {
+      compressor = parameters_[COMPRESSION_KEY];
+    }
+    compressor_.reset(compression::compression_strategy(compressor));
+    raw_compressor_.reset(compression::compression_strategy("raw"));
+    // This is beyond ugly, but needed for EncodeJsonValue :(
+    long_compress_ = std::bind(static_cast<compression::compress_mem_fn_t>
+        (&compression::CompressionStrategy::Compress),
+        compressor_.get(), std::placeholders::_1, std::placeholders::_2);
+    short_compress_ = std::bind(static_cast<compression::compress_mem_fn_t>
+        (&compression::CompressionStrategy::Compress),
+        raw_compressor_.get(), std::placeholders::_1, std::placeholders::_2);
+
+    size_t external_memory_chunk_size = 1073741824;
+
+    values_extern_ = new MemoryMapManager(external_memory_chunk_size,
+                                          temporary_directory_,
+                                          "json_values_filebuffer");
+  }
+
+  ~JsonValueStore() {
+    delete values_extern_;
+    boost::filesystem::remove_all(temporary_directory_);
+  }
+
+  JsonValueStore() = delete;
+  JsonValueStore& operator=(JsonValueStore const&) = delete;
+  JsonValueStore(const JsonValueStore& that) = delete;
+
+  /**
+   * Simple implementation of a value store for json values:
+   * todo: performance improvements?
+   */
+  uint64_t GetValue(const value_t& value, bool& no_minimization) {
+    msgpack_buffer_.clear();
+    std::string compressed = EncodeJsonValue(
+        long_compress_, short_compress_, msgpack_buffer_, value,
+        compression_threshold_);
+    std::string packed_value;
+    dictionary::util::encodeVarint(compressed.size() + 1, packed_value);
+    packed_value += compressed;
+
+    ++number_of_values_;
+
+    const RawPointerForCompare<MemoryMapManager> stp(packed_value,
+                                                     values_extern_);
+    const RawPointer p = hash_.Get(stp);
+
+    if (!p.IsEmpty()) {
+      // found the same value again, minimize
+      TRACE("Minimized value");
+      return p.GetOffset();
+    } // else persist string value
+
+    no_minimization = true;
+    TRACE("New unique value");
+    ++number_of_unique_values_;
+
+    uint64_t pt = static_cast<uint64_t>(values_buffer_size_);
+
+    values_extern_->Append(values_buffer_size_, (void*)packed_value.data(),
+                           packed_value.size());
+    values_buffer_size_ += packed_value.size();
+
+    TRACE("add value to hash at %d, length %d", pt, packed_value.size());
+    hash_.Add(RawPointer(pt, stp.GetHashcode(), packed_value.size()));
+
+    return pt;
+  }
+
+  uint32_t GetWeightValue(value_t value) const {
+    return 0;
+  }
+
+  value_store_t GetValueStoreType() const {
+    return JSON_VALUE_STORE;
+  }
+
+  void Write(std::ostream& stream) {
+    boost::property_tree::ptree pt;
+    pt.put("size", std::to_string(values_buffer_size_));
+    pt.put("values", std::to_string(number_of_values_));
+    pt.put("unique_values", std::to_string(number_of_unique_values_));
+    pt.put(std::string("__") + COMPRESSION_KEY, compressor_->name());
+    pt.put(std::string("__") + COMPRESSION_THRESHOLD_KEY, compression_threshold_);
+
+    internal::SerializationUtils::WriteJsonRecord(stream, pt);
+    TRACE("Wrote JSON header, stream at %d", stream.tellp());
+
+    values_extern_->Write(stream, values_buffer_size_);
+  }
+
+ private:
+  MemoryMapManager* values_extern_;
+
+  /*
+   * Compressors & the associated compression functions. Ugly, but
+   * needed for EncodeJsonValue.
+   */
+  std::unique_ptr<compression::CompressionStrategy> compressor_;
+  std::unique_ptr<compression::CompressionStrategy> raw_compressor_;
+  std::function<std::string(const char*, size_t)> long_compress_;
+  std::function<std::string(const char*, size_t)> short_compress_;
+  size_t compression_threshold_;
+
+  LeastRecentlyUsedGenerationsCache<RawPointer> hash_;
+  msgpack::sbuffer msgpack_buffer_;
+  size_t number_of_values_ = 0;
+  size_t number_of_unique_values_ = 0;
+  size_t values_buffer_size_ = 0;
+  boost::filesystem::path temporary_directory_;
+};
+
+
+class JsonValueStoreReader final: public IValueStoreReader {
+ public:
+  using IValueStoreReader::IValueStoreReader;
+
+  JsonValueStoreReader(std::istream& stream,
+                       boost::interprocess::file_mapping* file_mapping,
+                       bool load_lazy = false)
+      : IValueStoreReader(stream, file_mapping) {
+    TRACE("JsonValueStoreReader construct");
+
+    properties_ =
+        internal::SerializationUtils::ReadJsonRecord(stream);
+
+    size_t offset = stream.tellg();
+    size_t strings_size = properties_.get<size_t>("size");
+
+    // check for file truncation
+    if (strings_size > 0) {
+      stream.seekg(strings_size - 1, stream.cur);
+      if (stream.peek() == EOF) {
+        throw std::invalid_argument("file is corrupt(truncated)");
+      }
+    }
+
+    boost::interprocess::map_options_t map_options =
+        boost::interprocess::default_map_options | MAP_HUGETLB;
+
+    if (!load_lazy) {
+      map_options |= MAP_POPULATE;
+    }
+
+    strings_region_ = new boost::interprocess::mapped_region(
+        *file_mapping, boost::interprocess::read_only, offset,
+        strings_size, 0, map_options);
+
+    strings_ = (const char*) strings_region_->get_address();
+  }
+
+  ~JsonValueStoreReader() {
+    delete strings_region_;
+  }
+
+  virtual attributes_t GetValueAsAttributeVector(uint64_t fsa_value)
+      override {
+    attributes_t attributes(new attributes_raw_t());
+
+    std::string raw_value = util::decodeVarintString(strings_ + fsa_value);
+
+    //auto length = util::decodeVarint((uint8_t*) strings_ + fsa_value);
+    //std::string raw_value(strings_ + fsa_value, length);
+
+    (*attributes)["value"] = raw_value;
+    return attributes;
+  }
+
+  virtual std::string GetRawValueAsString(uint64_t fsa_value) override {
+    return util::decodeVarintString(strings_ + fsa_value);
+  }
+
+  virtual std::string GetValueAsString(uint64_t fsa_value) override {
+    TRACE("JsonValueStoreReader GetValueAsString");
+    std::string packed_string = util::decodeVarintString(strings_ + fsa_value);
+
+    return DecodeJsonValue(packed_string);
+  }
+
+  virtual std::string GetStatistics() const {
+    std::ostringstream buf;
+    boost::property_tree::write_json (buf, properties_, false);
+    return buf.str();
+  }
+
+ private:
+  boost::interprocess::mapped_region* strings_region_;
+  const char* strings_;
+  boost::property_tree::ptree properties_;
+};

 } /* namespace internal */
 } /* namespace fsa */


more consistent naming

more consistent naming

git-svn-id: a4d7c1866f8397a4106e0b57fc4fbf792bbdaaaf@802 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

--- libav/avformat.h
+++ libav/avformat.h
@@ -1,9 +1,9 @@
 #ifndef AVFORMAT_H
 #define AVFORMAT_H

-#define LIBAV_VERSION_INT 0x000406
-#define LIBAV_VERSION     "0.4.6"
-#define LIBAV_BUILD       4601
+#define LIBAVFORMAT_VERSION_INT 0x000406
+#define LIBAVFORMAT_VERSION     "0.4.6"
+#define LIBAVFORMAT_BUILD       4601

 #include "avcodec.h"

@@ -232,9 +232,7 @@

 void av_hex_dump(UINT8 *buf, int size);

-void register_all(void);
-
-INT64 gettime(void);
+void av_register_all(void);

 typedef struct FifoBuffer {
     UINT8 *buffer;
@@ -249,6 +247,7 @@

 /* media file input */
 AVInputFormat *av_find_input_format(const char *short_name);
+AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
 int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
                        AVInputFormat *fmt,
                        int buf_size,
@@ -278,6 +277,8 @@
 int parse_image_size(int *width_ptr, int *height_ptr, const char *str);
 INT64 parse_date(const char *datestr, int duration);

+INT64 av_gettime(void);
+
 /* ffm specific for ffserver */
 #define FFM_PACKET_SIZE 4096
 offset_t ffm_read_write_index(int fd);


chip/npcx/gpio_chip-npcx7.h: Format with clang-format

BUG=b:236386294
BRANCH=none
TEST=none

Tricium: disable
Change-Id: Iff535c58706ca8599e114c9af4ed53c44235effa
Signed-off-by: Jack Rosenthal <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749458
Reviewed-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>

--- chip/npcx/gpio_chip-npcx7.h
+++ chip/npcx/gpio_chip-npcx7.h
@@ -82,8 +82,9 @@
 #define NPCX_WUI_GPIO_F_0 WUI(0, MIWU_GROUP_8, 5)
 #define NPCX_WUI_GPIO_F_3 WUI(0, MIWU_GROUP_8, 6)
 #ifndef NPCX_EXT32K_OSC_SUPPORT
-#define NPCX_WUI_GPIO_E_7 WUI(0, MIWU_GROUP_8, 7) /* Used as CLKIN if support \
-						   */
+#define NPCX_WUI_GPIO_E_7                                   \
+	WUI(0, MIWU_GROUP_8, 7) /* Used as CLKIN if support \
+				 */
 #endif

 /* MIWU1 */
@@ -152,8 +153,9 @@
 #define NPCX_WUI_GPIO_6_3 WUI(1, MIWU_GROUP_7, 3)
 #define NPCX_WUI_GPIO_6_4 WUI(1, MIWU_GROUP_7, 4)
 #ifndef NPCX_EXT32K_OSC_SUPPORT
-#define NPCX_WUI_GPIO_7_1 WUI(1, MIWU_GROUP_7, 7) /* Used as CLKOUT if \
-						     support*/
+#define NPCX_WUI_GPIO_7_1                            \
+	WUI(1, MIWU_GROUP_7, 7) /* Used as CLKOUT if \
+				   support*/
 #endif

 /* Group H: NPCX_IRQ_WKINTH_1 */
@@ -318,10 +320,12 @@

 /* PSL module (Optional) */
 #ifdef NPCX_PSL_MODE_SUPPORT
-#define NPCX_ALT_GPIO_D_2 ALT(D, 2, NPCX_ALT_INV(D, NPSL_IN1_SL)) /* PSL_IN1 \
-								   */
-#define NPCX_ALT_GPIO_0_0 ALT(0, 0, NPCX_ALT_INV(D, NPSL_IN2_SL)) /* PSL_IN2 \
-								   */
+#define NPCX_ALT_GPIO_D_2                                  \
+	ALT(D, 2, NPCX_ALT_INV(D, NPSL_IN1_SL)) /* PSL_IN1 \
+						 */
+#define NPCX_ALT_GPIO_0_0                                  \
+	ALT(0, 0, NPCX_ALT_INV(D, NPSL_IN2_SL)) /* PSL_IN2 \
+						 */
 #define NPCX_ALT_GPIO_0_1 ALT(0, 1, NPCX_ALT(D, PSL_IN3_SL)) /* PSL_IN3 */
 #define NPCX_ALT_GPIO_0_2 ALT(0, 2, NPCX_ALT(D, PSL_IN4_SL)) /* PSL_IN4 */
 #else
@@ -360,98 +364,98 @@
 #define NPCX_ALT_GPIO_9_7
 #endif

-#define NPCX_ALT_TABLE                                                                                \
-	{                                                                                \
-		NPCX_ALT_GPIO_0_0 /* PSL_IN2 */                                                                                \
-			NPCX_ALT_GPIO_0_1 /* PSL_IN3 */                                                                                \
-				NPCX_ALT_GPIO_0_2 /* PSL_IN4 */                                                                                \
-					NPCX_ALT_GPIO_0_3 /* KSO16 */                                                                                \
-						NPCX_ALT_GPIO_0_4 /* KSO13 */                                                                                \
-							NPCX_ALT_GPIO_0_5 /* KSO12                                                                                \
-									   */                                                                                \
-										  NPCX_ALT_GPIO_0_6 /* KSO11 */                                                                                \
-											  NPCX_ALT_GPIO_0_7 /* KSO10 */                                                                                \
-												  NPCX_ALT_GPIO_1_0 /* KSO09 & CR_SIN */                                                                                \
-													  NPCX_ALT_GPIO_1_1 /* KSO08 & CR_SOUT */                                                                                \
-														  NPCX_ALT_GPIO_1_2 /* KSO07 */                                                                                \
-															  NPCX_ALT_GPIO_1_3 /* KSO06 */                                                                                \
-																  NPCX_ALT_GPIO_1_4 /* KSO05 */                                                                                \
-																	  NPCX_ALT_GPIO_1_5 /* KSO04 */                                                                                \
-																		  NPCX_ALT_GPIO_1_6 /* KSO03 */                                                                                \
-																			  NPCX_ALT_GPIO_1_7 /* KSO02 */                                                                                \
-																				  NPCX_ALT_GPIO_2_0 /* KSO01 */                                                                                \
-																					  NPCX_ALT_GPIO_2_1 /* KSO00 */                                                                                \
-																						  NPCX_ALT_GPIO_2_2 /* KSI7 */                                                                                \
-																							  NPCX_ALT_GPIO_2_3 /* KSI6 */                                                                                \
-																								  NPCX_ALT_GPIO_2_4 /* KSI5 */                                                                                \
-																									  NPCX_ALT_GPIO_2_5 /* KSI4 */                                                                                \
-																										  NPCX_ALT_GPIO_2_6 /* KSI3 */                                                                                \
-																											  NPCX_ALT_GPIO_2_7 /* KSI2 */                                                                                \
-																												  NPCX_ALT_GPIO_3_0 /* KSI1 */                                                                                \
-																													  NPCX_ALT_GPIO_3_1 /* KSI0 */                                                                                \
-																														  NPCX_ALT_GPIO_3_3 /* SMB5SCL0 */                                                                                \
-																															  NPCX_ALT_GPIO_3_4 /* ADC6/PS2_DAT2 */                                                                                \
-																																  NPCX_ALT_GPIO_3_6 /* SMB5SDA0 */                                                                                \
-																																	  NPCX_ALT_GPIO_3_7 /* ADC5/PS2_CLK2 */                                                                                \
-																																		  NPCX_ALT_GPIO_4_0 /* TA1_SEL1 */                                                                                \
-																																			  NPCX_ALT_GPIO_4_1 /* ADC4  */                                                                                \
-																																				  NPCX_ALT_GPIO_4_2 /* ADC3  */                                                                                \
-																																					  NPCX_ALT_GPIO_4_3 /* ADC2  */                                                                                \
-																																						  NPCX_ALT_GPIO_4_4 /* ADC1  */                                                                                \
-																																							  NPCX_ALT_GPIO_4_5 /* ADC0  */                                                                                \
-																																								  NPCX_ALT_GPIO_6_0 /* PWM7 */                                                                                \
-																																									  NPCX_ALT_GPIO_6_2 /* PS2_CLK1 */                                                                                \
-																																										  NPCX_ALT_GPIO_6_3 /* PS2_DAT1 */                                                                                \
-																																											  NPCX_ALT_GPIO_6_4 /* CR_SIN1 SEL2 */                                                                                \
-																																												  NPCX_ALT_GPIO_6_5 /* CR_SOUT1 SEL2 */                                                                                \
-																																													  NPCX_ALT_GPIO_6_7 /* PS2_CLK0 */                                                                                \
-																																														  NPCX_ALT_GPIO_7_0 /* PS2_DAT0 */                                                                                \
-																																															  NPCX_ALT_GPIO_7_3 /* TA2_SEL1 */                                                                                \
-																																																  NPCX_ALT_GPIO_7_5 /* CR_SIN2 & 32KHZ_OUT */                                                                                \
-																																																	  NPCX_ALT_GPIO_8_0 /* PWM3 */                                                                                \
-																																																		  NPCX_ALT_GPIO_8_2 /* KSO14 */                                                                                \
-																																																			  NPCX_ALT_GPIO_8_3 /* KSO15 */                                                                                \
-																																																				  NPCX_ALT_GPIO_8_5 /* SMB4SCL0 */                                                                                \
-																																																					  NPCX_ALT_GPIO_8_6 /* CR_SOUT2 & SMB4SDA0 */                                                                                \
-																																																						  NPCX_ALT_GPIO_8_7 /* SMB1SDA0 */                                                                                \
-																																																							  NPCX_ALT_GPIO_9_0 /* SMB1SCL0 */                                                                                \
-																																																								  NPCX_ALT_GPIO_9_1 /* SMB2SDA0 */                                                                                \
-																																																									  NPCX_ALT_GPIO_9_2 /* SMB2SCL0 */                                                                                \
-																																																										  NPCX_ALT_GPIO_9_3 /* TA1_SEL2 */                                                                                \
-																																																											  NPCX_ALT_GPIO_9_4 /* DMIC_CLK */                                                                                \
-																																																												  NPCX_ALT_GPIO_9_5 /* SPIP_MISO */                                                                                \
-																																																													  NPCX_ALT_GPIO_9_7 /* DMIC_IN */                                                                                \
-																																																														  NPCX_ALT_GPIO_A_1 /* SPIP_SCLK */                                                                                \
-																																																															  NPCX_ALT_GPIO_A_3 /* SPIP_MOSI */                                                                                \
-																																																																  NPCX_ALT_GPIO_A_5 /* SPIP_CS1 & I2S_SYNC */                                                                                \
-																																																																	  NPCX_ALT_GPIO_A_6 /* TA2_SEL2/PS2_CLK3 */                                                                                \
-																																																																		  NPCX_ALT_GPIO_A_7 /* I2S_SCLK/PS2_DAT3 */                                                                                \
-																																																																			  NPCX_ALT_GPIO_B_0 /* I2S_DATA */                                                                                \
-																																																																				  NPCX_ALT_GPIO_B_1 /* KSO17 */                                                                                \
-																																																																					  NPCX_ALT_GPIO_B_2 /* SMB7SDA0 */                                                                                \
-																																																																						  NPCX_ALT_GPIO_B_3 /* SMB7SCL0 */                                                                                \
-																																																																							  NPCX_ALT_GPIO_B_4 /* SMB0SDA0 */                                                                                \
-																																																																								  NPCX_ALT_GPIO_B_5 /* SMB0SCL0 */                                                                                \
-																																																																									  NPCX_ALT_GPIO_B_6 /* PWM4 */                                                                                \
-																																																																										  NPCX_ALT_GPIO_B_7 /* PWM5 */                                                                                \
-																																																																											  NPCX_ALT_GPIO_C_0 /* PWM6 */                                                                                \
-																																																																												  NPCX_ALT_GPIO_C_1 /* SMB6SDA0 */                                                                                \
-																																																																													  NPCX_ALT_GPIO_C_2 /* SMB6SCL0 & PWM1 */                                                                                \
-																																																																														  NPCX_ALT_GPIO_C_3 /* PWM0 */                                                                                \
-																																																																															 NPCX_ALT_GPIO_C_4 /* PWM2 */                                                                                \
-																																																																																NPCX_ALT_GPIO_D_0 /* SMB3SDA0 */                                                                                \
-																																																																																NPCX_ALT_GPIO_D_1 /* SMB3SCL0 */                                                                                \
-																																																																																NPCX_ALT_GPIO_D_2 /* PSL_IN1 */                                                                                \
-																																																																																NPCX_ALT_GPIO_E_1 /* ADC7  */                                                                            \
-																																																																																NPCX_ALT_GPIO_E_3 /* SMB6SDA1 */                                                                 \
-																																																																																NPCX_ALT_GPIO_E_4 /* SMB6SCL1 */                                                         \
-																																																																																NPCX_ALT_GPIO_E_7 /* 32KCLKIN */                                                 \
-																																																																																NPCX_ALT_GPIO_F_0 /* ADC9  */                                            \
-																																																																																NPCX_ALT_GPIO_F_1 /* ADC8  */                                    \
-																																																																																NPCX_ALT_GPIO_F_2 /* SMB4SDA1 */                         \
-																																																																																NPCX_ALT_GPIO_F_3 /* SMB4SCL1 */                 \
-																																																																																NPCX_ALT_GPIO_F_4 /* SMB5SDA1 */         \
-																																																																																NPCX_ALT_GPIO_F_5 /* SMB5SCL1 */ \
+#define NPCX_ALT_TABLE                                                                                \
+	{                                                                                \
+		NPCX_ALT_GPIO_0_0 /* PSL_IN2 */                                                                                \
+			NPCX_ALT_GPIO_0_1 /* PSL_IN3 */                                                                                \
+				NPCX_ALT_GPIO_0_2 /* PSL_IN4 */                                                                                \
+					NPCX_ALT_GPIO_0_3 /* KSO16 */                                                                                \
+						NPCX_ALT_GPIO_0_4 /* KSO13 */                                                                                \
+							NPCX_ALT_GPIO_0_5 /* KSO12                                                                                \
+									   */                                                                                \
+								NPCX_ALT_GPIO_0_6 /* KSO11 */                                                                                \
+									NPCX_ALT_GPIO_0_7 /* KSO10 */                                                                                \
+										NPCX_ALT_GPIO_1_0 /* KSO09 & CR_SIN */                                                                                \
+											NPCX_ALT_GPIO_1_1 /* KSO08 & CR_SOUT */                                                                                \
+												NPCX_ALT_GPIO_1_2 /* KSO07 */                                                                                \
+													NPCX_ALT_GPIO_1_3 /* KSO06 */                                                                                \
+														NPCX_ALT_GPIO_1_4 /* KSO05 */                                                                                \
+															NPCX_ALT_GPIO_1_5 /* KSO04 */                                                                                \
+																NPCX_ALT_GPIO_1_6 /* KSO03 */                                                                                \
+																	NPCX_ALT_GPIO_1_7 /* KSO02 */                                                                                \
+																		NPCX_ALT_GPIO_2_0 /* KSO01 */                                                                                \
+																			NPCX_ALT_GPIO_2_1 /* KSO00 */                                                                                \
+																				NPCX_ALT_GPIO_2_2 /* KSI7 */                                                                                \
+																					NPCX_ALT_GPIO_2_3 /* KSI6 */                                                                                \
+																						NPCX_ALT_GPIO_2_4 /* KSI5 */                                                                                \
+																							NPCX_ALT_GPIO_2_5 /* KSI4 */                                                                                \
+																								NPCX_ALT_GPIO_2_6 /* KSI3 */                                                                                \
+																									NPCX_ALT_GPIO_2_7 /* KSI2 */                                                                                \
+																										NPCX_ALT_GPIO_3_0 /* KSI1 */                                                                                \
+																											NPCX_ALT_GPIO_3_1 /* KSI0 */                                                                                \
+																												NPCX_ALT_GPIO_3_3 /* SMB5SCL0 */                                                                                \
+																													NPCX_ALT_GPIO_3_4 /* ADC6/PS2_DAT2 */                                                                                \
+																														NPCX_ALT_GPIO_3_6 /* SMB5SDA0 */                                                                                \
+																															NPCX_ALT_GPIO_3_7 /* ADC5/PS2_CLK2 */                                                                                \
+																																NPCX_ALT_GPIO_4_0 /* TA1_SEL1 */                                                                                \
+																																	NPCX_ALT_GPIO_4_1 /* ADC4  */                                                                                \
+																																		NPCX_ALT_GPIO_4_2 /* ADC3  */                                                                                \
+																																			NPCX_ALT_GPIO_4_3 /* ADC2  */                                                                                \
+																																				NPCX_ALT_GPIO_4_4 /* ADC1  */                                                                                \
+																																					NPCX_ALT_GPIO_4_5 /* ADC0  */                                                                                \
+																																						NPCX_ALT_GPIO_6_0 /* PWM7 */                                                                                \
+																																							NPCX_ALT_GPIO_6_2 /* PS2_CLK1 */                                                                                \
+																																								NPCX_ALT_GPIO_6_3 /* PS2_DAT1 */                                                                                \
+																																									NPCX_ALT_GPIO_6_4 /* CR_SIN1 SEL2 */                                                                                \
+																																										NPCX_ALT_GPIO_6_5 /* CR_SOUT1 SEL2 */                                                                                \
+																																											NPCX_ALT_GPIO_6_7 /* PS2_CLK0 */                                                                                \
+																																												NPCX_ALT_GPIO_7_0 /* PS2_DAT0 */                                                                                \
+																																													NPCX_ALT_GPIO_7_3 /* TA2_SEL1 */                                                                                \
+																																														NPCX_ALT_GPIO_7_5 /* CR_SIN2 & 32KHZ_OUT */                                                                                \
+																																															NPCX_ALT_GPIO_8_0 /* PWM3 */                                                                                \
+																																																NPCX_ALT_GPIO_8_2 /* KSO14 */                                                                                \
+																																																	NPCX_ALT_GPIO_8_3 /* KSO15 */                                                                                \
+																																																		NPCX_ALT_GPIO_8_5 /* SMB4SCL0 */                                                                                \
+																																																			NPCX_ALT_GPIO_8_6 /* CR_SOUT2 & SMB4SDA0 */                                                                                \
+																																																				NPCX_ALT_GPIO_8_7 /* SMB1SDA0 */                                                                                \
+																																																					NPCX_ALT_GPIO_9_0 /* SMB1SCL0 */                                                                                \
+																																																						NPCX_ALT_GPIO_9_1 /* SMB2SDA0 */                                                                                \
+																																																							NPCX_ALT_GPIO_9_2 /* SMB2SCL0 */                                                                                \
+																																																								NPCX_ALT_GPIO_9_3 /* TA1_SEL2 */                                                                                \
+																																																									NPCX_ALT_GPIO_9_4 /* DMIC_CLK */                                                                                \
+																																																										NPCX_ALT_GPIO_9_5 /* SPIP_MISO */                                                                                \
+																																																											NPCX_ALT_GPIO_9_7 /* DMIC_IN */                                                                                \
+																																																												NPCX_ALT_GPIO_A_1 /* SPIP_SCLK */                                                                                \
+																																																													NPCX_ALT_GPIO_A_3 /* SPIP_MOSI */                                                                                \
+																																																														NPCX_ALT_GPIO_A_5 /* SPIP_CS1 & I2S_SYNC */                                                                                \
+																																																															NPCX_ALT_GPIO_A_6 /* TA2_SEL2/PS2_CLK3 */                                                                                \
+																																																																NPCX_ALT_GPIO_A_7 /* I2S_SCLK/PS2_DAT3 */                                                                                \
+																																																																	NPCX_ALT_GPIO_B_0 /* I2S_DATA */                                                                                \
+																																																																		NPCX_ALT_GPIO_B_1 /* KSO17 */                                                                                \
+																																																																			NPCX_ALT_GPIO_B_2 /* SMB7SDA0 */                                                                                \
+																																																																				NPCX_ALT_GPIO_B_3 /* SMB7SCL0 */                                                                                \
+																																																																					NPCX_ALT_GPIO_B_4 /* SMB0SDA0 */                                                                                \
+																																																																						NPCX_ALT_GPIO_B_5 /* SMB0SCL0 */                                                                                \
+																																																																							NPCX_ALT_GPIO_B_6 /* PWM4 */                                                                                \
+																																																																								NPCX_ALT_GPIO_B_7 /* PWM5 */                                                                                \
+																																																																									NPCX_ALT_GPIO_C_0 /* PWM6 */                                                                                \
+																																																																										NPCX_ALT_GPIO_C_1 /* SMB6SDA0 */                                                                                \
+																																																																											NPCX_ALT_GPIO_C_2 /* SMB6SCL0 & PWM1 */                                                                                \
+																																																																												NPCX_ALT_GPIO_C_3 /* PWM0 */                                                                                \
+																																																																													NPCX_ALT_GPIO_C_4 /* PWM2 */                                                                                \
+																																																																														NPCX_ALT_GPIO_D_0 /* SMB3SDA0 */                                                                                \
+																																																																															NPCX_ALT_GPIO_D_1 /* SMB3SCL0 */                                                                                \
+																																																																																NPCX_ALT_GPIO_D_2 /* PSL_IN1 */                                                                                \
+																																																																																NPCX_ALT_GPIO_E_1 /* ADC7  */                                                                            \
+																																																																																NPCX_ALT_GPIO_E_3 /* SMB6SDA1 */                                                                 \
+																																																																																NPCX_ALT_GPIO_E_4 /* SMB6SCL1 */                                                         \
+																																																																																NPCX_ALT_GPIO_E_7 /* 32KCLKIN */                                                 \
+																																																																																NPCX_ALT_GPIO_F_0 /* ADC9  */                                            \
+																																																																																NPCX_ALT_GPIO_F_1 /* ADC8  */                                    \
+																																																																																NPCX_ALT_GPIO_F_2 /* SMB4SDA1 */                         \
+																																																																																NPCX_ALT_GPIO_F_3 /* SMB4SCL1 */                 \
+																																																																																NPCX_ALT_GPIO_F_4 /* SMB5SDA1 */         \
+																																																																																NPCX_ALT_GPIO_F_5 /* SMB5SCL1 */ \
 	}

 /*****************************************************************************/
@@ -491,8 +495,9 @@
 #define NPCX_LVOL_CTRL_2_4 NPCX_GPIO(C, 1)
 #define NPCX_LVOL_CTRL_2_5 NPCX_GPIO(C, 7)
 #ifdef NPCX_EXT32K_OSC_SUPPORT
-#define NPCX_LVOL_CTRL_2_6 NPCX_GPIO_NONE /* Remove 1.8V support since CLKIN \
-					   */
+#define NPCX_LVOL_CTRL_2_6                                \
+	NPCX_GPIO_NONE /* Remove 1.8V support since CLKIN \
+			*/
 #else
 #define NPCX_LVOL_CTRL_2_6 NPCX_GPIO(E, 7)
 #endif
@@ -503,8 +508,9 @@
 #define NPCX_LVOL_CTRL_3_1 NPCX_GPIO(3, 7)
 #define NPCX_LVOL_CTRL_3_2 NPCX_GPIO(4, 0)
 #ifdef NPCX_EXT32K_OSC_SUPPORT
-#define NPCX_LVOL_CTRL_3_3 NPCX_GPIO_NONE /* Remove 1.8V support since \
-					     CLKOUT*/
+#define NPCX_LVOL_CTRL_3_3                          \
+	NPCX_GPIO_NONE /* Remove 1.8V support since \
+			  CLKOUT*/
 #else
 #define NPCX_LVOL_CTRL_3_3 NPCX_GPIO(7, 1)
 #endif


JsonValueStore to write the compression-related keys to the property store.

--- keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h
+++ keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h
@@ -275,6 +275,8 @@
           pt.put("size", std::to_string(values_buffer_size_));
           pt.put("values", std::to_string(number_of_values_));
           pt.put("unique_values", std::to_string(number_of_unique_values_));
+          pt.put(std::string("__") + COMPRESSOR_KEY, compressor_->name());
+          pt.put(std::string("__") + COMPRESSION_THRESHOLD_KEY, compression_threshold_);

           internal::SerializationUtils::WriteJsonRecord(stream, pt);
           TRACE("Wrote JSON header, stream at %d", stream.tellp());


Cosmetics: reindent after last commit

Cosmetics: reindent after last commit

git-svn-id: a4d7c1866f8397a4106e0b57fc4fbf792bbdaaaf@15391 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

--- libavcodec/bmp.c
+++ libavcodec/bmp.c
@@ -232,72 +232,72 @@
     if(comp == BMP_RLE4 || comp == BMP_RLE8){
         ff_msrle_decode(avctx, p, depth, buf, dsize);
     }else{
-    switch(depth){
-    case 1:
-        for(i = 0; i < avctx->height; i++){
-            memcpy(ptr, buf, n);
-            buf += n;
-            ptr += linesize;
+        switch(depth){
+        case 1:
+            for(i = 0; i < avctx->height; i++){
+                memcpy(ptr, buf, n);
+                buf += n;
+                ptr += linesize;
+            }
+            break;
+        case 4:
+            for(i = 0; i < avctx->height; i++){
+                int j;
+                for(j = 0; j < n; j++){
+                    ptr[j*2+0] = (buf[j] >> 4) & 0xF;
+                    ptr[j*2+1] = buf[j] & 0xF;
+                }
+                buf += n;
+                ptr += linesize;
+            }
+            break;
+        case 8:
+            for(i = 0; i < avctx->height; i++){
+                memcpy(ptr, buf, avctx->width);
+                buf += n;
+                ptr += linesize;
+            }
+            break;
+        case 24:
+            for(i = 0; i < avctx->height; i++){
+                memcpy(ptr, buf, avctx->width*(depth>>3));
+                buf += n;
+                ptr += linesize;
+            }
+            break;
+        case 16:
+            for(i = 0; i < avctx->height; i++){
+                const uint16_t *src = (const uint16_t *) buf;
+                uint16_t *dst = (uint16_t *) ptr;
+
+                for(j = 0; j < avctx->width; j++)
+                    *dst++ = le2me_16(*src++);
+
+                buf += n;
+                ptr += linesize;
+            }
+            break;
+        case 32:
+            for(i = 0; i < avctx->height; i++){
+                const uint8_t *src = buf;
+                uint8_t *dst = ptr;
+
+                for(j = 0; j < avctx->width; j++){
+                    dst[0] = src[rgb[2]];
+                    dst[1] = src[rgb[1]];
+                    dst[2] = src[rgb[0]];
+                    dst += 3;
+                    src += 4;
+                }
+
+                buf += n;
+                ptr += linesize;
+            }
+            break;
+        default:
+            av_log(avctx, AV_LOG_ERROR, "BMP decoder is broken\n");
+            return -1;
         }
-        break;
-    case 4:
-        for(i = 0; i < avctx->height; i++){
-            int j;
-            for(j = 0; j < n; j++){
-                ptr[j*2+0] = (buf[j] >> 4) & 0xF;
-                ptr[j*2+1] = buf[j] & 0xF;
-            }
-            buf += n;
-            ptr += linesize;
-        }
-        break;
-    case 8:
-        for(i = 0; i < avctx->height; i++){
-            memcpy(ptr, buf, avctx->width);
-            buf += n;
-            ptr += linesize;
-        }
-        break;
-    case 24:
-        for(i = 0; i < avctx->height; i++){
-            memcpy(ptr, buf, avctx->width*(depth>>3));
-            buf += n;
-            ptr += linesize;
-        }
-        break;
-    case 16:
-        for(i = 0; i < avctx->height; i++){
-            const uint16_t *src = (const uint16_t *) buf;
-            uint16_t *dst = (uint16_t *) ptr;
-
-            for(j = 0; j < avctx->width; j++)
-                *dst++ = le2me_16(*src++);
-
-            buf += n;
-            ptr += linesize;
-        }
-        break;
-    case 32:
-        for(i = 0; i < avctx->height; i++){
-            const uint8_t *src = buf;
-            uint8_t *dst = ptr;
-
-            for(j = 0; j < avctx->width; j++){
-                dst[0] = src[rgb[2]];
-                dst[1] = src[rgb[1]];
-                dst[2] = src[rgb[0]];
-                dst += 3;
-                src += 4;
-            }
-
-            buf += n;
-            ptr += linesize;
-        }
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "BMP decoder is broken\n");
-        return -1;
-    }
     }

     *picture = s->picture;


suggest: use learner_increment()

suggest: use learner_increment()

--- plugins/suggest/suggest.c
+++ plugins/suggest/suggest.c
@@ -770,8 +770,7 @@
     learner_init_columns(ctx, learner);
     learner_init_buffers(ctx, learner);
     GRN_RECORD_INIT(&pre_events, 0, grn_obj_id(ctx, learner->events));
-    grn_obj_set_value(ctx, learner->items_freq, post_item_id,
-                      &(learner->v1), GRN_OBJ_INCR);
+    learner_increment(ctx, learner, learner->items_freq, post_item_id);
     grn_obj_set_value(ctx, learner->items_last, post_item_id,
                       post_time, GRN_OBJ_SET);
     if (post_type_id) {


chip/stm32/usb_dwc_stream.c: Format with clang-format

BUG=b:236386294
BRANCH=none
TEST=none

Change-Id: I2af3aa3f7040444cb25cfa940149c9c61ec0f1ef
Signed-off-by: Jack Rosenthal <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729573
Reviewed-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>

--- chip/stm32/usb_dwc_stream.c
+++ chip/stm32/usb_dwc_stream.c
@@ -9,7 +9,7 @@
 #include "util.h"

 #include "console.h"
-#define CPRINTF(format, args...) cprintf(CC_USB, format, ## args)
+#define CPRINTF(format, args...) cprintf(CC_USB, format, ##args)

 /*
  * This function tries to shove new bytes from the USB host into the queue for
@@ -24,9 +24,8 @@

 	/* If we have some, try to shove them into the queue */
 	if (rx_count) {
-		size_t added = QUEUE_ADD_UNITS(
-			config->producer.queue, config->rx_ram,
-			rx_count);
+		size_t added = QUEUE_ADD_UNITS(config->producer.queue,
+					       config->rx_ram, rx_count);
 		if (added != rx_count) {
 			CPRINTF("rx_stream_handler: failed ep%d "
 				"queue %d bytes, accepted %d\n",
@@ -60,7 +59,7 @@

 /* Reset stream */
 void usb_stream_event(struct usb_stream_config const *config,
-		enum usb_ep_event evt)
+		      enum usb_ep_event evt)
 {
 	if (evt != USB_EVENT_RESET)
 		return;


Fixed a few merging errors.

Fixed a few merging errors.

--- keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h
+++ keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h
@@ -25,9 +25,12 @@
 #ifndef JSON_VALUE_STORE_H_
 #define JSON_VALUE_STORE_H_

+#include "dictionary/fsa/internal/intrinsics.h"
+#if defined(KEYVI_SSE42)
+#define RAPIDJSON_SSE42
+#endif
+
 #include <functional>
-#include <zlib.h>
-#include <snappy.h>
 #include <boost/functional/hash.hpp>
 #include <boost/lexical_cast.hpp>
 #include "rapidjson/document.h"
@@ -392,9 +395,16 @@
             }
           }

+          boost::interprocess::map_options_t map_options =
+              boost::interprocess::default_map_options | MAP_HUGETLB;
+
+          if (!load_lazy) {
+            map_options |= MAP_POPULATE;
+          }
+
           strings_region_ = new boost::interprocess::mapped_region(
               *file_mapping, boost::interprocess::read_only, offset,
-              strings_size);
+              strings_size, 0, map_options);

           strings_ = (const char*) strings_region_->get_address();
         }


Fix toggling of Colourful Tabs

Fix toggling of Colourful Tabs

--- extensions/colorful-tabs.c
+++ extensions/colorful-tabs.c
@@ -10,15 +10,6 @@
 */

 #include <midori/midori.h>
-
-static void
-colorful_tabs_button_toggled_cb (GtkWidget*       button,
-                                 MidoriExtension* extension)
-{
-    midori_extension_set_boolean (extension, "tint",
-        !midori_extension_get_boolean (extension, "tint"));
-    /* FIXME: Update all tab colors */
-}

 static void
 colorful_tabs_view_notify_uri_cb (MidoriView*      view,
@@ -71,6 +62,25 @@
 }

 static void
+colorful_tabs_browser_foreach_cb (GtkWidget*       view,
+                                  MidoriExtension* extension)
+{
+    colorful_tabs_view_notify_uri_cb (MIDORI_VIEW (view), NULL, extension);
+}
+
+static void
+colorful_tabs_button_toggled_cb (GtkWidget*       button,
+                                 MidoriExtension* extension)
+{
+    MidoriBrowser* browser = MIDORI_BROWSER (gtk_widget_get_toplevel (button));
+
+    midori_extension_set_boolean (extension, "tint",
+        !midori_extension_get_boolean (extension, "tint"));
+    midori_browser_foreach (browser,
+        (GtkCallback)colorful_tabs_browser_foreach_cb, extension);
+}
+
+static void
 colorful_tabs_browser_add_tab_cb (MidoriBrowser*   browser,
                                   MidoriView*      view,
                                   MidoriExtension* extension)
@@ -83,11 +93,12 @@
 colorful_tabs_deactivate_cb (MidoriExtension* extension,
                              GtkWidget*       bbox)
 {
-    gtk_widget_destroy (bbox);
     g_signal_handlers_disconnect_by_func (
         extension, colorful_tabs_deactivate_cb, bbox);
     /* FIXME: Disconnect signals */
-    /* FIXME: Reset all tab colors */
+    midori_browser_foreach (MIDORI_BROWSER (gtk_widget_get_toplevel (bbox)),
+        (GtkCallback)colorful_tabs_browser_foreach_cb, extension);
+    gtk_widget_destroy (bbox);
 }

 static void


sbc: Fix empty parameter list in usage() declaration

--- sbc/sbctester.c
+++ sbc/sbctester.c
@@ -245,7 +245,7 @@
 	return verdict;
 }

-static void usage()
+static void usage(void)
 {
 	printf("SBC conformance test ver %s\n", VERSION);
 	printf("Copyright (c) 2007-2010  Marcel Holtmann\n");


dont print NULL

dont print NULL

git-svn-id: a4d7c1866f8397a4106e0b57fc4fbf792bbdaaaf@4600 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

--- libavcodec/opt.c
+++ libavcodec/opt.c
@@ -264,7 +264,9 @@
         av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_AUDIO_PARAM   ) ? 'A' : '.');
         av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.');

-        av_log(av_log_obj, AV_LOG_INFO, " %s\n", opt->help);
+        if(opt->help)
+            av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help);
+        av_log(av_log_obj, AV_LOG_INFO, "\n");
     }
     return 0;
 }


Build fix take 2.

Build fix take 2.

(We don't have try servers for ChromeOS yet.)

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@27385 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/app/breakpad_linux.h
+++ chrome/app/breakpad_linux.h
@@ -4,6 +4,8 @@

 #ifndef CHROME_APP_BREAKPAD_LINUX_H_
 #define CHROME_APP_BREAKPAD_LINUX_H_
+
+#include <stdlib.h>

 extern void InitCrashReporter();


Removed unnecessary intermediate assignment from @strongify (don't know why I thought it necessary before)

--- extobjc/Modules/EXTScope.h
+++ extobjc/Modules/EXTScope.h
@@ -84,5 +84,4 @@
     __weak __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR);

 #define ext_strongify_(INDEX, VAR) \
-    __strong __typeof__(VAR) metamacro_concat(VAR, _strong_) = metamacro_concat(VAR, _weak_), \
-                             VAR = metamacro_concat(VAR, _strong_);
+    __strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_);