On Thu, Jan 25, 2007 at 08:56:27PM +0100, Magnus Hagander wrote:
> Bruce Momjian wrote:
> > I need an updated version of this to apply.  The suggested changes are
> > too extensive.
> 
> 
> I'll try to do this tomorrow. If I get it right, the changes needed are:
> NULL instead of cast of function ptr, per Peter.
> Do the const-change in the other direction in contrib/intarray.
> 
> The patch never contained anything for those const ** warnings, so I'll
> just continue not to include those.
> 

Ok, here's an updated patch per this.

//Magnus

Index: contrib/intarray/_int.h
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/intarray/_int.h,v
retrieving revision 1.11
diff -c -r1.11 _int.h
*** contrib/intarray/_int.h     4 Oct 2006 00:29:45 -0000       1.11
--- contrib/intarray/_int.h     26 Jan 2007 11:48:20 -0000
***************
*** 108,114 ****
  /*
  ** useful function
  */
! bool          isort(int4 *a, const int len);
  ArrayType  *new_intArrayType(int num);
  ArrayType  *copy_intArrayType(ArrayType *a);
  ArrayType  *resize_intArrayType(ArrayType *a, int num);
--- 108,114 ----
  /*
  ** useful function
  */
! bool          isort(int4 *a, int len);
  ArrayType  *new_intArrayType(int num);
  ArrayType  *copy_intArrayType(ArrayType *a);
  ArrayType  *resize_intArrayType(ArrayType *a, int num);
Index: contrib/pg_trgm/trgm_op.c
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/pg_trgm/trgm_op.c,v
retrieving revision 1.5
diff -c -r1.5 trgm_op.c
*** contrib/pg_trgm/trgm_op.c   30 May 2006 22:12:13 -0000      1.5
--- contrib/pg_trgm/trgm_op.c   25 Jan 2007 12:18:05 -0000
***************
*** 5,11 ****
  
  PG_MODULE_MAGIC;
  
! float4                trgm_limit = 0.3;
  
  PG_FUNCTION_INFO_V1(set_limit);
  Datum         set_limit(PG_FUNCTION_ARGS);
--- 5,11 ----
  
  PG_MODULE_MAGIC;
  
! float4                trgm_limit = 0.3f;
  
  PG_FUNCTION_INFO_V1(set_limit);
  Datum         set_limit(PG_FUNCTION_ARGS);
Index: contrib/tsearch2/rank.c
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/tsearch2/rank.c,v
retrieving revision 1.21
diff -c -r1.21 rank.c
*** contrib/tsearch2/rank.c     28 Dec 2006 01:09:01 -0000      1.21
--- contrib/tsearch2/rank.c     25 Jan 2007 12:19:30 -0000
***************
*** 37,43 ****
  PG_FUNCTION_INFO_V1(get_covers);
  Datum         get_covers(PG_FUNCTION_ARGS);
  
! static float weights[] = {0.1, 0.2, 0.4, 1.0};
  
  #define wpos(wep)     ( w[ WEP_GETWEIGHT(wep) ] )
  
--- 37,43 ----
  PG_FUNCTION_INFO_V1(get_covers);
  Datum         get_covers(PG_FUNCTION_ARGS);
  
! static float weights[] = {0.1f, 0.2f, 0.4f, 1.0f};
  
  #define wpos(wep)     ( w[ WEP_GETWEIGHT(wep) ] )
  
***************
*** 59,65 ****
  word_distance(int4 w)
  {
        if (w > 100)
!               return 1e-30;
  
        return 1.0 / (1.005 + 0.05 * exp(((float4) w) / 1.5 - 2));
  }
--- 59,65 ----
  word_distance(int4 w)
  {
        if (w > 100)
!               return (float4)1e-30;
  
        return 1.0 / (1.005 + 0.05 * exp(((float4) w) / 1.5 - 2));
  }
***************
*** 331,337 ****
                calc_rank_and(w, t, q) : calc_rank_or(w, t, q);
  
        if (res < 0)
!               res = 1e-20;
  
        if ((method & RANK_NORM_LOGLENGTH) && t->size > 0)
                res /= log((double) (cnt_length(t) + 1)) / log(2.0);
