Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8ff2bcc

Browse files
author
Neil Conway
committed
Squelch some VC++ compiler warnings. Mark float literals with the "f"
suffix, to distinguish them from doubles. Make some function declarationsand definitions use the "const" qualifier for arguments consistently.Ignore warning 4102 ("unreferenced label"), because such warningsare always emitted by bison-generated code. Patch from Magnus Hagander.
1 parent8924c56 commit8ff2bcc

File tree

10 files changed

+30
-22
lines changed

10 files changed

+30
-22
lines changed

‎contrib/intarray/_int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ typedef void (*formfloat) (ArrayType *, float *);
108108
/*
109109
** useful function
110110
*/
111-
boolisort(int4*a,constintlen);
111+
boolisort(int4*a,intlen);
112112
ArrayType*new_intArrayType(intnum);
113113
ArrayType*copy_intArrayType(ArrayType*a);
114114
ArrayType*resize_intArrayType(ArrayType*a,intnum);

‎contrib/pg_trgm/trgm_op.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
PG_MODULE_MAGIC;
77

8-
float4trgm_limit=0.3;
8+
float4trgm_limit=0.3f;
99

1010
PG_FUNCTION_INFO_V1(set_limit);
1111
Datumset_limit(PG_FUNCTION_ARGS);

‎contrib/tsearch2/rank.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Datumrank_cd_def(PG_FUNCTION_ARGS);
3737
PG_FUNCTION_INFO_V1(get_covers);
3838
Datumget_covers(PG_FUNCTION_ARGS);
3939

40-
staticfloatweights[]= {0.1,0.2,0.4,1.0};
40+
staticfloatweights[]= {0.1f,0.2f,0.4f,1.0f};
4141

4242
#definewpos(wep)( w[ WEP_GETWEIGHT(wep) ] )
4343

@@ -59,7 +59,7 @@ static float4
5959
word_distance(int4w)
6060
{
6161
if (w>100)
62-
return1e-30;
62+
return(float4)1e-30;
6363

6464
return1.0 / (1.005+0.05*exp(((float4)w) /1.5-2));
6565
}
@@ -331,7 +331,7 @@ calc_rank(float *w, tsvector * t, QUERYTYPE * q, int4 method)
331331
calc_rank_and(w,t,q) :calc_rank_or(w,t,q);
332332

333333
if (res<0)
334-
res=1e-20;
334+
res=(float)1e-20;
335335

336336
if ((method&RANK_NORM_LOGLENGTH)&&t->size>0)
337337
res /=log((double) (cnt_length(t)+1)) /log(2.0);

‎src/include/pg_config.h.win32

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,9 @@
366366
#define HAVE_STRDUP 1
367367

368368
/* Define to 1 if you have the `strerror' function. */
369+
#ifndef HAVE_STRERROR
369370
#define HAVE_STRERROR 1
371+
#endif
370372

371373
/* Define to 1 if you have the `strerror_r' function. */
372374
/* #undef HAVE_STRERROR_R */

‎src/interfaces/libpq/fe-secure.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.90 2007/01/05 22:20:01 momjian Exp $
14+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.91 2007/01/26 17:45:41 neilc Exp $
1515
*
1616
* NOTES
1717
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
@@ -575,7 +575,6 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
575575
charfnbuf[MAXPGPATH];
576576
FILE*fp;
577577
PGconn*conn= (PGconn*)SSL_get_app_data(ssl);
578-
int(*cb) ()=NULL;/* how to read user password */
579578
charsebuf[256];
580579

581580
if (!pqGetHomeDirectory(homedir,sizeof(homedir)))
@@ -642,7 +641,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
642641
return0;
643642
}
644643
#endif
645-
if (PEM_read_PrivateKey(fp,pkey,cb,NULL)==NULL)
644+
if (PEM_read_PrivateKey(fp,pkey,NULL,NULL)==NULL)
646645
{
647646
char*err=SSLerrmessage();
648647

‎src/interfaces/libpq/libpq-int.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.117 2007/01/05 22:20:01 momjian Exp $
15+
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.118 2007/01/26 17:45:41 neilc Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -38,11 +38,6 @@
3838
#include<signal.h>
3939
#endif
4040

41-
#ifdefWIN32_ONLY_COMPILER
42-
typedefintssize_t;/* ssize_t doesn't exist in VC (at least not
43-
* VC6) */
44-
#endif
45-
4641
/* include stuff common to fe and be */
4742
#include"getaddrinfo.h"
4843
#include"libpq/pqcomm.h"

‎src/timezone/ialloc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/timezone/ialloc.c,v 1.7 2005/10/15 02:49:51 momjian Exp $
6+
* $PostgreSQL: pgsql/src/timezone/ialloc.c,v 1.8 2007/01/26 17:45:42 neilc Exp $
77
*/
88

99
#include"postgres.h"
@@ -14,7 +14,7 @@
1414
#definenonzero(n)(((n) == 0) ? 1 : (n))
1515

1616
char*
17-
imalloc(constintn)
17+
imalloc(intn)
1818
{
1919
returnmalloc((size_t)nonzero(n));
2020
}
@@ -28,7 +28,7 @@ icalloc(int nelem, int elsize)
2828
}
2929

