Stupid me! I was calling the subversion warning test *after* memory got

freed. Windows nicely crashes then.

Also: added human readable string in fileglobal, so you can check the
subversion in a file manually too. Rule:
- Find GLOB chunk (first chunk after REND now)
- skip sizeof BHead, 20 bytes in 32bits, or 24 in 64 bits
- there's 4 characters showing subversion, right now it reads "   1".
This commit is contained in:
Ton Roosendaal
2006-11-27 10:43:00 +00:00
parent d7750932c4
commit d7addfb99a
3 changed files with 11 additions and 9 deletions

View File

@@ -451,7 +451,7 @@ int BKE_read_file(char *dir, void *type_r)
setup_app_data(bfd, dir); setup_app_data(bfd, dir);
handle_subversion_warning(bfd->main); handle_subversion_warning(G.main);
} }
else { else {
error("Loading %s failed: %s", dir, BLO_bre_as_string(bre)); error("Loading %s failed: %s", dir, BLO_bre_as_string(bre));

View File

@@ -1837,17 +1837,19 @@ static void write_brushes(WriteData *wd, ListBase *idbase)
static void write_global(WriteData *wd) static void write_global(WriteData *wd)
{ {
FileGlobal fg; FileGlobal fg;
fg.curscreen= G.curscreen; fg.curscreen= G.curscreen;
fg.curscene= G.scene; fg.curscene= G.scene;
fg.displaymode= G.displaymode; fg.displaymode= G.displaymode;
fg.winpos= G.winpos; fg.winpos= G.winpos;
fg.fileflags= (G.fileflags & ~G_FILE_NO_UI); // prevent to save this, is not good convention, and feature with concerns... fg.fileflags= (G.fileflags & ~G_FILE_NO_UI); // prevent to save this, is not good convention, and feature with concerns...
fg.globalf= G.f; fg.globalf= G.f;
/* note, this will print byte nr 5, but that's corrected */
sprintf(fg.subvstr, "%4d", BLENDER_SUBVERSION);
fg.subversion= BLENDER_SUBVERSION; fg.subversion= BLENDER_SUBVERSION;
fg.minversion= BLENDER_MINVERSION; fg.minversion= BLENDER_MINVERSION;
fg.minsubversion= BLENDER_MINSUBVERSION; fg.minsubversion= BLENDER_MINSUBVERSION;
writestruct(wd, GLOB, "FileGlobal", 1, &fg); writestruct(wd, GLOB, "FileGlobal", 1, &fg);
} }

View File

@@ -39,14 +39,14 @@
* the moment of saving, and the file-specific settings. * the moment of saving, and the file-specific settings.
*/ */
typedef struct FileGlobal { typedef struct FileGlobal {
void *curscreen; char subvstr[4]; /* needs to be here, for human fileformat recognition */
void *curscene;
short displaymode, winpos;
int fileflags;
int globalf;
int pad;
short subversion, pads; short subversion, pads;
short minversion, minsubversion; short minversion, minsubversion;
short displaymode, winpos;
void *curscreen;
void *curscene;
int fileflags;
int globalf;
} FileGlobal; } FileGlobal;