File Apply-Partial-patch-for-C-11-compilation-of-the-Fire.patch of Package firebird
From: mapopa <mapopa@65644016-39b1-43b1-bf79-96bc8fe82c15>
Date: Wed, 3 Jun 2015 08:11:03 +0000
Subject: Apply Partial patch for C++11 compilation of the Firebird
code in libreoffice
http://cgit.freedesktop.org/libreoffice/core/commit/?id=9fe159ef7cb7cfe5c1c91a6fbf1aa02fe79fec69
Patch-mainline: v2.5.5
Git-commit: 5f95721af98b30cb6abc33f368748bd25958beb0
git-svn-id: svn+ssh://svn.code.sf.net/p/firebird/code/firebird/branches/B2_5_Release@61701 65644016-39b1-43b1-bf79-96bc8fe82c15
---
src/common/classes/alloc.cpp | 4 ++--
src/common/cvt.cpp | 2 +-
src/gpre/c_cxx.cpp | 10 +++++-----
src/gpre/exp.cpp | 6 +++---
src/gpre/gpre.cpp | 6 +++---
src/gpre/int_cxx.cpp | 10 +++++-----
src/gpre/pat.cpp | 2 +-
src/jrd/perf.cpp | 6 +++---
8 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/src/common/classes/alloc.cpp b/src/common/classes/alloc.cpp
index 20615b9e81ef..41c242b79159 100644
--- a/src/common/classes/alloc.cpp
+++ b/src/common/classes/alloc.cpp
@@ -1123,7 +1123,7 @@ void MemoryPool::print_contents(FILE* file, bool used_only, const char* filter_p
if (blk->mbk_flags & MBK_LAST)
break;
}
- fprintf(file, "Blocks %"SIZEFORMAT" min %"SIZEFORMAT" max %"SIZEFORMAT" size %"SIZEFORMAT" \n\n",
+ fprintf(file, "Blocks %" SIZEFORMAT " min %" SIZEFORMAT " max %" SIZEFORMAT " size %" SIZEFORMAT " \n\n",
cnt, min, max, sum);
}
@@ -1326,7 +1326,7 @@ MemoryPool* MemoryPool::createPool(MemoryPool* parent, MemoryStats& stats)
FreeMemoryBlock* freeBlock = blockToPtr<FreeMemoryBlock*>(blk);
freeBlock->fbk_next_fragment = NULL;
- BlockInfo temp = {blockLength, freeBlock};
+ BlockInfo temp = {static_cast<size_t>(blockLength), freeBlock};
pool->freeBlocks.add(temp);
if (!pool->parent_redirect)
{
diff --git a/src/common/cvt.cpp b/src/common/cvt.cpp
index 00396489527a..4389a0ae68fa 100644
--- a/src/common/cvt.cpp
+++ b/src/common/cvt.cpp
@@ -144,7 +144,7 @@ class DummyException {};
#ifndef NATIVE_QUAD
#ifndef WORDS_BIGENDIAN
-static const SQUAD quad_min_int = { 0, SLONG_MIN };
+static const SQUAD quad_min_int = { 0, static_cast<ULONG>(SLONG_MIN) };
static const SQUAD quad_max_int = { -1, SLONG_MAX };
#else
static const SQUAD quad_min_int = { SLONG_MIN, 0 };
diff --git a/src/gpre/c_cxx.cpp b/src/gpre/c_cxx.cpp
index f819750fe195..f8fe95964afb 100644
--- a/src/gpre/c_cxx.cpp
+++ b/src/gpre/c_cxx.cpp
@@ -876,7 +876,7 @@ static void gen_based( const act* action, int column)
if (based_on->bas_flags & BAS_segment)
{
if (*variable != '*')
- fprintf(gpreGlob.out_file, "[%"SLONGFORMAT"]", length);
+ fprintf(gpreGlob.out_file, "[%" SLONGFORMAT "]", length);
}
else if (field->fld_array_info)
{
@@ -885,7 +885,7 @@ static void gen_based( const act* action, int column)
for (const dim* dimension = field->fld_array_info->ary_dimension;
dimension; dimension = dimension->dim_next)
{
- fprintf(gpreGlob.out_file, " [%"SLONGFORMAT"]", dimension->dim_upper - dimension->dim_lower + 1);
+ fprintf(gpreGlob.out_file, " [%" SLONGFORMAT "]", dimension->dim_upper - dimension->dim_lower + 1);
}
if (field->fld_array_info->ary_dtype <= dtype_varying && field->fld_length > 1)
@@ -1577,7 +1577,7 @@ static void gen_drop_database( const act* action, int column)
const gpre_dbb* db = (gpre_dbb*) action->act_object;
align(column);
- fprintf(gpreGlob.out_file, "isc_drop_database (%s, %"SIZEFORMAT", \"%s\", rdb$k_db_type_gds);",
+ fprintf(gpreGlob.out_file, "isc_drop_database (%s, %" SIZEFORMAT ", \"%s\", rdb$k_db_type_gds);",
status_vector(action),
strlen(db->dbb_filename), db->dbb_filename);
set_sqlcode(action, column);
@@ -3521,7 +3521,7 @@ static void gen_trans( const act* action, int column)
static void gen_type( const act* action, int column)
{
- printa(column, "%"SLONGFORMAT, (SLONG)(IPTR)action->act_object);
+ printa(column, "%" SLONGFORMAT, (SLONG)(IPTR)action->act_object);
}
@@ -3673,7 +3673,7 @@ static void make_array_declaration(ref* reference)
for (const dim* dimension = field->fld_array_info->ary_dimension; dimension;
dimension = dimension->dim_next)
{
- fprintf(gpreGlob.out_file, " [%"SLONGFORMAT"]", dimension->dim_upper - dimension->dim_lower + 1);
+ fprintf(gpreGlob.out_file, " [%" SLONGFORMAT "]", dimension->dim_upper - dimension->dim_lower + 1);
}
if (field->fld_array_info->ary_dtype <= dtype_varying)
diff --git a/src/gpre/exp.cpp b/src/gpre/exp.cpp
index fb56fc4f5ca5..de981b03221b 100644
--- a/src/gpre/exp.cpp
+++ b/src/gpre/exp.cpp
@@ -398,7 +398,7 @@ SINT64 EXP_SINT64_ordinal(bool advance_flag)
if (gpreGlob.token_global.tok_type != tok_number)
CPR_s_error("<number>");
- const char format[8] = "%"SQUADFORMAT;
+ const char format[8] = "%" SQUADFORMAT;
SINT64 n;
sscanf(gpreGlob.token_global.tok_string, format, &n);
@@ -428,7 +428,7 @@ SLONG EXP_SLONG_ordinal(bool advance_flag)
const SLONG n = atoi(gpreGlob.token_global.tok_string);
char buffer[32];
- sprintf(buffer, "%"SLONGFORMAT, n);
+ sprintf(buffer, "%" SLONGFORMAT, n);
if (strcmp(buffer, gpreGlob.token_global.tok_string) != 0)
PAR_error("Numeric value out of range");
@@ -478,7 +478,7 @@ ULONG EXP_ULONG_ordinal(bool advance_flag)
const ULONG n = atoi(gpreGlob.token_global.tok_string);
char buffer[32];
- sprintf(buffer, "%"ULONGFORMAT, n);
+ sprintf(buffer, "%" ULONGFORMAT, n);
if (strcmp(buffer, gpreGlob.token_global.tok_string) != 0)
PAR_error("Numeric value out of range");
diff --git a/src/gpre/gpre.cpp b/src/gpre/gpre.cpp
index b00f889f490c..4140dda34c60 100644
--- a/src/gpre/gpre.cpp
+++ b/src/gpre/gpre.cpp
@@ -2525,9 +2525,9 @@ static void pass2( SLONG start_position)
if (line_pending)
{
if (line == 1)
- fprintf(gpreGlob.out_file, "#line %"SLONGFORMAT" \"%s\"\n", line, backlash_fixed_file_name);
+ fprintf(gpreGlob.out_file, "#line %" SLONGFORMAT " \"%s\"\n", line, backlash_fixed_file_name);
else
- fprintf(gpreGlob.out_file, "\n#line %"SLONGFORMAT" \"%s\"", line, backlash_fixed_file_name);
+ fprintf(gpreGlob.out_file, "\n#line %" SLONGFORMAT " \"%s\"", line, backlash_fixed_file_name);
line_pending = false;
}
@@ -2668,7 +2668,7 @@ static void pass2( SLONG start_position)
{
if (c == '\n' && line_pending)
{
- fprintf(gpreGlob.out_file, "\n#line %"SLONGFORMAT" \"%s\"", line + 1, backlash_fixed_file_name);
+ fprintf(gpreGlob.out_file, "\n#line %" SLONGFORMAT " \"%s\"", line + 1, backlash_fixed_file_name);
line_pending = false;
}
if (c == EOF)
diff --git a/src/gpre/int_cxx.cpp b/src/gpre/int_cxx.cpp
index 1f8ee6d5bc2a..88b12f8e0214 100644
--- a/src/gpre/int_cxx.cpp
+++ b/src/gpre/int_cxx.cpp
@@ -290,7 +290,7 @@ static void gen_compile( const gpre_req* request, int column)
fprintf(gpreGlob.out_file, "if (!%s)", request->req_handle);
align(column);
fprintf(gpreGlob.out_file,
- "%s = CMP_compile2 (tdbb, (UCHAR*) jrd_%"ULONGFORMAT", sizeof(jrd_%"ULONGFORMAT"), true);",
+ "%s = CMP_compile2 (tdbb, (UCHAR*) jrd_%" ULONGFORMAT ", sizeof(jrd_%" ULONGFORMAT "), true);",
request->req_handle, request->req_ident, request->req_ident);
}
@@ -478,7 +478,7 @@ static void gen_receive( const gpre_req* request, const gpre_port* port)
{
fprintf(gpreGlob.out_file,
- "EXE_receive (tdbb, %s, %d, %d, (UCHAR*) &jrd_%"ULONGFORMAT");",
+ "EXE_receive (tdbb, %s, %d, %d, (UCHAR*) &jrd_%" ULONGFORMAT ");",
request->req_handle, port->por_msg_number, port->por_length,
port->por_ident);
}
@@ -495,7 +495,7 @@ static void gen_request( const gpre_req* request)
if (!(request->req_flags & REQ_exp_hand))
fprintf(gpreGlob.out_file, "static void\t*%s;\t// request handle \n", request->req_handle);
- fprintf(gpreGlob.out_file, "static const UCHAR\tjrd_%"ULONGFORMAT" [%d] =",
+ fprintf(gpreGlob.out_file, "static const UCHAR\tjrd_%" ULONGFORMAT " [%d] =",
request->req_ident, request->req_length);
align(INDENT);
fprintf(gpreGlob.out_file, "{\t// blr string \n");
@@ -588,7 +588,7 @@ static void gen_send( const gpre_req* request, const gpre_port* port, int column
}
align(column);
- fprintf(gpreGlob.out_file, "EXE_send (tdbb, %s, %d, %d, (UCHAR*) &jrd_%"ULONGFORMAT");",
+ fprintf(gpreGlob.out_file, "EXE_send (tdbb, %s, %d, %d, (UCHAR*) &jrd_%" ULONGFORMAT ");",
request->req_handle, port->por_msg_number, port->por_length, port->por_ident);
}
@@ -716,7 +716,7 @@ static void make_port( const gpre_port* port, int column)
fprintf(gpreGlob.out_file, fmtstr, reference->ref_ident, name);
}
align(column);
- fprintf(gpreGlob.out_file, "} jrd_%"ULONGFORMAT";", port->por_ident);
+ fprintf(gpreGlob.out_file, "} jrd_%" ULONGFORMAT ";", port->por_ident);
}
diff --git a/src/gpre/pat.cpp b/src/gpre/pat.cpp
index 12323663d6ba..64318307a624 100644
--- a/src/gpre/pat.cpp
+++ b/src/gpre/pat.cpp
@@ -417,7 +417,7 @@ void PATTERN_expand( USHORT column, const TEXT* pattern, PAT* args)
}
}
else if (long_flag) {
- sprintf(p, "%"SLONGFORMAT, long_value);
+ sprintf(p, "%" SLONGFORMAT , long_value);
}
else {
sprintf(p, "%d", value);
diff --git a/src/jrd/perf.cpp b/src/jrd/perf.cpp
index 85aa6aeca615..cd3a210f5de5 100644
--- a/src/jrd/perf.cpp
+++ b/src/jrd/perf.cpp
@@ -164,20 +164,20 @@ static int perf_format(const P* before, const P* after,
case 'b':
case 'c':
case 'x':
- sprintf(p, "%"SQUADFORMAT, delta);
+ sprintf(p, "%" SQUADFORMAT , delta);
while (*p)
p++;
break;
case 'u':
case 's':
- sprintf(p, "%"SQUADFORMAT".%.2"SQUADFORMAT, delta / TICK, (delta % TICK) * 100 / TICK);
+ sprintf(p, "%" SQUADFORMAT ".%.2" SQUADFORMAT , delta / TICK, (delta % TICK) * 100 / TICK);
while (*p)
p++;
break;
case 'e':
- sprintf(p, "%"SQUADFORMAT".%.2"SQUADFORMAT, delta / 100, delta % 100);
+ sprintf(p, "%" SQUADFORMAT ".%.2" SQUADFORMAT , delta / 100, delta % 100);
while (*p)
p++;
break;
--
2.4.6