3030
void*
31-
irealloc(void*pointer,constintsize)
31+
irealloc(void*pointer,intsize)
3232
{
3333
if (pointer==NULL)
3434
returnimalloc(size);

‎src/timezone/zic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/timezone/zic.c,v 1.19 2006/10/24 15:11:03 tgl Exp $
6+
* $PostgreSQL: pgsql/src/timezone/zic.c,v 1.20 2007/01/26 17:45:42 neilc Exp $
77
*/
88

99
#include"postgres.h"
@@ -104,10 +104,10 @@ struct zone
104104
};
105105

106106
externintlink(constchar*fromname,constchar*toname);
107-
staticvoidaddtt(pg_time_tstarttime,inttype);
107+
staticvoidaddtt(constpg_time_tstarttime,inttype);
108108
staticintaddtype(longgmtoff,constchar*abbr,intisdst,
109109
intttisstd,intttisgmt);
110-
staticvoidleapadd(pg_time_tt,intpositive,introlling,intcount);
110+
staticvoidleapadd(constpg_time_tt,intpositive,introlling,intcount);
111111
staticvoidadjleap(void);
112112
staticvoidassociate(void);
113113
staticintciequal(constchar*ap,constchar*bp);
@@ -146,7 +146,7 @@ static void rulesub(struct rule * rp,
146146
constchar*typep,constchar*monthp,
147147
constchar*dayp,constchar*timep);
148148
staticvoidsetboundaries(void);
149-
staticpg_time_ttadd(pg_time_tt1,longt2);
149+
staticpg_time_ttadd(constpg_time_tt1,longt2);
150150
staticvoidusage(void);
151151
staticvoidwritezone(constchar*name);
152152
staticintyearistype(intyear,constchar*type);

‎src/tools/msvc/Project.pm

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ sub new {
2323
includes=>'',
2424
defines=>';',
2525
solution=>$solution,
26-
disablewarnings=>'4018;4244;4273',
26+
disablewarnings=>'4018;4244;4273;4102',
27+
disablelinkerwarnings=>''
2728
};
2829

2930
bless$self;
@@ -242,6 +243,13 @@ sub AddResourceFile {
242243
$self->AddFile("$dir\\win32ver.rc");
243244
}
244245

246+
subDisableLinkerWarnings {
247+
my ($self,$warnings) =@_;
248+
249+
$self->{disablelinkerwarnings} .=';'unless ($self->{disablelinkerwarnings}eq'');
250+
$self->{disablelinkerwarnings} .=$warnings;
251+
}
252+
245253
subSave {
246254
my ($self) =@_;
247255

@@ -390,6 +398,9 @@ EOF
390398
GenerateMapFile="FALSE" MapFileName=".\\$cfgname\\$self->{name}\\$self->{name}.map"
391399
SubSystem="1" TargetMachine="1"
392400
EOF
401+
if ($self->{disablelinkerwarnings}) {
402+
print$f"\t\tAdditionalOptions=\"/ignore:$self->{disablelinkerwarnings}\"\n";
403+
}
393404
if ($self->{implib}) {
394405
my$l =$self->{implib};
395406
$l =~s/__CFGNAME__/$cfgname/g;

‎src/tools/msvc/mkvcbuild.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
$pgevent->AddResourceFile('src\bin\pgevent','Eventlog message formatter');
136136
$pgevent->RemoveFile('src\bin\pgevent\win32ver.rc');
137137
$pgevent->UseDef('src\bin\pgevent\pgevent.def');
138+
$pgevent->DisableLinkerWarnings('4104');
138139

139140
my$psql = AddSimpleFrontend('psql', 1);
140141
$psql->AddIncludeDir('src\bin\pg_dump');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp