* Fixed warnings.

* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30267 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-04-19 20:57:33 +00:00
parent 5a0bca36e0
commit 728c7f10e1
2 changed files with 51 additions and 48 deletions
+20 -17
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2007, Haiku, Inc.
* Copyright 2001-2009, Haiku, Inc.
* Copyright 2003-2004 Kian Duffy, [email protected]
* Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai.
* All rights reserved. Distributed under the terms of the MIT license.
@@ -7,20 +7,21 @@
#include "AppearPrefView.h"
#include "MenuUtil.h"
#include "PrefHandler.h"
#include "TermConst.h"
#include <View.h>
#include <Button.h>
#include <MenuField.h>
#include <Menu.h>
#include <MenuItem.h>
#include <PopUpMenu.h>
#include <stdio.h>
#include <stdlib.h>
#include <Button.h>
#include <Menu.h>
#include <MenuField.h>
#include <MenuItem.h>
#include <PopUpMenu.h>
#include <View.h>
#include "MenuUtil.h"
#include "PrefHandler.h"
#include "TermConst.h"
static bool
IsFontUsable(const BFont &font)
@@ -33,15 +34,17 @@ IsFontUsable(const BFont &font)
return true;
bool widthOk = true;
int lastWidth;
int lastWidth = 0;
char buffer[2] = {0, 0};
for (int c = 0x20 ; c <= 0x7e; c++){
char buf[4];
snprintf(buf, sizeof(buf), "%c", c);
int tmpWidth = (int)font.StringWidth(buf);
if (c > 0x20 &&(tmpWidth != lastWidth))
buffer[1] = c;
int width = (int)ceilf(font.StringWidth(buffer));
if (c > 0x20 && width != lastWidth)
widthOk = false;
lastWidth = tmpWidth;
lastWidth = width;
}
return widthOk;
}
+2 -2
View File
@@ -543,10 +543,10 @@ BasicTerminalBuffer::InsertChar(UTF8Char c, uint32 width, uint32 attributes)
//(int)c.ByteCount(), c.bytes, c.bytes[0], attributes);
// TODO: Check if this method can be removed completely
//int width = CodeConv::UTF8GetFontWidth(c.bytes);
if (width == FULL_WIDTH)
if ((int32)width == FULL_WIDTH)
attributes |= A_WIDTH;
if (fSoftWrappedCursor || fCursor.x + width > fWidth)
if (fSoftWrappedCursor || fCursor.x + (int32)width > fWidth)
_SoftBreakLine();
else
_PadLineToCursor();