Menu

#8 gcc-3.0 patch

open
nobody
None
5
2001-09-15
2001-09-15
Joey Smith
No

I have found that the following is requireed to compile
with gcc 3.0. Also attached as a text file (unix line
ends, UTF-8).

diff -ru dbdesigner/dbdesign/fldcolors.cpp
dbdesigner.orig/dbdesign/fldcolors.cpp
--- dbdesigner/dbdesign/fldcolors.cpp Wed Jun 13
14:27:17 2001
+++ dbdesigner.orig/dbdesign/fldcolors.cpp Sat
Sep 15 12:17:41 2001
@@ -20,12 +20,12 @@
#include <stdlib.h>

QColor fldcolors(int idx){
- srandom(idx+1);
- int r = (int)(255.0*random()/(RAND_MAX+1.0));
- random();
- int g = (int)(255.0*random()/(RAND_MAX+1.0));
- random();
- int b = (int)(255.0*random()/(RAND_MAX+1.0));
+ std::srand(idx+1);
+ int r = (int)(255.0*std::rand()/
(RAND_MAX+1.0));
+ std::rand();
+ int g = (int)(255.0*std::rand()/
(RAND_MAX+1.0));
+ std::rand();
+ int b = (int)(255.0*std::rand()/
(RAND_MAX+1.0));

//cerr << r << "," << g << "," << b <<endl;

diff -ru dbdesigner/dbdesign/fldcolors.h
dbdesigner.orig/dbdesign/fldcolors.h
--- dbdesigner/dbdesign/fldcolors.h Wed Jun 13
14:27:17 2001
+++ dbdesigner.orig/dbdesign/fldcolors.h Sat
Sep 15 12:13:23 2001
@@ -18,6 +18,7 @@
#define FLDCOLORS_H

#include <qcolor.h>
+#include <stdlib.h>

QColor fldcolors(int idx);

Discussion

  • Nobody/Anonymous

    Logged In: NO

    This gets it to compile, but I've only managed to link with
    gcc-2.x

     
  • rodito79

    rodito79 - 2005-11-10

    Logged In: YES
    user_id=1376638

    I don't understand how this patches work??? Can u help me
    please.

     

Log in to post a comment.