User forums > Using Code::Blocks

Code formatter

(1/2) > >>

Icek:
Hi, i use CB on linux (ubuntu 6.10 and/or 7.04), but i have problem with Astyle source formatter. After formatting my code looks like this :


--- Code: ---bool CVERTEX3F::operator==(const CVERTEX3F druhy)const
{
 if ( this->x == druhy.x  &&
         this->y == druhy.y  &&
         this->z == druhy.z  )
 return true;
 else
     return false;
     
    }
   
    bool CVERTEX3F::operator!=(const CVERTEX3F druhy)const
        {
         if ( this->x != druhy.x  ||
                 this->y != druhy.y  ||
                 this->z != druhy.z  )
         return true;
         else
             return false ;
            }
           
           
            float CVERTEX3F::GetMax()
                {
                 if (this->x > this->y)
                 {
                  if (this->x > this->z)
                      {
                       return this->x;
                      }
                      return this->z;
                     }
                     
                     if (this->y > this->z)
                         {
                          return this->y;
                         }
                         
                         return this->z;
                        }
--- End code ---
}

when i do the same on windows, it works fine...

Ceniza:
Just took your code and processed it through Source Formatter using different styles and it produces the right output.

Code::Blocks 3887 on Gentoo.

Icek:
i have tried all of them, but no one worked right...

Ceniza:
Create a new empty file, copy the wrongly formatted text of your post and paste it in that new file, now use the Source Formatter plugin. That's what I did and it worked that way.

Maybe a problem with new lines? (Just guessing)

Icek:
hm, it works... but i have this problem with all files in my project... that isnt solution... couldnt be problem in ubuntu? why it works on win and on lin didnt ? with the same code...

Navigation

[0] Message Index

[#] Next page

Go to full version