Revision: 42450
http://brlcad.svn.sourceforge.net/brlcad/?rev=42450&view=rev
Author: brlcad
Date: 2011-01-19 16:10:48 +0000 (Wed, 19 Jan 2011)
Log Message:
-----------
get the version number just once, then reference it
Modified Paths:
--------------
brlcad/trunk/src/conv/dbupgrade.c
Modified: brlcad/trunk/src/conv/dbupgrade.c
===================================================================
--- brlcad/trunk/src/conv/dbupgrade.c 2011-01-19 15:44:45 UTC (rev 42449)
+++ brlcad/trunk/src/conv/dbupgrade.c 2011-01-19 16:10:48 UTC (rev 42450)
@@ -59,6 +59,7 @@
int in_arg=1;
int out_arg=2;
long errors = 0, skipped = 0;
+ int version;
name[16] = '\0';
/* this tolerance structure is only used for converting polysolids to BOT's
@@ -120,18 +121,19 @@
}
+ version = db_version(dbip);
if ( !reverse ) {
- if ( db_version(dbip) == 5 ) {
+ if ( version == 5 ) {
bu_log( "This database (%s) is already at the current version\n",
argv[in_arg] );
return 5;
}
- if ( db_version(dbip) != 4 ) {
+ if ( version != 4 ) {
bu_log( "Input database version not recognized!!!!\n" );
return 4;
}
} else if ( reverse ) {
- if ( db_version(dbip) != 5 ) {
+ if ( version != 5 ) {
bu_log( "Can only revert from db version 5\n" );
return 6;
}
@@ -142,7 +144,7 @@
if ( db_dirbuild( dbip ) )
bu_exit(1, "db_dirbuild failed\n" );
- if ( (BU_STR_EQUAL( dbip->dbi_title, "Untitled v4 BRL-CAD Database" )) &&
(db_version(dbip) == 4) ) {
+ if ( (BU_STR_EQUAL( dbip->dbi_title, "Untitled v4 BRL-CAD Database" )) &&
(version == 4) ) {
dbip->dbi_title=bu_strdup( "Untitled BRL-CAD Database" );
}
db_update_ident( fp->dbip, dbip->dbi_title, dbip->dbi_local2base );
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits