From ead4b1fa60d95346b810668348632cf22aebc3e9 Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Thu, 8 Jan 2004 03:35:54 +0000 Subject: [PATCH] Fixed version number format and calculations git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5984 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../translators/bmptranslator/BMPTranslator.cpp | 5 +++-- .../translators/bmptranslator/BMPTranslator.h | 2 +- src/add-ons/translators/bmptranslator/BMPView.cpp | 14 ++++---------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/add-ons/translators/bmptranslator/BMPTranslator.cpp b/src/add-ons/translators/bmptranslator/BMPTranslator.cpp index bdac7b31ca..579b608fe7 100644 --- a/src/add-ons/translators/bmptranslator/BMPTranslator.cpp +++ b/src/add-ons/translators/bmptranslator/BMPTranslator.cpp @@ -124,8 +124,9 @@ BMPTranslator::BMPTranslator() { strcpy(fName, "BMP Images"); sprintf(fInfo, "BMP image translator v%d.%d.%d %s", - BMP_TRANSLATOR_VERSION / 100, (BMP_TRANSLATOR_VERSION / 10) % 10, - BMP_TRANSLATOR_VERSION % 10, __DATE__); + static_cast(BMP_TRANSLATOR_VERSION >> 8), + static_cast((BMP_TRANSLATOR_VERSION >> 4) & 0xf), + static_cast(BMP_TRANSLATOR_VERSION & 0xf), __DATE__); } // --------------------------------------------------------------- diff --git a/src/add-ons/translators/bmptranslator/BMPTranslator.h b/src/add-ons/translators/bmptranslator/BMPTranslator.h index a192276277..512e7a2d63 100644 --- a/src/add-ons/translators/bmptranslator/BMPTranslator.h +++ b/src/add-ons/translators/bmptranslator/BMPTranslator.h @@ -41,7 +41,7 @@ #define BMP_RLE8_COMPRESS 1 #define BMP_RLE4_COMPRESS 2 -#define BMP_TRANSLATOR_VERSION 100 +#define BMP_TRANSLATOR_VERSION 0x100 #define BMP_IN_QUALITY 1.0 // high in quality becuase this code supports all BMP features #define BMP_IN_CAPABILITY 0.8 diff --git a/src/add-ons/translators/bmptranslator/BMPView.cpp b/src/add-ons/translators/bmptranslator/BMPView.cpp index ef61fb4651..29b4be1280 100644 --- a/src/add-ons/translators/bmptranslator/BMPView.cpp +++ b/src/add-ons/translators/bmptranslator/BMPView.cpp @@ -102,17 +102,11 @@ BMPView::Draw(BRect area) char detail[100]; sprintf(detail, "Version %d.%d.%d %s", - BMP_TRANSLATOR_VERSION / 100, (BMP_TRANSLATOR_VERSION / 10) % 10, - BMP_TRANSLATOR_VERSION % 10, __DATE__); + static_cast(BMP_TRANSLATOR_VERSION >> 8), + static_cast((BMP_TRANSLATOR_VERSION >> 4) & 0xf), + static_cast(BMP_TRANSLATOR_VERSION & 0xf), __DATE__); DrawString(detail, BPoint(xbold, yplain + ybold)); -/* char copyright[] = "© 2002 OpenBeOS Project"; - DrawString(copyright, BPoint(xbold, yplain * 2 + ybold)); - - char becopyright[] = "Portions Copyright 1991-1999, Be Incorporated."; - DrawString(becopyright, BPoint(xbold, yplain * 4 + ybold)); - char allrights[] = "All rights reserved."; - DrawString(allrights, BPoint(xbold, yplain * 5 + ybold)); -*/ + char writtenby[] = "Written by the OBOS Translation Kit Team"; DrawString(writtenby, BPoint(xbold, yplain * 7 + ybold)); }