[Bf-committers] gcc 3.4.1 released, blender still wont compile.

Ton Roosendaal bf-committers@blender.org
Sun, 4 Jul 2004 10:24:38 +0200


Hi,

The strpbrk() function returns a char pointer (offset from *cpa). Maybe  
that function is not in the headers or has a different definition?
Or is it gcc 3.4 that doesnt allow pointer subtraction ?

-Ton-

On Sunday, Jul 4, 2004, at 08:27 Europe/Amsterdam, Campbell Barton  
wrote:

> Hi, gcc 3.4 was relesed a while ago and was supposed to have some good  
> improvements.
> It had a but when compiling inline ASM for MMX (had to disable mmx  
> o0ptizimations for the gimp and cinelerra) but blender wouldent  
> compile.
>
> 3.4.1 has been released and compiles the gimp no problems but blender  
> still raises errors.
>
> gcc 3.4.1 msg
> source/blender/blenkernel/intern/exotic.c:1196: error: invalid  
> operands to binary -the line
>
> *i= (long)(strpbrk(cpa, ", \n")-cpa);  *
>
>
> see below for an extract.
>
> static int iv_finddata(struct IvNode *iv, char *field, int fieldnr)
> {
>    /* search for "field", count data size and make datablock. return  
> skipdata */
>    float *fp;
>    int len, stackcount, skipdata=0;
>    char *cpa, terminator, str[64];
>    long i;
>      len= strlen(field);
>
>    cpa= iv->nodename+1;
>    while( *cpa != '}' ) {
>              if( *cpa == *field ) {
>            if( strncmp(cpa, field, len)==0 ) {
>                iv->fieldname[fieldnr]= cpa;
>                              /* read until first character */
>                cpa+= len;
>                skipdata+= len;
>                *cpa= 0;
>                cpa++;
>                skipdata++;
>                              while( *cpa==32 || *cpa==13 || *cpa==10  
> || *cpa==9) cpa++;
>                if( *cpa=='[' ) {
>                    terminator= ']';
>                    cpa++;
>                    skipdata++;
>                }
>                else terminator= 13;
>                              stackcount= 0;
>                fp= iv_data_stack;
>                              while( *cpa!=terminator && *cpa != '}' ) {
>                                      /* in fact, isdigit should  
> include the dot and minus */
>                    if( (isdigit(*cpa) || *cpa=='.' || *cpa=='-') &&  
> (isspace(cpa[-1]) || cpa[-1]==0 || cpa[-1]==',') ) {
>                        if(cpa[1]=='x') {
>                            memcpy(str, cpa, 16);
>                            str[16]= 0;
>                                                      sscanf(str, "%x",  
> (int *)fp);
>                        }
>                        else {
>                            /* atof doesn't stop after the first float
>                             * in a long string at Windows... so we copy
>                             * the float to a new string then atof... */
>                                                        *i=  
> (long)(strpbrk(cpa, ", \n")-cpa);*
>                                                      if (i>63) *fp=  
> 0.0;
>                            else {
>                                memcpy(str, cpa, i);
>                                str[i]=0;
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton@blender.org  
http://www.blender.org