style fixes
This commit is contained in:
@@ -168,8 +168,7 @@ get_synaptics_movment(synaptics_cookie *cookie, mouse_movement *movement)
|
|||||||
if (sTouchpadInfo.capMiddleButton || sTouchpadInfo.capFourButtons)
|
if (sTouchpadInfo.capMiddleButton || sTouchpadInfo.capFourButtons)
|
||||||
event.buttons |= ((event_buffer[0] ^ event_buffer[3]) & 0x01) << 2;
|
event.buttons |= ((event_buffer[0] ^ event_buffer[3]) & 0x01) << 2;
|
||||||
|
|
||||||
if (sTouchpadInfo.nExtendedButtons > 0)
|
if (sTouchpadInfo.nExtendedButtons > 0) {
|
||||||
{
|
|
||||||
if (((event_buffer[0] ^ event_buffer[3]) & 0x02) != 0) {
|
if (((event_buffer[0] ^ event_buffer[3]) & 0x02) != 0) {
|
||||||
// This packet includes extended buttons state. The state is
|
// This packet includes extended buttons state. The state is
|
||||||
// only reported once when one of the buttons is pressed or
|
// only reported once when one of the buttons is pressed or
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ BTree::Node::MoveEntries(uint32 start, uint32 end, int length) const
|
|||||||
if (Level() == 0) {
|
if (Level() == 0) {
|
||||||
// moving item data
|
// moving item data
|
||||||
int num = start - end;
|
int num = start - end;
|
||||||
for(uint32 i = start; i < ItemCount() + num; ++i)
|
for (uint32 i = start; i < ItemCount() + num; ++i)
|
||||||
Item(i)->SetOffset(Item(i)->Offset() - length);
|
Item(i)->SetOffset(Item(i)->Offset() - length);
|
||||||
|
|
||||||
memmove(ItemData(ItemCount() - 1) - length, ItemData(ItemCount() - 1),
|
memmove(ItemData(ItemCount() - 1) - length, ItemData(ItemCount() - 1),
|
||||||
@@ -855,7 +855,7 @@ BTree::PreviousLeaf(Path* path) const
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
slot = node->ItemCount() - 1;
|
slot = node->ItemCount() - 1;
|
||||||
level--;
|
level--;
|
||||||
} while(level != 0);
|
} while (level != 0);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -894,7 +894,7 @@ BTree::NextLeaf(Path* path) const
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
slot = 0;
|
slot = 0;
|
||||||
level--;
|
level--;
|
||||||
} while(level != 0);
|
} while (level != 0);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ BlockGroup::Initialize(uint64 flag)
|
|||||||
fKey.SetOffset(0);
|
fKey.SetOffset(0);
|
||||||
status_t status;
|
status_t status;
|
||||||
|
|
||||||
while(true) {
|
while (true) {
|
||||||
status = fCurrentExtentTree->FindNext(&path, fKey, (void**)&fItem);
|
status = fCurrentExtentTree->FindNext(&path, fKey, (void**)&fItem);
|
||||||
if ((Flags() & flag) == flag || status != B_OK)
|
if ((Flags() & flag) == flag || status != B_OK)
|
||||||
break;
|
break;
|
||||||
@@ -451,7 +451,7 @@ BlockGroup::LoadExtent(CachedExtentTree* tree, bool inverse)
|
|||||||
|
|
||||||
TreeIterator iterator(fCurrentExtentTree, key);
|
TreeIterator iterator(fCurrentExtentTree, key);
|
||||||
status_t status;
|
status_t status;
|
||||||
while(true) {
|
while (true) {
|
||||||
status = iterator.GetNextEntry(&data);
|
status = iterator.GetNextEntry(&data);
|
||||||
key = iterator.Key();
|
key = iterator.Key();
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
@@ -614,7 +614,7 @@ ExtentAllocator::_Allocate(uint64& found, uint64 start, uint64 size,
|
|||||||
B_PRIu64 "\n", start, size, type);
|
B_PRIu64 "\n", start, size, type);
|
||||||
CachedExtent* chosen;
|
CachedExtent* chosen;
|
||||||
status_t status;
|
status_t status;
|
||||||
while(true) {
|
while (true) {
|
||||||
status = fTree->FindNext(&chosen, start, size, type);
|
status = fTree->FindNext(&chosen, start, size, type);
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ Journal::Lock(Transaction* owner, bool separateSubTransactions)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(separateSubTransactions)
|
if (separateSubTransactions)
|
||||||
fSeparateSubTransactions = true;
|
fSeparateSubTransactions = true;
|
||||||
|
|
||||||
if (owner != NULL)
|
if (owner != NULL)
|
||||||
@@ -478,7 +478,7 @@ Journal::_WriteTransactionToLog()
|
|||||||
TRACE("Journal::_WriteTransactionToLog(): main transaction size: %"
|
TRACE("Journal::_WriteTransactionToLog(): main transaction size: %"
|
||||||
B_PRIuSIZE "\n", size);
|
B_PRIuSIZE "\n", size);
|
||||||
|
|
||||||
if(fHasSubTransaction && size < fMaxTransactionSize) {
|
if (fHasSubTransaction && size < fMaxTransactionSize) {
|
||||||
TRACE("Journal::_WriteTransactionToLog(): transaction doesn't fit, "
|
TRACE("Journal::_WriteTransactionToLog(): transaction doesn't fit, "
|
||||||
"but it can be separated\n");
|
"but it can be separated\n");
|
||||||
detached = true;
|
detached = true;
|
||||||
|
|||||||
@@ -765,7 +765,7 @@ Volume::RemoveOrphan(Transaction& transaction, ino_t id)
|
|||||||
currentID = inode->NextOrphan();
|
currentID = inode->NextOrphan();
|
||||||
if (currentID == 0)
|
if (currentID == 0)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
} while(currentID != id);
|
} while (currentID != id);
|
||||||
|
|
||||||
CachedBlock cachedRemoved(this);
|
CachedBlock cachedRemoved(this);
|
||||||
|
|
||||||
|
|||||||
@@ -644,7 +644,7 @@ ext2_write_stat(fs_volume* _volume, fs_vnode* _node, const struct stat* stat,
|
|||||||
off_t oldSize = inode->Size();
|
off_t oldSize = inode->Size();
|
||||||
|
|
||||||
status_t status = inode->Resize(transaction, stat->st_size);
|
status_t status = inode->Resize(transaction, stat->st_size);
|
||||||
if(status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
if ((mask & B_STAT_SIZE_INSECURE) == 0) {
|
if ((mask & B_STAT_SIZE_INSECURE) == 0) {
|
||||||
|
|||||||
@@ -255,8 +255,7 @@ walk_volume_descriptor_sequence(extent_address descriptorSequence,
|
|||||||
uint8 uniquePartitions = 0;
|
uint8 uniquePartitions = 0;
|
||||||
status_t error = B_OK;
|
status_t error = B_OK;
|
||||||
|
|
||||||
for (uint32 i = 0; i < count; i++)
|
for (uint32 i = 0; i < count; i++) {
|
||||||
{
|
|
||||||
off_t block = descriptorSequence.location()+i;
|
off_t block = descriptorSequence.location()+i;
|
||||||
off_t address = block << blockShift;
|
off_t address = block << blockShift;
|
||||||
MemoryChunk chunk(blockSize);
|
MemoryChunk chunk(blockSize);
|
||||||
@@ -304,8 +303,7 @@ walk_volume_descriptor_sequence(extent_address descriptorSequence,
|
|||||||
// Check for a matching implementation id string (note that the
|
// Check for a matching implementation id string (note that the
|
||||||
// revision version is not checked)
|
// revision version is not checked)
|
||||||
if (impUse->tag().init_check(block) == B_OK
|
if (impUse->tag().init_check(block) == B_OK
|
||||||
&& impUse->implementation_id().matches(kLogicalVolumeInfoId201))
|
&& impUse->implementation_id().matches(kLogicalVolumeInfoId201)) {
|
||||||
{
|
|
||||||
foundUdfImplementationUseDescriptor = true;
|
foundUdfImplementationUseDescriptor = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -323,12 +321,10 @@ walk_volume_descriptor_sequence(extent_address descriptorSequence,
|
|||||||
int num;
|
int num;
|
||||||
for (num = 0; num < uniquePartitions; num++) {
|
for (num = 0; num < uniquePartitions; num++) {
|
||||||
if (partitionDescriptors[num].partition_number()
|
if (partitionDescriptors[num].partition_number()
|
||||||
== partition->partition_number())
|
== partition->partition_number()) {
|
||||||
{
|
|
||||||
foundDuplicate = true;
|
foundDuplicate = true;
|
||||||
if (partitionDescriptors[num].vds_number()
|
if (partitionDescriptors[num].vds_number()
|
||||||
< partition->vds_number())
|
< partition->vds_number()) {
|
||||||
{
|
|
||||||
partitionDescriptors[num] = *partition;
|
partitionDescriptors[num] = *partition;
|
||||||
PRINT(("Replacing previous partition #%d (vds_number: %ld) with "
|
PRINT(("Replacing previous partition #%d (vds_number: %ld) with "
|
||||||
"new partition #%d (vds_number: %ld)\n",
|
"new partition #%d (vds_number: %ld)\n",
|
||||||
@@ -360,8 +356,7 @@ walk_volume_descriptor_sequence(extent_address descriptorSequence,
|
|||||||
bool foundReplacement = false;
|
bool foundReplacement = false;
|
||||||
for (int j = 0; j < uniquePartitions; j++) {
|
for (int j = 0; j < uniquePartitions; j++) {
|
||||||
if (partitionDescriptors[j].vds_number()
|
if (partitionDescriptors[j].vds_number()
|
||||||
< partition->vds_number())
|
< partition->vds_number()) {
|
||||||
{
|
|
||||||
foundReplacement = true;
|
foundReplacement = true;
|
||||||
partitionDescriptors[j] = *partition;
|
partitionDescriptors[j] = *partition;
|
||||||
PRINT(("Replacing partition #%d (vds_number: %ld) "
|
PRINT(("Replacing partition #%d (vds_number: %ld) "
|
||||||
@@ -467,8 +462,7 @@ walk_integrity_sequence(int device, uint32 blockSize, uint32 blockShift,
|
|||||||
bool lastDescriptorWasClosed = false;
|
bool lastDescriptorWasClosed = false;
|
||||||
uint16 highestMinimumUDFReadRevision = 0x0000;
|
uint16 highestMinimumUDFReadRevision = 0x0000;
|
||||||
status_t error = count > 0 ? B_OK : B_ENTRY_NOT_FOUND;
|
status_t error = count > 0 ? B_OK : B_ENTRY_NOT_FOUND;
|
||||||
for (uint32 i = 0; error == B_OK && i < count; i++)
|
for (uint32 i = 0; error == B_OK && i < count; i++) {
|
||||||
{
|
|
||||||
off_t block = descriptorSequence.location()+i;
|
off_t block = descriptorSequence.location()+i;
|
||||||
off_t address = block << blockShift;
|
off_t address = block << blockShift;
|
||||||
MemoryChunk chunk(blockSize);
|
MemoryChunk chunk(blockSize);
|
||||||
|
|||||||
@@ -80,8 +80,7 @@ struct Volume::VNode {
|
|||||||
protected: // should be private, but gcc 2.95.3 issues a warning
|
protected: // should be private, but gcc 2.95.3 issues a warning
|
||||||
~VNode()
|
~VNode()
|
||||||
{
|
{
|
||||||
if (fileCache != NULL)
|
if (fileCache != NULL) {
|
||||||
{
|
|
||||||
ERROR(("VNode %" B_PRId64 " still has a file cache!\n", id));
|
ERROR(("VNode %" B_PRId64 " still has a file cache!\n", id));
|
||||||
file_cache_delete(fileCache);
|
file_cache_delete(fileCache);
|
||||||
}
|
}
|
||||||
@@ -4518,7 +4517,7 @@ PRINT(("Volume::_PutAllPendingVNodes()\n"));
|
|||||||
|
|
||||||
MutexLocker locker(fLock);
|
MutexLocker locker(fLock);
|
||||||
|
|
||||||
if (!fVNodeCountingEnabled) {
|
if (!fVNodeCountingEnabled) {
|
||||||
PRINT(("Volume::_PutAllPendingVNodes() failed: vnode counting "
|
PRINT(("Volume::_PutAllPendingVNodes() failed: vnode counting "
|
||||||
"disabled\n"));
|
"disabled\n"));
|
||||||
return USERLAND_IOCTL_VNODE_COUNTING_DISABLED;
|
return USERLAND_IOCTL_VNODE_COUNTING_DISABLED;
|
||||||
|
|||||||
@@ -315,8 +315,7 @@ IPCP::ReceiveIPPacket(net_buffer *packet, uint16 protocolNumber)
|
|||||||
|
|
||||||
// TODO: add VJC support (the packet would be decoded here)
|
// TODO: add VJC support (the packet would be decoded here)
|
||||||
|
|
||||||
if (packet)
|
if (packet) {
|
||||||
{
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
dump_packet(packet, "incoming");
|
dump_packet(packet, "incoming");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -637,8 +637,7 @@ KPPPInterface::Control(uint32 op, void *data, size_t length)
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
ppp_control_info *controlInfo = (ppp_control_info*) control->data;
|
ppp_control_info *controlInfo = (ppp_control_info*) control->data;
|
||||||
if (controlInfo->index != 0 || !Device())
|
if (controlInfo->index != 0 || !Device()) {
|
||||||
{
|
|
||||||
dprintf("index is 0 or no Device\n");
|
dprintf("index is 0 or no Device\n");
|
||||||
return B_BAD_INDEX;
|
return B_BAD_INDEX;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,8 +204,7 @@ connection_thread(void*)
|
|||||||
|
|
||||||
// TODO: Keep this a static var
|
// TODO: Keep this a static var
|
||||||
port_id fPort = find_port(BLUETOOTH_CONNECTION_SCHED_PORT);
|
port_id fPort = find_port(BLUETOOTH_CONNECTION_SCHED_PORT);
|
||||||
if (fPort == B_NAME_NOT_FOUND)
|
if (fPort == B_NAME_NOT_FOUND) {
|
||||||
{
|
|
||||||
panic("BT Connection port has been deleted");
|
panic("BT Connection port has been deleted");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2390,7 +2390,7 @@ TCPEndpoint::_Retransmit()
|
|||||||
void
|
void
|
||||||
TCPEndpoint::_UpdateRoundTripTime(int32 roundTripTime, int32 expectedSamples)
|
TCPEndpoint::_UpdateRoundTripTime(int32 roundTripTime, int32 expectedSamples)
|
||||||
{
|
{
|
||||||
if(fSmoothedRoundTripTime == 0) {
|
if (fSmoothedRoundTripTime == 0) {
|
||||||
fSmoothedRoundTripTime = roundTripTime;
|
fSmoothedRoundTripTime = roundTripTime;
|
||||||
fRoundTripVariation = roundTripTime / 2;
|
fRoundTripVariation = roundTripTime / 2;
|
||||||
fRetransmitTimeout = (fSmoothedRoundTripTime + max_c(100, fRoundTripVariation * 4))
|
fRetransmitTimeout = (fSmoothedRoundTripTime + max_c(100, fRoundTripVariation * 4))
|
||||||
|
|||||||
@@ -339,20 +339,17 @@ setPalette()
|
|||||||
// << 16 | (uint8)(i * 6/10) << 8;
|
// << 16 | (uint8)(i * 6/10) << 8;
|
||||||
// | (uint8)(i * 3 / 10);
|
// | (uint8)(i * 3 / 10);
|
||||||
|
|
||||||
for (i = 128;i < 256;i++)
|
for (i = 128;i < 256; i++) {
|
||||||
{
|
|
||||||
uint8 r = i;
|
uint8 r = i;
|
||||||
uint8 c = (uint8)((cos((i - 256) / 42.0) * 0.5 + 0.5) * 225);
|
uint8 c = (uint8)((cos((i - 256) / 42.0) * 0.5 + 0.5) * 225);
|
||||||
|
|
||||||
gPalette[i] = ((r << 16) | (c << 8) | c);
|
gPalette[i] = ((r << 16) | (c << 8) | c);
|
||||||
}
|
}
|
||||||
/* for (i = 192; i < 224; i++)
|
/* for (i = 192; i < 224; i++) {
|
||||||
{
|
|
||||||
uint8 c = (i - 192);
|
uint8 c = (i - 192);
|
||||||
gPalette[i] = gPalette[i] & 0xff0000 | c << 8 | c;
|
gPalette[i] = gPalette[i] & 0xff0000 | c << 8 | c;
|
||||||
}
|
}
|
||||||
for (i = 224; i < 256; i++)
|
for (i = 224; i < 256; i++) {
|
||||||
{
|
|
||||||
uint8 c = (i-224) / 2;
|
uint8 c = (i-224) / 2;
|
||||||
c = 32 + c * c * 6 / 10;
|
c = 32 + c * c * 6 / 10;
|
||||||
gPalette[i] = gPalette[i] & 0xff0000 | c << 8 | c;
|
gPalette[i] = gPalette[i] & 0xff0000 | c << 8 | c;
|
||||||
@@ -401,8 +398,7 @@ setPalette()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* for (i = 0;i < 256;i++)
|
/* for (i = 0;i < 256; i++) {
|
||||||
{
|
|
||||||
uint8 r = (i);
|
uint8 r = (i);
|
||||||
uint8 g = (i * i >> 8); //(i * 8 / 10);
|
uint8 g = (i * i >> 8); //(i * 8 / 10);
|
||||||
uint8 b = 0; //(i * 2 / 10);
|
uint8 b = 0; //(i * 2 / 10);
|
||||||
@@ -730,8 +726,7 @@ Nebula::StartSaver(BView* view, bool preview)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// uniforme cubique
|
// uniforme cubique
|
||||||
/* for (i = 0;i < GMAX;i++)
|
/* for (i = 0;i < GMAX; i++) {
|
||||||
{
|
|
||||||
gal[i].x = 1 * ((rand()&1023) - 512);
|
gal[i].x = 1 * ((rand()&1023) - 512);
|
||||||
gal[i].y = 1 * ((rand()&1023) - 512);
|
gal[i].y = 1 * ((rand()&1023) - 512);
|
||||||
gal[i].z = 1 * ((rand()&1023) - 512);
|
gal[i].z = 1 * ((rand()&1023) - 512);
|
||||||
|
|||||||
@@ -130,8 +130,7 @@ Activity::Draw(BRect rect)
|
|||||||
void
|
void
|
||||||
Activity::_DrawOnBitmap(bool running)
|
Activity::_DrawOnBitmap(bool running)
|
||||||
{
|
{
|
||||||
if (fBitmap->Lock())
|
if (fBitmap->Lock()) {
|
||||||
{
|
|
||||||
BRect bounds = fBitmap->Bounds();
|
BRect bounds = fBitmap->Bounds();
|
||||||
|
|
||||||
fBitmapView->SetDrawingMode(B_OP_COPY);
|
fBitmapView->SetDrawingMode(B_OP_COPY);
|
||||||
|
|||||||
@@ -79,15 +79,14 @@ ICNSLoader::ICNSLoader(BPositionIO *stream)
|
|||||||
icns_byte_t *dataPtr = (icns_byte_t*)fIconFamily;
|
icns_byte_t *dataPtr = (icns_byte_t*)fIconFamily;
|
||||||
off_t dataOffset = sizeof(icns_type_t) + sizeof(icns_size_t);
|
off_t dataOffset = sizeof(icns_type_t) + sizeof(icns_size_t);
|
||||||
|
|
||||||
while ((dataOffset+8) < fIconFamily->resourceSize)
|
while ((dataOffset+8) < fIconFamily->resourceSize) {
|
||||||
{
|
|
||||||
icns_element_t iconElement;
|
icns_element_t iconElement;
|
||||||
icns_size_t iconDataSize;
|
icns_size_t iconDataSize;
|
||||||
|
|
||||||
memcpy(&iconElement, (dataPtr + dataOffset), 8);
|
memcpy(&iconElement, (dataPtr + dataOffset), 8);
|
||||||
iconDataSize = iconElement.elementSize - 8;
|
iconDataSize = iconElement.elementSize - 8;
|
||||||
|
|
||||||
if(IS_SPUPPORTED_TYPE(iconElement.elementType)) {
|
if (IS_SPUPPORTED_TYPE(iconElement.elementType)) {
|
||||||
icns_type_t* newTypeItem = new icns_type_t;
|
icns_type_t* newTypeItem = new icns_type_t;
|
||||||
*newTypeItem = iconElement.elementType;
|
*newTypeItem = iconElement.elementType;
|
||||||
fFormatList.AddItem(newTypeItem);
|
fFormatList.AddItem(newTypeItem);
|
||||||
|
|||||||
@@ -445,8 +445,7 @@ write_rgba32b(jas_matrix_t** pixels, uchar* scanline, int width)
|
|||||||
{
|
{
|
||||||
int32 index = 0;
|
int32 index = 0;
|
||||||
int32 x = 0;
|
int32 x = 0;
|
||||||
while (x < width)
|
while (x < width) {
|
||||||
{
|
|
||||||
jas_matrix_setv(pixels[0], x, scanline[index++]);
|
jas_matrix_setv(pixels[0], x, scanline[index++]);
|
||||||
jas_matrix_setv(pixels[1], x, scanline[index++]);
|
jas_matrix_setv(pixels[1], x, scanline[index++]);
|
||||||
jas_matrix_setv(pixels[2], x, scanline[index++]);
|
jas_matrix_setv(pixels[2], x, scanline[index++]);
|
||||||
|
|||||||
@@ -265,8 +265,7 @@ HashMapCatalog::ComputeFingerprint() const
|
|||||||
int32 hash;
|
int32 hash;
|
||||||
CatMap::Iterator iter = fCatMap.GetIterator();
|
CatMap::Iterator iter = fCatMap.GetIterator();
|
||||||
CatMap::Entry entry;
|
CatMap::Entry entry;
|
||||||
while (iter.HasNext())
|
while (iter.HasNext()) {
|
||||||
{
|
|
||||||
entry = iter.Next();
|
entry = iter.Next();
|
||||||
hash = B_HOST_TO_LENDIAN_INT32(entry.key.fHashVal);
|
hash = B_HOST_TO_LENDIAN_INT32(entry.key.fHashVal);
|
||||||
checksum += hash;
|
checksum += hash;
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ BDaemonClient::GetInstallationLocationInfo(
|
|||||||
// Get our filesystem root node. If we are in a chroot this is not the same
|
// Get our filesystem root node. If we are in a chroot this is not the same
|
||||||
// as the package_daemon root node, so we must provide it.
|
// as the package_daemon root node, so we must provide it.
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat("/boot", &st) == 0)
|
if (stat("/boot", &st) == 0) {
|
||||||
{
|
|
||||||
error = request.AddInt32("volume", st.st_dev);
|
error = request.AddInt32("volume", st.st_dev);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|||||||
@@ -131,9 +131,7 @@ SnifferRules::SnifferRules(DatabaseLocation* databaseLocation,
|
|||||||
SnifferRules::~SnifferRules()
|
SnifferRules::~SnifferRules()
|
||||||
{
|
{
|
||||||
for (std::list<sniffer_rule>::iterator i = fRuleList.begin();
|
for (std::list<sniffer_rule>::iterator i = fRuleList.begin();
|
||||||
i != fRuleList.end();
|
i != fRuleList.end(); i++) {
|
||||||
i++)
|
|
||||||
{
|
|
||||||
delete i->rule;
|
delete i->rule;
|
||||||
i->rule = NULL;
|
i->rule = NULL;
|
||||||
}
|
}
|
||||||
@@ -262,8 +260,7 @@ SnifferRules::SetSnifferRule(const char *type, const char *rule)
|
|||||||
// operator<(sniffer_rule&, sniffer_rule&))
|
// operator<(sniffer_rule&, sniffer_rule&))
|
||||||
if (!err) {
|
if (!err) {
|
||||||
std::list<sniffer_rule>::iterator i;
|
std::list<sniffer_rule>::iterator i;
|
||||||
for (i = fRuleList.begin(); i != fRuleList.end(); i++)
|
for (i = fRuleList.begin(); i != fRuleList.end(); i++) {
|
||||||
{
|
|
||||||
if (item < (*i)) {
|
if (item < (*i)) {
|
||||||
fRuleList.insert(i, item);
|
fRuleList.insert(i, item);
|
||||||
break;
|
break;
|
||||||
@@ -292,9 +289,7 @@ SnifferRules::DeleteSnifferRule(const char *type)
|
|||||||
|
|
||||||
// Find the rule in the list and remove it
|
// Find the rule in the list and remove it
|
||||||
for (std::list<sniffer_rule>::iterator i = fRuleList.begin();
|
for (std::list<sniffer_rule>::iterator i = fRuleList.begin();
|
||||||
i != fRuleList.end();
|
i != fRuleList.end(); i++) {
|
||||||
i++)
|
|
||||||
{
|
|
||||||
if (i->type == type) {
|
if (i->type == type) {
|
||||||
fRuleList.erase(i);
|
fRuleList.erase(i);
|
||||||
break;
|
break;
|
||||||
@@ -316,9 +311,7 @@ SnifferRules::PrintToStream() const
|
|||||||
|
|
||||||
if (fHaveDoneFullBuild) {
|
if (fHaveDoneFullBuild) {
|
||||||
for (std::list<sniffer_rule>::const_iterator i = fRuleList.begin();
|
for (std::list<sniffer_rule>::const_iterator i = fRuleList.begin();
|
||||||
i != fRuleList.end();
|
i != fRuleList.end(); i++) {
|
||||||
i++)
|
|
||||||
{
|
|
||||||
printf("%s: '%s'\n", i->type.c_str(), i->rule_string.c_str());
|
printf("%s: '%s'\n", i->type.c_str(), i->rule_string.c_str());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -357,8 +350,7 @@ SnifferRules::BuildRuleList()
|
|||||||
char supertype[B_PATH_NAME_LENGTH];
|
char supertype[B_PATH_NAME_LENGTH];
|
||||||
if (entry.IsDirectory()
|
if (entry.IsDirectory()
|
||||||
&& entry.GetName(supertype) == B_OK
|
&& entry.GetName(supertype) == B_OK
|
||||||
&& BMimeType::IsValid(supertype))
|
&& BMimeType::IsValid(supertype)) {
|
||||||
{
|
|
||||||
// Make sure the supertype string is all lowercase
|
// Make sure the supertype string is all lowercase
|
||||||
BPrivate::Storage::to_lower(supertype);
|
BPrivate::Storage::to_lower(supertype);
|
||||||
|
|
||||||
@@ -468,9 +460,7 @@ SnifferRules::GuessMimeType(BFile* file, const void *buffer, int32 length,
|
|||||||
// descreasing priority, and see if one of the rules sniffs
|
// descreasing priority, and see if one of the rules sniffs
|
||||||
// out a match
|
// out a match
|
||||||
for (std::list<sniffer_rule>::const_iterator i = fRuleList.begin();
|
for (std::list<sniffer_rule>::const_iterator i = fRuleList.begin();
|
||||||
i != fRuleList.end();
|
i != fRuleList.end(); i++) {
|
||||||
i++)
|
|
||||||
{
|
|
||||||
if (i->rule) {
|
if (i->rule) {
|
||||||
// If an add-on identified the type with a priority at least
|
// If an add-on identified the type with a priority at least
|
||||||
// as great as the remaining rules, we can stop further
|
// as great as the remaining rules, we can stop further
|
||||||
|
|||||||
+10
-20
@@ -283,57 +283,48 @@ BUrl::SetPath(const BString& path)
|
|||||||
BString input(path);
|
BString input(path);
|
||||||
|
|
||||||
// 2.
|
// 2.
|
||||||
while(!input.IsEmpty())
|
while (!input.IsEmpty()) {
|
||||||
{
|
|
||||||
// 2.A.
|
// 2.A.
|
||||||
if (input.StartsWith("./"))
|
if (input.StartsWith("./")) {
|
||||||
{
|
|
||||||
input.Remove(0, 2);
|
input.Remove(0, 2);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input.StartsWith("../"))
|
if (input.StartsWith("../")) {
|
||||||
{
|
|
||||||
input.Remove(0, 3);
|
input.Remove(0, 3);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.B.
|
// 2.B.
|
||||||
if (input.StartsWith("/./"))
|
if (input.StartsWith("/./")) {
|
||||||
{
|
|
||||||
input.Remove(0, 2);
|
input.Remove(0, 2);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input == "/.")
|
if (input == "/.") {
|
||||||
{
|
|
||||||
input.Remove(1, 1);
|
input.Remove(1, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.C.
|
// 2.C.
|
||||||
if (input.StartsWith("/../"))
|
if (input.StartsWith("/../")) {
|
||||||
{
|
|
||||||
input.Remove(0, 3);
|
input.Remove(0, 3);
|
||||||
output.Truncate(output.FindLast('/'));
|
output.Truncate(output.FindLast('/'));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input == "/..")
|
if (input == "/..") {
|
||||||
{
|
|
||||||
input.Remove(1, 2);
|
input.Remove(1, 2);
|
||||||
output.Truncate(output.FindLast('/'));
|
output.Truncate(output.FindLast('/'));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.D.
|
// 2.D.
|
||||||
if (input == "." || input == "..")
|
if (input == "." || input == "..") {
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input == "/.")
|
if (input == "/.") {
|
||||||
{
|
|
||||||
input.Remove(1, 1);
|
input.Remove(1, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1100,8 +1091,7 @@ BString
|
|||||||
BUrl::_MergePath(const BString& relative) const
|
BUrl::_MergePath(const BString& relative) const
|
||||||
{
|
{
|
||||||
// This implements RFC3986, Section 5.2.3.
|
// This implements RFC3986, Section 5.2.3.
|
||||||
if (HasAuthority() && fPath == "")
|
if (HasAuthority() && fPath == "") {
|
||||||
{
|
|
||||||
BString result("/");
|
BString result("/");
|
||||||
result << relative;
|
result << relative;
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -333,8 +333,7 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry(
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
// Try to get the glyph from the fallback fonts
|
// Try to get the glyph from the fallback fonts
|
||||||
while(fallbacks[i] != NULL)
|
while (fallbacks[i] != NULL) {
|
||||||
{
|
|
||||||
if (gFontManager->Lock()) {
|
if (gFontManager->Lock()) {
|
||||||
FontStyle* fallbackStyle = gFontManager->GetStyleByIndex(
|
FontStyle* fallbackStyle = gFontManager->GetStyleByIndex(
|
||||||
fallbacks[i], 0);
|
fallbacks[i], 0);
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ HCITransportAccessor::HCITransportAccessor(BPath* path) : HCIDelegate(path)
|
|||||||
|
|
||||||
HCITransportAccessor::~HCITransportAccessor()
|
HCITransportAccessor::~HCITransportAccessor()
|
||||||
{
|
{
|
||||||
if (fDescriptor > 0)
|
if (fDescriptor > 0) {
|
||||||
{
|
|
||||||
close(fDescriptor);
|
close(fDescriptor);
|
||||||
fDescriptor = -1;
|
fDescriptor = -1;
|
||||||
fIdentifier = B_ERROR;
|
fIdentifier = B_ERROR;
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ status_t our_image(image_info* image)
|
|||||||
{
|
{
|
||||||
int32 cookie = 0;
|
int32 cookie = 0;
|
||||||
status_t ret;
|
status_t ret;
|
||||||
while ((ret = get_next_image_info(0,&cookie,image)) == B_OK)
|
while ((ret = get_next_image_info(0, &cookie,image)) == B_OK) {
|
||||||
{
|
|
||||||
if ((char*)our_image >= (char*)image->text_part &&
|
if ((char*)our_image >= (char*)image->text_part &&
|
||||||
(char*)our_image <= (char*)image->text_part + image->text_part_size)
|
(char*)our_image <= (char*)image->text_part + image->text_part_size)
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -263,8 +263,7 @@ NotificationView::Draw(BRect updateRect)
|
|||||||
float iy = (Bounds().Height() - fIconSize) / 4.0;
|
float iy = (Bounds().Height() - fIconSize) / 4.0;
|
||||||
// Icon is vertically centered in view
|
// Icon is vertically centered in view
|
||||||
|
|
||||||
if (fNotification->Type() == B_PROGRESS_NOTIFICATION)
|
if (fNotification->Type() == B_PROGRESS_NOTIFICATION) {
|
||||||
{
|
|
||||||
// Move icon up by half progress bar height if it's present
|
// Move icon up by half progress bar height if it's present
|
||||||
iy -= (progRect.Height() + kEdgePadding);
|
iy -= (progRect.Height() + kEdgePadding);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user