mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Remove unnecessary (char *) casts [mem]
Remove (char *) casts around memory functions such as memcmp(),
memcpy(), or memset() where the cast is useless. Since these
functions don't take char * arguments anyway, these casts are at best
complicated casts to (void *), about which see commit 7f798aca1d
.
Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Discussion: https://www.postgresql.org/message-id/flat/fd1fcedb-3492-4fc8-9e3e-74b97f2db6c7%40eisentraut.org
This commit is contained in:
@ -228,7 +228,7 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
|
|||||||
if (cache == NULL ||
|
if (cache == NULL ||
|
||||||
cache->strategy != strategy ||
|
cache->strategy != strategy ||
|
||||||
VARSIZE(cache->query) != querysize ||
|
VARSIZE(cache->query) != querysize ||
|
||||||
memcmp((char *) cache->query, (char *) query, querysize) != 0)
|
memcmp(cache->query, query, querysize) != 0)
|
||||||
{
|
{
|
||||||
gtrgm_consistent_cache *newcache;
|
gtrgm_consistent_cache *newcache;
|
||||||
TrgmPackedGraph *graph = NULL;
|
TrgmPackedGraph *graph = NULL;
|
||||||
@ -284,12 +284,12 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
|
|||||||
newcache->strategy = strategy;
|
newcache->strategy = strategy;
|
||||||
newcache->query = (text *)
|
newcache->query = (text *)
|
||||||
((char *) newcache + MAXALIGN(sizeof(gtrgm_consistent_cache)));
|
((char *) newcache + MAXALIGN(sizeof(gtrgm_consistent_cache)));
|
||||||
memcpy((char *) newcache->query, (char *) query, querysize);
|
memcpy(newcache->query, query, querysize);
|
||||||
if (qtrg)
|
if (qtrg)
|
||||||
{
|
{
|
||||||
newcache->trigrams = (TRGM *)
|
newcache->trigrams = (TRGM *)
|
||||||
((char *) newcache->query + MAXALIGN(querysize));
|
((char *) newcache->query + MAXALIGN(querysize));
|
||||||
memcpy((char *) newcache->trigrams, (char *) qtrg, qtrgsize);
|
memcpy((char *) newcache->trigrams, qtrg, qtrgsize);
|
||||||
/* release qtrg in case it was made in fn_mcxt */
|
/* release qtrg in case it was made in fn_mcxt */
|
||||||
pfree(qtrg);
|
pfree(qtrg);
|
||||||
}
|
}
|
||||||
|
@ -278,8 +278,8 @@ xpath_string(PG_FUNCTION_ARGS)
|
|||||||
/* We could try casting to string using the libxml function? */
|
/* We could try casting to string using the libxml function? */
|
||||||
|
|
||||||
xpath = (xmlChar *) palloc(pathsize + 9);
|
xpath = (xmlChar *) palloc(pathsize + 9);
|
||||||
memcpy((char *) xpath, "string(", 7);
|
memcpy(xpath, "string(", 7);
|
||||||
memcpy((char *) (xpath + 7), VARDATA_ANY(xpathsupp), pathsize);
|
memcpy(xpath + 7, VARDATA_ANY(xpathsupp), pathsize);
|
||||||
xpath[pathsize + 7] = ')';
|
xpath[pathsize + 7] = ')';
|
||||||
xpath[pathsize + 8] = '\0';
|
xpath[pathsize + 8] = '\0';
|
||||||
|
|
||||||
|
@ -787,7 +787,7 @@ heap_copytuple(HeapTuple tuple)
|
|||||||
newTuple->t_self = tuple->t_self;
|
newTuple->t_self = tuple->t_self;
|
||||||
newTuple->t_tableOid = tuple->t_tableOid;
|
newTuple->t_tableOid = tuple->t_tableOid;
|
||||||
newTuple->t_data = (HeapTupleHeader) ((char *) newTuple + HEAPTUPLESIZE);
|
newTuple->t_data = (HeapTupleHeader) ((char *) newTuple + HEAPTUPLESIZE);
|
||||||
memcpy((char *) newTuple->t_data, (char *) tuple->t_data, tuple->t_len);
|
memcpy(newTuple->t_data, tuple->t_data, tuple->t_len);
|
||||||
return newTuple;
|
return newTuple;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -813,7 +813,7 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
|
|||||||
dest->t_self = src->t_self;
|
dest->t_self = src->t_self;
|
||||||
dest->t_tableOid = src->t_tableOid;
|
dest->t_tableOid = src->t_tableOid;
|
||||||
dest->t_data = (HeapTupleHeader) palloc(src->t_len);
|
dest->t_data = (HeapTupleHeader) palloc(src->t_len);
|
||||||
memcpy((char *) dest->t_data, (char *) src->t_data, src->t_len);
|
memcpy(dest->t_data, src->t_data, src->t_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1097,7 +1097,7 @@ heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc)
|
|||||||
* the given tuple came from disk, rather than from heap_form_tuple).
|
* the given tuple came from disk, rather than from heap_form_tuple).
|
||||||
*/
|
*/
|
||||||
td = (HeapTupleHeader) palloc(tuple->t_len);
|
td = (HeapTupleHeader) palloc(tuple->t_len);
|
||||||
memcpy((char *) td, (char *) tuple->t_data, tuple->t_len);
|
memcpy(td, tuple->t_data, tuple->t_len);
|
||||||
|
|
||||||
HeapTupleHeaderSetDatumLength(td, tuple->t_len);
|
HeapTupleHeaderSetDatumLength(td, tuple->t_len);
|
||||||
HeapTupleHeaderSetTypeId(td, tupleDesc->tdtypeid);
|
HeapTupleHeaderSetTypeId(td, tupleDesc->tdtypeid);
|
||||||
|
@ -480,11 +480,11 @@ heap_xlog_insert(XLogReaderState *record)
|
|||||||
|
|
||||||
newlen = datalen - SizeOfHeapHeader;
|
newlen = datalen - SizeOfHeapHeader;
|
||||||
Assert(datalen > SizeOfHeapHeader && newlen <= MaxHeapTupleSize);
|
Assert(datalen > SizeOfHeapHeader && newlen <= MaxHeapTupleSize);
|
||||||
memcpy((char *) &xlhdr, data, SizeOfHeapHeader);
|
memcpy(&xlhdr, data, SizeOfHeapHeader);
|
||||||
data += SizeOfHeapHeader;
|
data += SizeOfHeapHeader;
|
||||||
|
|
||||||
htup = &tbuf.hdr;
|
htup = &tbuf.hdr;
|
||||||
MemSet((char *) htup, 0, SizeofHeapTupleHeader);
|
MemSet(htup, 0, SizeofHeapTupleHeader);
|
||||||
/* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
|
/* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
|
||||||
memcpy((char *) htup + SizeofHeapTupleHeader,
|
memcpy((char *) htup + SizeofHeapTupleHeader,
|
||||||
data,
|
data,
|
||||||
@ -625,10 +625,10 @@ heap_xlog_multi_insert(XLogReaderState *record)
|
|||||||
newlen = xlhdr->datalen;
|
newlen = xlhdr->datalen;
|
||||||
Assert(newlen <= MaxHeapTupleSize);
|
Assert(newlen <= MaxHeapTupleSize);
|
||||||
htup = &tbuf.hdr;
|
htup = &tbuf.hdr;
|
||||||
MemSet((char *) htup, 0, SizeofHeapTupleHeader);
|
MemSet(htup, 0, SizeofHeapTupleHeader);
|
||||||
/* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
|
/* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
|
||||||
memcpy((char *) htup + SizeofHeapTupleHeader,
|
memcpy((char *) htup + SizeofHeapTupleHeader,
|
||||||
(char *) tupdata,
|
tupdata,
|
||||||
newlen);
|
newlen);
|
||||||
tupdata += newlen;
|
tupdata += newlen;
|
||||||
|
|
||||||
@ -854,14 +854,14 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
|
|||||||
recdata += sizeof(uint16);
|
recdata += sizeof(uint16);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy((char *) &xlhdr, recdata, SizeOfHeapHeader);
|
memcpy(&xlhdr, recdata, SizeOfHeapHeader);
|
||||||
recdata += SizeOfHeapHeader;
|
recdata += SizeOfHeapHeader;
|
||||||
|
|
||||||
tuplen = recdata_end - recdata;
|
tuplen = recdata_end - recdata;
|
||||||
Assert(tuplen <= MaxHeapTupleSize);
|
Assert(tuplen <= MaxHeapTupleSize);
|
||||||
|
|
||||||
htup = &tbuf.hdr;
|
htup = &tbuf.hdr;
|
||||||
MemSet((char *) htup, 0, SizeofHeapTupleHeader);
|
MemSet(htup, 0, SizeofHeapTupleHeader);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reconstruct the new tuple using the prefix and/or suffix from the
|
* Reconstruct the new tuple using the prefix and/or suffix from the
|
||||||
|
@ -75,7 +75,7 @@ toast_tuple_init(ToastTupleContext *ttc)
|
|||||||
{
|
{
|
||||||
if (ttc->ttc_isnull[i] ||
|
if (ttc->ttc_isnull[i] ||
|
||||||
!VARATT_IS_EXTERNAL_ONDISK(new_value) ||
|
!VARATT_IS_EXTERNAL_ONDISK(new_value) ||
|
||||||
memcmp((char *) old_value, (char *) new_value,
|
memcmp(old_value, new_value,
|
||||||
VARSIZE_EXTERNAL(old_value)) != 0)
|
VARSIZE_EXTERNAL(old_value)) != 0)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -2089,7 +2089,7 @@ AdvanceXLInsertBuffer(XLogRecPtr upto, TimeLineID tli, bool opportunistic)
|
|||||||
* Be sure to re-zero the buffer so that bytes beyond what we've
|
* Be sure to re-zero the buffer so that bytes beyond what we've
|
||||||
* written will look like zeroes and not valid XLOG records...
|
* written will look like zeroes and not valid XLOG records...
|
||||||
*/
|
*/
|
||||||
MemSet((char *) NewPage, 0, XLOG_BLCKSZ);
|
MemSet(NewPage, 0, XLOG_BLCKSZ);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill the new page's header
|
* Fill the new page's header
|
||||||
|
@ -794,7 +794,7 @@ restart:
|
|||||||
readOff = ReadPageInternal(state, targetPagePtr,
|
readOff = ReadPageInternal(state, targetPagePtr,
|
||||||
pageHeaderSize + len);
|
pageHeaderSize + len);
|
||||||
|
|
||||||
memcpy(buffer, (char *) contdata, len);
|
memcpy(buffer, contdata, len);
|
||||||
buffer += len;
|
buffer += len;
|
||||||
gotlen += len;
|
gotlen += len;
|
||||||
|
|
||||||
|
@ -463,8 +463,8 @@ boot_openrel(char *relname)
|
|||||||
{
|
{
|
||||||
if (attrtypes[i] == NULL)
|
if (attrtypes[i] == NULL)
|
||||||
attrtypes[i] = AllocateAttribute();
|
attrtypes[i] = AllocateAttribute();
|
||||||
memmove((char *) attrtypes[i],
|
memmove(attrtypes[i],
|
||||||
(char *) TupleDescAttr(boot_reldesc->rd_att, i),
|
TupleDescAttr(boot_reldesc->rd_att, i),
|
||||||
ATTRIBUTE_FIXED_PART_SIZE);
|
ATTRIBUTE_FIXED_PART_SIZE);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -641,7 +641,7 @@ secure_open_gssapi(Port *port)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(PqGSSSendBuffer, (char *) &netlen, sizeof(uint32));
|
memcpy(PqGSSSendBuffer, &netlen, sizeof(uint32));
|
||||||
PqGSSSendLength += sizeof(uint32);
|
PqGSSSendLength += sizeof(uint32);
|
||||||
|
|
||||||
memcpy(PqGSSSendBuffer + PqGSSSendLength, output.value, output.length);
|
memcpy(PqGSSSendBuffer + PqGSSSendLength, output.value, output.length);
|
||||||
|
@ -1177,9 +1177,7 @@ DecodeMultiInsert(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
|
|||||||
|
|
||||||
memset(header, 0, SizeofHeapTupleHeader);
|
memset(header, 0, SizeofHeapTupleHeader);
|
||||||
|
|
||||||
memcpy((char *) tuple->t_data + SizeofHeapTupleHeader,
|
memcpy((char *) tuple->t_data + SizeofHeapTupleHeader, data, datalen);
|
||||||
(char *) data,
|
|
||||||
datalen);
|
|
||||||
header->t_infomask = xlhdr->t_infomask;
|
header->t_infomask = xlhdr->t_infomask;
|
||||||
header->t_infomask2 = xlhdr->t_infomask2;
|
header->t_infomask2 = xlhdr->t_infomask2;
|
||||||
header->t_hoff = xlhdr->t_hoff;
|
header->t_hoff = xlhdr->t_hoff;
|
||||||
@ -1265,9 +1263,7 @@ DecodeXLogTuple(char *data, Size len, HeapTuple tuple)
|
|||||||
tuple->t_tableOid = InvalidOid;
|
tuple->t_tableOid = InvalidOid;
|
||||||
|
|
||||||
/* data is not stored aligned, copy to aligned storage */
|
/* data is not stored aligned, copy to aligned storage */
|
||||||
memcpy((char *) &xlhdr,
|
memcpy(&xlhdr, data, SizeOfHeapHeader);
|
||||||
data,
|
|
||||||
SizeOfHeapHeader);
|
|
||||||
|
|
||||||
memset(header, 0, SizeofHeapTupleHeader);
|
memset(header, 0, SizeofHeapTupleHeader);
|
||||||
|
|
||||||
|
@ -2221,7 +2221,7 @@ ExtendBufferedRelShared(BufferManagerRelation bmr,
|
|||||||
buf_block = BufHdrGetBlock(GetBufferDescriptor(buffers[i] - 1));
|
buf_block = BufHdrGetBlock(GetBufferDescriptor(buffers[i] - 1));
|
||||||
|
|
||||||
/* new buffers are zero-filled */
|
/* new buffers are zero-filled */
|
||||||
MemSet((char *) buf_block, 0, BLCKSZ);
|
MemSet(buf_block, 0, BLCKSZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -338,7 +338,7 @@ ExtendBufferedRelLocal(BufferManagerRelation bmr,
|
|||||||
buf_block = LocalBufHdrGetBlock(buf_hdr);
|
buf_block = LocalBufHdrGetBlock(buf_hdr);
|
||||||
|
|
||||||
/* new buffers are zero-filled */
|
/* new buffers are zero-filled */
|
||||||
MemSet((char *) buf_block, 0, BLCKSZ);
|
MemSet(buf_block, 0, BLCKSZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
first_block = smgrnblocks(bmr.smgr, fork);
|
first_block = smgrnblocks(bmr.smgr, fork);
|
||||||
|
@ -910,7 +910,7 @@ InitFileAccess(void)
|
|||||||
(errcode(ERRCODE_OUT_OF_MEMORY),
|
(errcode(ERRCODE_OUT_OF_MEMORY),
|
||||||
errmsg("out of memory")));
|
errmsg("out of memory")));
|
||||||
|
|
||||||
MemSet((char *) &(VfdCache[0]), 0, sizeof(Vfd));
|
MemSet(&(VfdCache[0]), 0, sizeof(Vfd));
|
||||||
VfdCache->fd = VFD_CLOSED;
|
VfdCache->fd = VFD_CLOSED;
|
||||||
|
|
||||||
SizeVfdCache = 1;
|
SizeVfdCache = 1;
|
||||||
@ -1447,7 +1447,7 @@ AllocateVfd(void)
|
|||||||
*/
|
*/
|
||||||
for (i = SizeVfdCache; i < newCacheSize; i++)
|
for (i = SizeVfdCache; i < newCacheSize; i++)
|
||||||
{
|
{
|
||||||
MemSet((char *) &(VfdCache[i]), 0, sizeof(Vfd));
|
MemSet(&(VfdCache[i]), 0, sizeof(Vfd));
|
||||||
VfdCache[i].nextFree = i + 1;
|
VfdCache[i].nextFree = i + 1;
|
||||||
VfdCache[i].fd = VFD_CLOSED;
|
VfdCache[i].fd = VFD_CLOSED;
|
||||||
}
|
}
|
||||||
|
@ -415,7 +415,7 @@ PageRestoreTempPage(Page tempPage, Page oldPage)
|
|||||||
Size pageSize;
|
Size pageSize;
|
||||||
|
|
||||||
pageSize = PageGetPageSize(tempPage);
|
pageSize = PageGetPageSize(tempPage);
|
||||||
memcpy((char *) oldPage, (char *) tempPage, pageSize);
|
memcpy(oldPage, tempPage, pageSize);
|
||||||
|
|
||||||
pfree(tempPage);
|
pfree(tempPage);
|
||||||
}
|
}
|
||||||
@ -1094,8 +1094,8 @@ PageIndexTupleDelete(Page page, OffsetNumber offnum)
|
|||||||
((char *) &phdr->pd_linp[offidx + 1] - (char *) phdr);
|
((char *) &phdr->pd_linp[offidx + 1] - (char *) phdr);
|
||||||
|
|
||||||
if (nbytes > 0)
|
if (nbytes > 0)
|
||||||
memmove((char *) &(phdr->pd_linp[offidx]),
|
memmove(&(phdr->pd_linp[offidx]),
|
||||||
(char *) &(phdr->pd_linp[offidx + 1]),
|
&(phdr->pd_linp[offidx + 1]),
|
||||||
nbytes);
|
nbytes);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1516,7 +1516,7 @@ PageSetChecksumCopy(Page page, BlockNumber blkno)
|
|||||||
PG_IO_ALIGN_SIZE,
|
PG_IO_ALIGN_SIZE,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
memcpy(pageCopy, (char *) page, BLCKSZ);
|
memcpy(pageCopy, page, BLCKSZ);
|
||||||
((PageHeader) pageCopy)->pd_checksum = pg_checksum_page(pageCopy, blkno);
|
((PageHeader) pageCopy)->pd_checksum = pg_checksum_page(pageCopy, blkno);
|
||||||
return pageCopy;
|
return pageCopy;
|
||||||
}
|
}
|
||||||
|
@ -4991,8 +4991,8 @@ ShowUsage(const char *title)
|
|||||||
|
|
||||||
getrusage(RUSAGE_SELF, &r);
|
getrusage(RUSAGE_SELF, &r);
|
||||||
gettimeofday(&elapse_t, NULL);
|
gettimeofday(&elapse_t, NULL);
|
||||||
memcpy((char *) &user, (char *) &r.ru_utime, sizeof(user));
|
memcpy(&user, &r.ru_utime, sizeof(user));
|
||||||
memcpy((char *) &sys, (char *) &r.ru_stime, sizeof(sys));
|
memcpy(&sys, &r.ru_stime, sizeof(sys));
|
||||||
if (elapse_t.tv_usec < Save_t.tv_usec)
|
if (elapse_t.tv_usec < Save_t.tv_usec)
|
||||||
{
|
{
|
||||||
elapse_t.tv_sec--;
|
elapse_t.tv_sec--;
|
||||||
|
@ -597,7 +597,7 @@ pgstat_report_activity(BackendState state, const char *cmd_str)
|
|||||||
|
|
||||||
if (cmd_str != NULL)
|
if (cmd_str != NULL)
|
||||||
{
|
{
|
||||||
memcpy((char *) beentry->st_activity_raw, cmd_str, len);
|
memcpy(beentry->st_activity_raw, cmd_str, len);
|
||||||
beentry->st_activity_raw[len] = '\0';
|
beentry->st_activity_raw[len] = '\0';
|
||||||
beentry->st_activity_start_timestamp = start_timestamp;
|
beentry->st_activity_start_timestamp = start_timestamp;
|
||||||
}
|
}
|
||||||
@ -670,7 +670,7 @@ pgstat_report_appname(const char *appname)
|
|||||||
*/
|
*/
|
||||||
PGSTAT_BEGIN_WRITE_ACTIVITY(beentry);
|
PGSTAT_BEGIN_WRITE_ACTIVITY(beentry);
|
||||||
|
|
||||||
memcpy((char *) beentry->st_appname, appname, len);
|
memcpy(beentry->st_appname, appname, len);
|
||||||
beentry->st_appname[len] = '\0';
|
beentry->st_appname[len] = '\0';
|
||||||
|
|
||||||
PGSTAT_END_WRITE_ACTIVITY(beentry);
|
PGSTAT_END_WRITE_ACTIVITY(beentry);
|
||||||
|
@ -1035,7 +1035,7 @@ ECPG_informix_reset_sqlca(void)
|
|||||||
if (sqlca == NULL)
|
if (sqlca == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
memcpy((char *) sqlca, (char *) &sqlca_init, sizeof(struct sqlca_t));
|
memcpy(sqlca, &sqlca_init, sizeof(struct sqlca_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -66,7 +66,7 @@ static FILE *debugstream = NULL;
|
|||||||
void
|
void
|
||||||
ecpg_init_sqlca(struct sqlca_t *sqlca)
|
ecpg_init_sqlca(struct sqlca_t *sqlca)
|
||||||
{
|
{
|
||||||
memcpy((char *) sqlca, (char *) &sqlca_init, sizeof(struct sqlca_t));
|
memcpy(sqlca, &sqlca_init, sizeof(struct sqlca_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -316,10 +316,10 @@ ECPGset_noind_null(enum ECPGttype type, void *ptr)
|
|||||||
*((long long *) ptr) = LONG_LONG_MIN;
|
*((long long *) ptr) = LONG_LONG_MIN;
|
||||||
break;
|
break;
|
||||||
case ECPGt_float:
|
case ECPGt_float:
|
||||||
memset((char *) ptr, 0xff, sizeof(float));
|
memset(ptr, 0xff, sizeof(float));
|
||||||
break;
|
break;
|
||||||
case ECPGt_double:
|
case ECPGt_double:
|
||||||
memset((char *) ptr, 0xff, sizeof(double));
|
memset(ptr, 0xff, sizeof(double));
|
||||||
break;
|
break;
|
||||||
case ECPGt_varchar:
|
case ECPGt_varchar:
|
||||||
*(((struct ECPGgeneric_varchar *) ptr)->arr) = 0x00;
|
*(((struct ECPGgeneric_varchar *) ptr)->arr) = 0x00;
|
||||||
@ -329,18 +329,18 @@ ECPGset_noind_null(enum ECPGttype type, void *ptr)
|
|||||||
((struct ECPGgeneric_bytea *) ptr)->len = 0;
|
((struct ECPGgeneric_bytea *) ptr)->len = 0;
|
||||||
break;
|
break;
|
||||||
case ECPGt_decimal:
|
case ECPGt_decimal:
|
||||||
memset((char *) ptr, 0, sizeof(decimal));
|
memset(ptr, 0, sizeof(decimal));
|
||||||
((decimal *) ptr)->sign = NUMERIC_NULL;
|
((decimal *) ptr)->sign = NUMERIC_NULL;
|
||||||
break;
|
break;
|
||||||
case ECPGt_numeric:
|
case ECPGt_numeric:
|
||||||
memset((char *) ptr, 0, sizeof(numeric));
|
memset(ptr, 0, sizeof(numeric));
|
||||||
((numeric *) ptr)->sign = NUMERIC_NULL;
|
((numeric *) ptr)->sign = NUMERIC_NULL;
|
||||||
break;
|
break;
|
||||||
case ECPGt_interval:
|
case ECPGt_interval:
|
||||||
memset((char *) ptr, 0xff, sizeof(interval));
|
memset(ptr, 0xff, sizeof(interval));
|
||||||
break;
|
break;
|
||||||
case ECPGt_timestamp:
|
case ECPGt_timestamp:
|
||||||
memset((char *) ptr, 0xff, sizeof(timestamp));
|
memset(ptr, 0xff, sizeof(timestamp));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -870,7 +870,7 @@ lo_initialize(PGconn *conn)
|
|||||||
libpq_append_conn_error(conn, "out of memory");
|
libpq_append_conn_error(conn, "out of memory");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
MemSet((char *) lobjfuncs, 0, sizeof(PGlobjfuncs));
|
MemSet(lobjfuncs, 0, sizeof(PGlobjfuncs));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Execute the query to get all the functions at once. (Not all of them
|
* Execute the query to get all the functions at once. (Not all of them
|
||||||
|
@ -698,7 +698,7 @@ pqsecure_open_gss(PGconn *conn)
|
|||||||
/* Queue the token for writing */
|
/* Queue the token for writing */
|
||||||
netlen = pg_hton32(output.length);
|
netlen = pg_hton32(output.length);
|
||||||
|
|
||||||
memcpy(PqGSSSendBuffer, (char *) &netlen, sizeof(uint32));
|
memcpy(PqGSSSendBuffer, &netlen, sizeof(uint32));
|
||||||
PqGSSSendLength += sizeof(uint32);
|
PqGSSSendLength += sizeof(uint32);
|
||||||
|
|
||||||
memcpy(PqGSSSendBuffer + PqGSSSendLength, output.value, output.length);
|
memcpy(PqGSSSendBuffer + PqGSSSendLength, output.value, output.length);
|
||||||
|
Reference in New Issue
Block a user