--- 331,337 ----
                calc_rank_and(w, t, q) : calc_rank_or(w, t, q);
  
        if (res < 0)
!               res = (float)1e-20;

        if ((method & RANK_NORM_LOGLENGTH) && t->size > 0)
                res /= log((double) (cnt_length(t) + 1)) / log(2.0);
Index: src/include/pg_config.h.win32
===================================================================
RCS file: /projects/cvsroot/pgsql/src/include/pg_config.h.win32,v
retrieving revision 1.39
diff -c -r1.39 pg_config.h.win32
*** src/include/pg_config.h.win32       5 Jan 2007 20:54:39 -0000       1.39
--- src/include/pg_config.h.win32       25 Jan 2007 13:10:02 -0000
***************
*** 366,372 ****
--- 366,374 ----
  #define HAVE_STRDUP 1

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

  /* Define to 1 if you have the `strerror_r' function. */
  /* #undef HAVE_STRERROR_R */
Index: src/interfaces/libpq/fe-secure.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v
retrieving revision 1.90
diff -c -r1.90 fe-secure.c
*** src/interfaces/libpq/fe-secure.c    5 Jan 2007 22:20:01 -0000       1.90
--- src/interfaces/libpq/fe-secure.c    25 Jan 2007 14:39:23 -0000
***************
*** 575,581 ****
        char            fnbuf[MAXPGPATH];
        FILE       *fp;
        PGconn     *conn = (PGconn *) SSL_get_app_data(ssl);
-       int                     (*cb) () = NULL;        /* how to read user 
password */
        char            sebuf[256];

        if (!pqGetHomeDirectory(homedir, sizeof(homedir)))
--- 575,580 ----
***************
*** 642,648 ****
                return 0;
        }
  #endif
!       if (PEM_read_PrivateKey(fp, pkey, cb, NULL) == NULL)
        {
                char       *err = SSLerrmessage();

--- 641,647 ----
                return 0;
        }
  #endif
!       if (PEM_read_PrivateKey(fp, pkey, NULL, NULL) == NULL)
        {
                char       *err = SSLerrmessage();

Index: src/interfaces/libpq/libpq-int.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/interfaces/libpq/libpq-int.h,v
retrieving revision 1.117
diff -c -r1.117 libpq-int.h
*** src/interfaces/libpq/libpq-int.h    5 Jan 2007 22:20:01 -0000       1.117
--- src/interfaces/libpq/libpq-int.h    25 Jan 2007 12:12:57 -0000
***************
*** 38,48 ****
  #include <signal.h>
  #endif

- #ifdef WIN32_ONLY_COMPILER
- typedef int ssize_t;                  /* ssize_t doesn't exist in VC (at 
least not
-                                                                * VC6) */
- #endif
-
  /* include stuff common to fe and be */
  #include "getaddrinfo.h"
  #include "libpq/pqcomm.h"
--- 38,43 ----
Index: src/timezone/ialloc.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/timezone/ialloc.c,v
retrieving revision 1.7
diff -c -r1.7 ialloc.c
*** src/timezone/ialloc.c       15 Oct 2005 02:49:51 -0000      1.7
--- src/timezone/ialloc.c       25 Jan 2007 12:26:43 -0000
***************
*** 14,20 ****
  #define nonzero(n)    (((n) == 0) ? 1 : (n))

  char *
! imalloc(const int n)
  {
        return malloc((size_t) nonzero(n));
  }
--- 14,20 ----
  #define nonzero(n)    (((n) == 0) ? 1 : (n))

  char *
! imalloc(int n)
  {
        return malloc((size_t) nonzero(n));
  }
***************
*** 28,34 ****
  }

  void *
! irealloc(void *pointer, const int size)
  {
        if (pointer == NULL)
                return imalloc(size);
--- 28,34 ----
  }

  void *
! irealloc(void *pointer, int size)
  {
        if (pointer == NULL)
                return imalloc(size);
Index: src/timezone/zic.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/timezone/zic.c,v
retrieving revision 1.19
diff -c -r1.19 zic.c
*** src/timezone/zic.c  24 Oct 2006 15:11:03 -0000      1.19
--- src/timezone/zic.c  25 Jan 2007 12:20:42 -0000
***************
*** 104,113 ****
  };

  extern int    link(const char *fromname, const char *toname);
