Icon-o-matic: some 64 bit fixes

This commit is contained in:
Jérôme Duval
2013-05-04 15:31:04 +02:00
parent 48350f1a72
commit 60128b54b4
9 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ MainWindow::MessageReceived(BMessage* message)
if (message->WasDropped()) { if (message->WasDropped()) {
const rgb_color* color; const rgb_color* color;
int32 length; ssize_t length;
// create styles from dropped colors // create styles from dropped colors
for (int32 i = 0; message->FindData("RGBColor", B_RGB_COLOR_TYPE, i, for (int32 i = 0; message->FindData("RGBColor", B_RGB_COLOR_TYPE, i,
(const void**)&color, &length) == B_OK; i++) { (const void**)&color, &length) == B_OK; i++) {
@@ -29,8 +29,8 @@ Observable::~Observable()
if (fObservers.CountItems() > 0) { if (fObservers.CountItems() > 0) {
char message[256]; char message[256];
Observer* o = (Observer*)fObservers.ItemAt(0); Observer* o = (Observer*)fObservers.ItemAt(0);
sprintf(message, "Observable::~Observable() - %ld " sprintf(message, "Observable::~Observable() - %" B_PRId32
"observers still watching, first: %s\n", " observers still watching, first: %s\n",
fObservers.CountItems(), typeid(*o).name()); fObservers.CountItems(), typeid(*o).name());
debugger(message); debugger(message);
} }
@@ -399,7 +399,7 @@ PropertyListView::SetTo(PropertyObject* object)
// unkown to the PropertyEditorFactory and therefor // unkown to the PropertyEditorFactory and therefor
// there is no editor view at this item // there is no editor view at this item
fprintf(stderr, "PropertyListView::_SetTo() - " fprintf(stderr, "PropertyListView::_SetTo() - "
"property mismatch at %ld\n", i); "property mismatch at %" B_PRId32 "\n", i);
error = true; error = true;
break; break;
} }
@@ -425,7 +425,7 @@ PropertyListView::SetTo(PropertyObject* object)
int32 focused = -1; int32 focused = -1;
for (int32 i = 0; PropertyItemView* item = _ItemAt(i); i++) { for (int32 i = 0; PropertyItemView* item = _ItemAt(i); i++) {
if (item->IsSelected()) if (item->IsSelected())
selection.AddItem((void*)i); selection.AddItem((void*)(long)i);
if (item->IsFocused()) if (item->IsFocused())
focused = i; focused = i;
} }
@@ -449,7 +449,7 @@ PropertyListView::SetTo(PropertyObject* object)
// restore scroll pos, selection and focus // restore scroll pos, selection and focus
SetScrollOffset(scrollOffset); SetScrollOffset(scrollOffset);
for (int32 i = 0; PropertyItemView* item = _ItemAt(i); i++) { for (int32 i = 0; PropertyItemView* item = _ItemAt(i); i++) {
if (selection.HasItem((void*)i)) if (selection.HasItem((void*)(long)i))
item->SetSelected(true); item->SetSelected(true);
if (i == focused) if (i == focused)
item->MakeFocus(true); item->MakeFocus(true);
@@ -111,7 +111,7 @@ append_float(BString& string, float n, int32 maxDigits)
n = n - rounded; n = n - rounded;
rounded = (int32)(n * pow(10, maxDigits)); rounded = (int32)(n * pow(10, maxDigits));
char tmp[maxDigits + 1]; char tmp[maxDigits + 1];
sprintf(tmp, "%0*ld", (int)maxDigits, rounded); sprintf(tmp, "%0*" B_PRId32, (int)maxDigits, rounded);
tmp[maxDigits] = 0; tmp[maxDigits] = 0;
int32 digits = strlen(tmp); int32 digits = strlen(tmp);
for (int32 i = strlen(tmp) - 1; i >= 0; i--) { for (int32 i = strlen(tmp) - 1; i >= 0; i--) {
@@ -51,12 +51,12 @@ FlatIconExporter::~FlatIconExporter()
{ {
#if PRINT_STATISTICS #if PRINT_STATISTICS
printf("Statistics\n" printf("Statistics\n"
"--style section size: %ld\n" "--style section size: %" B_PRId32 "\n"
" gradients: %ld\n" " gradients: %" B_PRId32 "\n"
" gradient transforms: %ld\n" " gradient transforms: %" B_PRId32 "\n"
"---path section size: %ld\n" "---path section size: %" B_PRId32 "\n"
"--shape section size: %ld\n" "--shape section size: %" B_PRId32 "\n"
"---total/different points: %ld/%lu\n", "---total/different points: %" B_PRId32 "/%" B_PRIdSSIZE "\n",
fStyleSectionSize, fStyleSectionSize,
fGradientSize, fGradientSize,
fGradientTransformSize, fGradientTransformSize,
@@ -186,14 +186,14 @@ StyledTextImporter::Import(Icon* icon, BMessage* clipping)
{ {
CALLED(); CALLED();
const char *text; const char *text;
int32 textLength; ssize_t textLength;
if (clipping == NULL) if (clipping == NULL)
return ENOENT; return ENOENT;
if (clipping->FindData("text/plain", if (clipping->FindData("text/plain",
B_MIME_TYPE, (const void **)&text, &textLength) == B_OK) { B_MIME_TYPE, (const void **)&text, &textLength) == B_OK) {
text_run_array *runs = NULL; text_run_array *runs = NULL;
int32 runsLength; ssize_t runsLength;
if (clipping->FindData("application/x-vnd.Be-text_run_array", if (clipping->FindData("application/x-vnd.Be-text_run_array",
B_MIME_TYPE, (const void **)&runs, &runsLength) < B_OK) B_MIME_TYPE, (const void **)&runs, &runsLength) < B_OK)
runs = NULL; runs = NULL;
@@ -490,7 +490,7 @@ SVGExporter::_GetFill(const Style* style, char* string,
status_t ret = B_OK; status_t ret = B_OK;
if (Gradient* gradient = style->Gradient()) { if (Gradient* gradient = style->Gradient()) {
ret = _ExportGradient(gradient, stream); ret = _ExportGradient(gradient, stream);
sprintf(string, "url(#gradient%ld)", fGradientCount++); sprintf(string, "url(#gradient%" B_PRId32 ")", fGradientCount++);
} else { } else {
sprintf(string, "#%.2x%.2x%.2x", style->Color().red, sprintf(string, "#%.2x%.2x%.2x", style->Color().red,
style->Color().green, style->Color().green,
@@ -143,21 +143,21 @@ public:
break; break;
} }
} }
BList::AddItem((void*)value, index); BList::AddItem((void*)(long)value, index);
} }
} }
inline bool Remove(int32 value) inline bool Remove(int32 value)
{ return BList::RemoveItem((void*)value); } { return BList::RemoveItem((void*)(long)value); }
inline bool Contains(int32 value) const inline bool Contains(int32 value) const
{ return BList::HasItem((void*)value); } { return BList::HasItem((void*)(long)value); }
inline bool IsEmpty() const inline bool IsEmpty() const
{ return BList::IsEmpty(); } { return BList::IsEmpty(); }
inline int32 IndexAt(int32 index) const inline int32 IndexAt(int32 index) const
{ return (int32)BList::ItemAt(index); } { return (int32)(long)BList::ItemAt(index); }
inline void MakeEmpty() inline void MakeEmpty()
{ BList::MakeEmpty(); } { BList::MakeEmpty(); }
@@ -147,7 +147,7 @@ FreezeTransformationCommand::_ApplyTransformation(Shape* shape,
path->ApplyTransform(transform); path->ApplyTransform(transform);
} else { } else {
printf("Not transfering transformation of \"%s\" onto " printf("Not transfering transformation of \"%s\" onto "
"path \"%s\", because %ld other shapes " "path \"%s\", because %" B_PRId32 " other shapes "
"have it assigned.\n", shape->Name(), path->Name(), "have it assigned.\n", shape->Name(), path->Name(),
shapes - 1); shapes - 1);
} }