hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xunzh...@apache.org
Subject incubator-hawq git commit: HAWQ-1187. Fix "-Wsometimes-uninitialized, -Wsizeof-pointer-memaccess, -Wdangling-else, -Wheader-guard, -Wenum-conversion, -Winvalid-source-encoding" compile warnings under osx.
Date Mon, 05 Dec 2016 11:33:47 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 7c05a23f0 -> 07f25fd19


HAWQ-1187. Fix "-Wsometimes-uninitialized, -Wsizeof-pointer-memaccess, -Wdangling-else, -Wheader-guard,
-Wenum-conversion, -Winvalid-source-encoding" compile warnings under osx.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/07f25fd1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/07f25fd1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/07f25fd1

Branch: refs/heads/master
Commit: 07f25fd1962ad212b25b94f9b6738aae48c09a4a
Parents: 7c05a23
Author: xunzhang <xunzhangthu@gmail.com>
Authored: Sat Dec 3 00:02:35 2016 +0800
Committer: xunzhang <xunzhangthu@gmail.com>
Committed: Mon Dec 5 19:33:28 2016 +0800

----------------------------------------------------------------------
 src/backend/access/appendonly/aosegfiles.c              |  2 +-
 src/backend/commands/dbcommands.c                       |  2 ++
 src/backend/commands/tablecmds.c                        |  8 ++++----
 src/backend/executor/execQual.c                         |  4 ++--
 src/backend/executor/nodeTableFunction.c                |  2 +-
 src/backend/optimizer/plan/setrefs.c                    |  2 +-
 src/backend/parser/analyze.c                            |  2 +-
 .../resourcebroker/resourcebroker_LIBYARN_proc.c        |  6 +++---
 src/backend/utils/adt/date.c                            | 12 ++++++------
 src/backend/utils/adt/nabstime.c                        |  2 +-
 src/backend/utils/adt/timestamp.c                       |  4 ++--
 src/bin/pg_dump/dumputils.c                             |  4 +---
 src/include/executor/execHHashagg.h                     |  2 +-
 13 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/access/appendonly/aosegfiles.c