! static void addtt(pg_time_t starttime, int type);
  static int addtype(long gmtoff, const char *abbr, int isdst,
                int ttisstd, int ttisgmt);
! static void leapadd(pg_time_t t, int positive, int rolling, int count);
  static void adjleap(void);
  static void associate(void);
  static int    ciequal(const char *ap, const char *bp);
--- 104,113 ----
  };

  extern int    link(const char *fromname, const char *toname);
! static void addtt(const pg_time_t starttime, int type);
  static int addtype(long gmtoff, const char *abbr, int isdst,
                int ttisstd, int ttisgmt);
! static void leapadd(const pg_time_t t, int positive, int rolling, int count);
  static void adjleap(void);
  static void associate(void);
  static int    ciequal(const char *ap, const char *bp);
***************
*** 146,152 ****
                const char *typep, const char *monthp,
                const char *dayp, const char *timep);
  static void setboundaries(void);
! static pg_time_t tadd(pg_time_t t1, long t2);
  static void usage(void);
  static void writezone(const char *name);
  static int    yearistype(int year, const char *type);
--- 146,152 ----
                const char *typep, const char *monthp,
                const char *dayp, const char *timep);
  static void setboundaries(void);
! static pg_time_t tadd(const pg_time_t t1, long t2);
  static void usage(void);
  static void writezone(const char *name);
  static int    yearistype(int year, const char *type);
Index: src/tools/msvc/Project.pm
===================================================================
RCS file: /projects/cvsroot/pgsql/src/tools/msvc/Project.pm,v
retrieving revision 1.7
diff -c -r1.7 Project.pm
*** src/tools/msvc/Project.pm   24 Jan 2007 19:24:28 -0000      1.7
--- src/tools/msvc/Project.pm   25 Jan 2007 13:32:08 -0000
***************
*** 23,29 ****
          includes        => '',
          defines         => ';',
                solution        => $solution,
!         disablewarnings => '4018;4244;4273',
      };

        bless $self;
--- 23,30 ----
          includes        => '',
          defines         => ';',
                solution        => $solution,
!         disablewarnings => '4018;4244;4273;4102',
!         disablelinkerwarnings => ''
      };

        bless $self;
***************
*** 242,247 ****
--- 243,255 ----
        $self->AddFile("$dir\\win32ver.rc");
  }

+ sub DisableLinkerWarnings {
+    my ($self, $warnings) = @_;
+
+    $self->{disablelinkerwarnings} .= ';' unless 
($self->{disablelinkerwarnings} eq '');
+    $self->{disablelinkerwarnings} .= $warnings;
+ }
+
  sub Save {
        my ($self) = @_;

***************
*** 390,395 ****
--- 398,406 ----
                GenerateMapFile="FALSE" 
MapFileName=".\\$cfgname\\$self->{name}\\$self->{name}.map"
                SubSystem="1" TargetMachine="1"
  EOF
+    if ($self->{disablelinkerwarnings}) {
+       print $f 
"\t\tAdditionalOptions=\"/ignore:$self->{disablelinkerwarnings}\"\n";
+    }
        if ($self->{implib}) {
                my $l = $self->{implib};
                $l =~ s/__CFGNAME__/$cfgname/g;
Index: src/tools/msvc/mkvcbuild.pl
===================================================================
RCS file: /projects/cvsroot/pgsql/src/tools/msvc/mkvcbuild.pl,v
retrieving revision 1.11
diff -c -r1.11 mkvcbuild.pl
*** src/tools/msvc/mkvcbuild.pl 24 Jan 2007 19:24:28 -0000      1.11
--- src/tools/msvc/mkvcbuild.pl 25 Jan 2007 13:31:27 -0000
***************
*** 135,140 ****
--- 135,141 ----
  $pgevent->AddResourceFile('src\bin\pgevent','Eventlog message formatter');
  $pgevent->RemoveFile('src\bin\pgevent\win32ver.rc');
  $pgevent->UseDef('src\bin\pgevent\pgevent.def');
+ $pgevent->DisableLinkerWarnings('4104');

  my $psql = AddSimpleFrontend('psql', 1);
  $psql->AddIncludeDir('src\bin\pg_dump');
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate

Reply via email to