Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

AutoVersioning Plugin

<< < (7/41) > >>

mp:

--- Quote from: JGM on July 08, 2007, 06:51:23 pm ---I got to update the events handling on the plugin because that methods are deprecated in the new codeblocks revision.

What operating system are you using? A compiled version depends on the actual version of codeblocks that you are using and and the wxWidgets library to work.

Is weird that error on the Tiny Xml Class. I don't got that error, may be you are using an old version or newer than I have. I will check this.

If you can provide the actual revision of codeblocks that you are using will be of help to diagnostic the problem. :D

--- End quote ---

Windows XP SP2, C::B Nightly Build form 06 July 07 , wxWidgets 2.8.4. MinGW 5.1.3

The-Kenny:
I get the same error every Time I try to compile the Plugin:
Windows XP Home, C::B Nightly Build rev4235 (The same as mp), wxWidgets 2.8.4, minGW 5.1.3.

JGM:

--- Quote from: killerbot on July 08, 2007, 08:33:16 pm ---Some advice to the code of avSvnRevision.h

--- End quote ---

Followed almost all your suggestions  :)


--- Quote from: killerbot on July 08, 2007, 08:33:16 pm ---Things that can be removed from this file are :
  - the include of wx.h [you don't use anything from wxwidgets in this code, aside use the headers with the things you actually use from wx, don't just include a monster of a header file]

--- End quote ---

I was testing and going to convert that function from standard c++ to wxWidgets and forgot to remove that header and also the defines, thanks for the fact  :D


--- Quote from: killerbot on July 08, 2007, 08:33:16 pm ---  - remove the macro (by the way don't use macros, they are f*** BAD, use a function, a template, ...], but in this case the macro is not used

--- End quote ---

Meennn you really hate #defines  :shock:


--- Quote from: killerbot on July 08, 2007, 08:33:16 pm ---Other suggestions :
  - be const correct and scope limiting : your TinyXmlElement's are const --> put that in the code, and limit their scope, also make use of handle, it will simplify your code

--- Code: ---  TiXmlHandle Handle(&doc);
  if(const TiXmlElement* e =  Handle.FirstChildElement("entry").FirstChildElement("commit").ToElement())
  {
    revision = e->Attribute("revision") ? e->Attribute("revision") : "";
    const TiXmlElement *d = e->FirstChildElement("date");
    if(d && d->GetText())
    {
                date = d->GetText();
    }
  }

--- End code ---

  - don't use memset when it is not needed, you can easily replace :

--- Code: ---        char buf[16384];
        memset(buf, 0, 16384);

--- End code ---
by :

--- Code: ---        char buf[16384] = {'\0'};

--- End code ---
  - try to avoid magic numbers like '16384' and '16384' and '16383, for sure they are all related, but are they ..., put that magic number in a const variable (no define !!!)


I hope you find these tips and code corrections useful. I didn't look at the other source files, I just took a peek for this one wrt compile problem.
Cheers.

--- End quote ---

I just took the code from the codeblocks source code /build_tools/autorevision.cpp and not make any big modifications, but they are now done.

Well at last, updated the source code, everybody can find it in the first post :P

JGM:

--- Quote from: mp on July 09, 2007, 12:58:58 am ---Windows XP SP2, C::B Nightly Build form 06 July 07 , wxWidgets 2.8.4. MinGW 5.1.3

--- End quote ---

Uploaded a compiled version, you can check if it works with your configuration (link in the first post)

JGM:
Man the version.h was compiling find but now it gave me an error while compiling my current project.

The error was declaring the dates variables date and month as long like this:
        static long DATE_VERSION = 09; //Declaration incorrect by the zero
   static long MONTH_VERSION = 07; //The same here

So updated the output to this:

--- Code: ---namespace AutoVersion{

//Date Version Types
static char DATE[] = "09";
static char MONTH[] = "07";
static char YEAR[] = "2007";
static double UBUNTU_VERSION_STYLE = 7.07;

//Standard Version Types
static long MAJOR = 1;
static long MINOR = 1;
static long BUILD = 118;
static long REVISION = 1067;

//Miscellaneous Version Types
static long BUILDS_COUNT = 212;
#define RC_FILEVERSION 1,1,118,1067
#define RC_FILEVERSION_STRING "1, 1, 118, 1067\0"
static char FULLVERSION_STRING[] = "1.1.118.1067";

}

--- End code ---

As you can see I also shortened the variables names, because while using the plugin noted the unnecessary long names :oops:

So updated source code in the first post as compiled version for windows. And sorry for so many mistakes

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version