Skip to content

Commit

Permalink
Remove commented lines.
Browse files Browse the repository at this point in the history
  modified:   storage/connect/value.cpp
Avoid warning on redefined XSTR
  modified:   storage/connect/tabxml.cpp
  • Loading branch information
Buggynours committed Nov 22, 2015
1 parent 1d239d8 commit 8a860fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
18 changes: 9 additions & 9 deletions storage/connect/tabxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extern "C" char version[];
#endif // !__WIN__

#define TYPE_UNKNOWN 12 /* Must be greater than other types */
#define XSTR(M) sizeof(M) - strlen(M) - 1 /* To avoid overflow*/
#define XLEN(M) sizeof(M) - strlen(M) - 1 /* To avoid overflow*/

/***********************************************************************/
/* Class and structure used by XMLColumns. */
Expand Down Expand Up @@ -226,30 +226,30 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
more:
if (vp->atp) {
strncpy(colname, vp->atp->GetName(g), sizeof(colname));
strncat(xcol->Name, colname, XSTR(xcol->Name));
strncat(xcol->Name, colname, XLEN(xcol->Name));

switch (vp->atp->GetText(g, buf, sizeof(buf))) {
case RC_INFO:
PushWarning(g, txmp);
case RC_OK:
strncat(fmt, "@", XSTR(fmt));
strncat(fmt, "@", XLEN(fmt));
break;
default:
goto err;
} // enswitch rc

if (j)
strncat(fmt, colname, XSTR(fmt));
strncat(fmt, colname, XLEN(fmt));

} else {
if (tdp->Usedom && node->GetType() != 1)
continue;

strncpy(colname, node->GetName(g), sizeof(colname));
strncat(xcol->Name, colname, XSTR(xcol->Name));
strncat(xcol->Name, colname, XLEN(xcol->Name));

if (j)
strncat(fmt, colname, XSTR(fmt));
strncat(fmt, colname, XLEN(fmt));

if (j < lvl && ok) {
vp = lvlp[j+1];
Expand All @@ -267,9 +267,9 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
if (!vp->atp)
node = vp->nl->GetItem(g, vp->k++, node);

strncat(fmt, colname, XSTR(fmt));
strncat(fmt, "/", XSTR(fmt));
strncat(xcol->Name, "_", XSTR(xcol->Name));
strncat(fmt, colname, XLEN(fmt));
strncat(fmt, "/", XLEN(fmt));
strncat(xcol->Name, "_", XLEN(xcol->Name));
j++;
vp->n = (int)strlen(xcol->Name);
vp->m = (int)strlen(fmt);
Expand Down
8 changes: 0 additions & 8 deletions storage/connect/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2440,7 +2440,6 @@ void DTVAL::SetTimeShift(void)

} // end of SetTimeShift

//#if defined(connect_EXPORTS)
// Added by Alexander Barkov
static void TIME_to_localtime(struct tm *tm, const MYSQL_TIME *ltime)
{
Expand All @@ -2462,9 +2461,6 @@ static struct tm *gmtime_mysql(const time_t *timep, struct tm *tm)
TIME_to_localtime(tm, &ltime);
return tm;
} // end of gmtime_mysql
//#else
//#define gmtime_mysql(T,B) gmtime((const time_t *)T)
//#endif

/***********************************************************************/
/* GetGmTime: returns a pointer to a static tm structure obtained */
Expand Down Expand Up @@ -2493,7 +2489,6 @@ struct tm *DTVAL::GetGmTime(struct tm *tm_buffer)
return datm;
} // end of GetGmTime

//#if defined(connect_EXPORTS)
// Added by Alexander Barkov
static time_t mktime_mysql(struct tm *ptm)
{
Expand All @@ -2504,9 +2499,6 @@ static time_t mktime_mysql(struct tm *ptm)
time_t t= TIME_to_timestamp(current_thd, &ltime, &error_code);
return error_code ? (time_t) -1 : t;
}
//#else
//#define mktime_mysql mktime
//#endif

/***********************************************************************/
/* MakeTime: calculates a date value from a tm structures using the */
Expand Down

0 comments on commit 8a860fd

Please sign in to comment.