----------------------------------------------------------------------
diff --git a/src/backend/access/appendonly/aosegfiles.c b/src/backend/access/appendonly/aosegfiles.c
index 7a57d96..3021f3c 100644
--- a/src/backend/access/appendonly/aosegfiles.c
+++ b/src/backend/access/appendonly/aosegfiles.c
@@ -1091,7 +1091,7 @@ static Datum
 gp_update_ao_master_stats_internal(Oid relid, Snapshot appendOnlyMetaDataSnapshot)
 {
 	Relation		parentrel;
-	Datum			returnDatum;
+	Datum			returnDatum = 0;
 
 	/* open the parent (main) relation */
 	parentrel = heap_open(relid, RowExclusiveLock);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/commands/dbcommands.c
----------------------------------------------------------------------
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 1f61f5e..a70cf01 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -852,6 +852,7 @@ createdb(CreatedbStmt *stmt)
 	 * because it's already reserved for HCatalog integration feature.
 	 */
 	if (OidIsValid(get_database_oid(dbname)))
+	{
 			if (strcmp(dbname, HcatalogDbName) == 0)
 				ereport(ERROR,
 						(errcode(ERRCODE_RESERVED_NAME),
@@ -860,6 +861,7 @@ createdb(CreatedbStmt *stmt)
 				ereport(ERROR,
 						(errcode(ERRCODE_DUPLICATE_DATABASE),
 						errmsg("database \"%s\" already exists", dbname)));
+	}
 
 	/*
 	 * Select an OID for the new database, checking that it doesn't have

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/commands/tablecmds.c
----------------------------------------------------------------------
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 9c4d3fd..bda1616 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -800,7 +800,7 @@ DefineRelation_int(CreateStmt *stmt,
  * Add Default page size and rowgroup size to relation options
  */
 static Datum AddDefaultPageRowGroupSize(Datum relOptions, List *defList){
-	Datum result;
+	Datum result = 0;
 	ListCell   *cell = NULL;
 	bool pageSizeSet = false;
 	bool rowgroupSizeSet = false;
@@ -4718,7 +4718,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
 				pc->arg1 = (Node *)NIL;
 				foreach(l, todo)
 				{
-					List *l1;
+					List *l1 = NIL;
 					ListCell *lc;
 					Node *t = lfirst(l);
 
@@ -10742,10 +10742,10 @@ ATExecSetTableSpace_AppendOnly(
 
 	HeapTuple tuple;
 
-	int32 segmentFileNum;
+	int32 segmentFileNum = 0;
 
 	ItemPointerData oldPersistentTid;
-	int64 oldPersistentSerialNum;
+	int64 oldPersistentSerialNum = 0;
 
 	ItemPointerData newPersistentTid;
 	int64 newPersistentSerialNum;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/executor/execQual.c
----------------------------------------------------------------------
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 6059a66..dc9f527 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -1562,7 +1562,7 @@ restart:
 	{
 		fcinfo.resultinfo = (Node *) &rsinfo;
 	}
-	rsinfo.type = T_ReturnSetInfo;
+	rsinfo.type = (fmNodeTag) T_ReturnSetInfo;
 	rsinfo.econtext = econtext;
 	rsinfo.expectedDesc = fcache->funcResultDesc;
 	rsinfo.allowedModes = (int) (SFRM_ValuePerCall | SFRM_Materialize);
@@ -1878,7 +1878,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
 	 * our own state variables.
 	 */
 	InitFunctionCallInfoData(fcinfo, NULL, 0, NULL, (Node *) &rsinfo);
-	rsinfo.type = T_ReturnSetInfo;
+	rsinfo.type = (fmNodeTag) T_ReturnSetInfo;
 	rsinfo.econtext = econtext;
 	rsinfo.expectedDesc = expectedDesc;
 	rsinfo.allowedModes = (int) (SFRM_ValuePerCall | SFRM_Materialize);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/executor/nodeTableFunction.c
----------------------------------------------------------------------
diff --git a/src/backend/executor/nodeTableFunction.c b/src/backend/executor/nodeTableFunction.c
index dcd8a8c..a53dba2 100644
--- a/src/backend/executor/nodeTableFunction.c
+++ b/src/backend/executor/nodeTableFunction.c
@@ -416,7 +416,7 @@ ExecInitTableFunction(TableFunctionScan *node, EState *estate, int eflags)
 		ExecInitExpr((Expr *) rte->funcexpr, (PlanState *) scanstate);
 	Assert(scanstate->fcache && IsA(scanstate->fcache, FuncExprState));
 
-	scanstate->rsinfo.type		   = T_ReturnSetInfo;
+	scanstate->rsinfo.type		   = (fmNodeTag) T_ReturnSetInfo;
 	scanstate->rsinfo.econtext	   = econtext;
 	scanstate->rsinfo.expectedDesc = resultdesc;
 	scanstate->rsinfo.allowedModes = (int) (SFRM_ValuePerCall);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/optimizer/plan/setrefs.c
----------------------------------------------------------------------
diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c
index e3b2096..e79fb30 100644
--- a/src/backend/optimizer/plan/setrefs.c
+++ b/src/backend/optimizer/plan/setrefs.c
@@ -1461,7 +1461,7 @@ set_inner_join_references(PlannerGlobal *glob, Plan *inner_plan,
 		 * if they are duplicated in qpqual, so must test these independently.
 		 */
 		Index innerrel;
-		List **bitmapqualorig_p;
+		List **bitmapqualorig_p = NIL;
 		if (IsA(inner_plan, BitmapHeapScan))
 		{
 			BitmapHeapScan *innerscan = (BitmapHeapScan *) inner_plan;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/parser/analyze.c
----------------------------------------------------------------------
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 1937471..6ae62b3 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -9322,7 +9322,7 @@ map_sgr_mutator(Node *node, void *context)
 	{
 		GroupingClause *gc = (GroupingClause*)node;
 		GroupingClause *new_gc = makeNode(GroupingClause);
-		memcpy(new_gc, gc, sizeof(gc));
+		memcpy(new_gc, gc, sizeof(GroupingClause));
 		new_gc->groupsets = (List*)map_sgr_mutator((Node*)gc->groupsets, ctx);
 		return (Node*)new_gc;
 	}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN_proc.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN_proc.c b/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN_proc.c
index 9ea8510..73d4c0b 100644
--- a/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN_proc.c
+++ b/src/backend/resourcemanager/resourcebroker/resourcebroker_LIBYARN_proc.c
@@ -1624,6 +1624,9 @@ int RB2YARN_acquireResource(uint32_t memorymb,
     	activeContainerIds[i]  = allocatedResourcesArray[i].containerId;
     }
 
+    /* Return the containers fail to activate. */
+    int64_t *activeFailIds = NULL;
+    int  activeFailSize = 0;
     yarnres = activeResources(LIBYARNClient,
     						  YARNJobID,
 							  activeContainerIds,
@@ -1637,9 +1640,6 @@ int RB2YARN_acquireResource(uint32_t memorymb,
     elog(LOG, "YARN mode resource broker submitted to activate %d containers.",
     		  allocatedResourcesArraySize);
 
-    /* Return the containers fail to activate. */
-    int64_t *activeFailIds = NULL;
-    int  activeFailSize = 0;
     yarnres = getActiveFailContainerIds(LIBYARNClient,
     									&activeFailIds,
 										&activeFailSize);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/utils/adt/date.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index 66509e2..3056f16 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -60,7 +60,7 @@ date_in(PG_FUNCTION_ARGS)
 	struct pg_tm tt,
 			   *tm = &tt;
 	int			tzp;
-	int			dtype;
+	int			dtype = 0;
 	int			nf;
 	int			dterr;
 	char	   *field[MAXDATEFIELDS];
@@ -907,7 +907,7 @@ time_in(PG_FUNCTION_ARGS)
 #endif
 	int32		typmod = PG_GETARG_INT32(2);
 	TimeADT		result;
-	fsec_t		fsec;
+	fsec_t		fsec = 0;
 	struct pg_tm tt,
 			   *tm = &tt;
 	int			tz;
@@ -915,7 +915,7 @@ time_in(PG_FUNCTION_ARGS)
 	int			dterr;
 	char		workbuf[MAXDATELEN + 1];
 	char	   *field[MAXDATEFIELDS];
-	int			dtype;
+	int			dtype = 0;
 	int			ftype[MAXDATEFIELDS];
 
 	dterr = ParseDateTime(str, workbuf, sizeof(workbuf),
@@ -1773,15 +1773,15 @@ timetz_in(PG_FUNCTION_ARGS)
 #endif
 	int32		typmod = PG_GETARG_INT32(2);
 	TimeTzADT  *result;
-	fsec_t		fsec;
+	fsec_t		fsec = 0;
 	struct pg_tm tt,
 			   *tm = &tt;
-	int			tz;
+	int			tz = 0;
 	int			nf;
 	int			dterr;
 	char		workbuf[MAXDATELEN + 1];
 	char	   *field[MAXDATEFIELDS];
-	int			dtype;
+	int			dtype = 0;
 	int			ftype[MAXDATEFIELDS];
 
 	dterr = ParseDateTime(str, workbuf, sizeof(workbuf),

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/utils/adt/nabstime.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index 65aacfd..ca00b13 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -229,7 +229,7 @@ abstimein(PG_FUNCTION_ARGS)
 	int			dterr;
 	char	   *field[MAXDATEFIELDS];
 	char		workbuf[MAXDATELEN + 1];
-	int			dtype;
+	int			dtype = 0;
 	int			nf,
 				ftype[MAXDATEFIELDS];
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/backend/utils/adt/timestamp.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 6549880..dbb523e 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -155,7 +155,7 @@ timestamp_in(PG_FUNCTION_ARGS)
 	struct pg_tm tt,
 			   *tm = &tt;
 	int			tz;
-	int			dtype;
+	int			dtype = 0;
 	int			nf;
 	int			dterr;
 	char	   *field[MAXDATEFIELDS];
@@ -419,7 +419,7 @@ timestamptz_in(PG_FUNCTION_ARGS)
 	struct pg_tm tt,
 			   *tm = &tt;
 	int			tz;
-	int			dtype;
+	int			dtype = 0;
 	int			nf;
 	int			dterr;
 	char	   *field[MAXDATEFIELDS];

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/bin/pg_dump/dumputils.c
----------------------------------------------------------------------
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c
index 1f8149b..9640bd6 100644
--- a/src/bin/pg_dump/dumputils.c
+++ b/src/bin/pg_dump/dumputils.c
@@ -1062,7 +1062,7 @@ char *
 custom_fmtopts_string(const char *src)
 {
 		int			len = src ? strlen(src) : 0;
-		char	   *result = malloc(len * 2 + 1);
+		char	   *result = calloc(len * 2 + 1, sizeof(char));
 		char	   *srcdup = src ? strdup(src) : NULL;
 		char	   *srcdup_start = srcdup;
 		char       *find_res = NULL;
@@ -1071,8 +1071,6 @@ custom_fmtopts_string(const char *src)
 		if(!src || !srcdup || !result)
 			return NULL;
 
-		memset(result,0,sizeof(result));
-
 		while (srcdup)
 		{
 			/* find first word (a) */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/07f25fd1/src/include/executor/execHHashagg.h
----------------------------------------------------------------------
diff --git a/src/include/executor/execHHashagg.h b/src/include/executor/execHHashagg.h
index 34fd562..22fc1a1 100644
--- a/src/include/executor/execHHashagg.h
+++ b/src/include/executor/execHHashagg.h
@@ -32,7 +32,7 @@
  *-------------------------------------------------------------------------
  */
 #ifndef EXECHYBRIDHASHAGG_H
-#define EXECBYBRIDHASHAGG_H
+#define EXECHYBRIDHASHAGG_H
 
 #include "executor/nodeAgg.h" /* Must see AggStatePerGroupData. */
 #include "cdb/cdbpublic.h"    /* CdbExplain_Agg / CdbCellBuf */


Mime
View raw message