Author: zooey Date: 2010-07-22 01:10:57 +0200 (Thu, 22 Jul 2010) New Revision: 37672 Changeset: http://dev.haiku-os.org/changeset/37672 Modified: haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.cpp haiku/trunk/src/add-ons/kernel/file_systems/netfs/client/netfs.cpp haiku/trunk/src/add-ons/media/plugins/ac3_decoder/ac3_decoder.cpp haiku/trunk/src/servers/bluetooth/DeviceManager.cpp Log: * fixed a couple of regressions of r37670 concerning optional build targets (bluetooth, ac3_decoder, netfs) Modified: haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.cpp 2010-07-21 23:07:52 UTC (rev 37671) +++ haiku/trunk/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.cpp 2010-07-21 23:10:57 UTC (rev 37672) @@ -31,9 +31,9 @@ int32 api_version = B_CUR_DRIVER_API_VERSION; // Modules -static char* usb_name = B_USB_MODULE_NAME; -static char* hci_name = BT_HCI_MODULE_NAME; -static char* btDevices_name = BT_HCI_MODULE_NAME; +static const char* usb_name = B_USB_MODULE_NAME; +static const char* hci_name = BT_HCI_MODULE_NAME; +static const char* btDevices_name = BT_HCI_MODULE_NAME; usb_module_info* usb = NULL; Modified: haiku/trunk/src/add-ons/kernel/file_systems/netfs/client/netfs.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/netfs/client/netfs.cpp 2010-07-21 23:07:52 UTC (rev 37671) +++ haiku/trunk/src/add-ons/kernel/file_systems/netfs/client/netfs.cpp 2010-07-21 23:10:57 UTC (rev 37672) @@ -21,9 +21,9 @@ static int netfs_mount(nspace_id nsid, const char *device, ulong flags, void *parameters, size_t len, void **data, vnode_id *rootID); static int netfs_unmount(void *ns); -static int netfs_sync(void *ns); +//static int netfs_sync(void *ns); static int netfs_read_fs_stat(void *ns, struct fs_info *info); -static int netfs_write_fs_stat(void *ns, struct fs_info *info, long mask); +//static int netfs_write_fs_stat(void *ns, struct fs_info *info, long mask); // vnodes static int netfs_read_vnode(void *ns, vnode_id vnid, char reenter, @@ -32,7 +32,7 @@ static int netfs_remove_vnode(void *ns, void *node, char reenter); // nodes -static int netfs_fsync(void *ns, void *node); +//static int netfs_fsync(void *ns, void *node); static int netfs_read_stat(void *ns, void *node, struct stat *st); static int netfs_write_stat(void *ns, void *node, struct stat *st, long mask); @@ -50,7 +50,7 @@ const void *buffer, size_t *bufferSize); static int netfs_ioctl(void *ns, void *node, void *cookie, int cmd, void *buffer, size_t bufferSize); -static int netfs_setflags(void *ns, void *node, void *cookie, int flags); +//static int netfs_setflags(void *ns, void *node, void *cookie, int flags); // hard links / symlinks static int netfs_link(void *ns, void *dir, const char *name, void *node); @@ -239,6 +239,8 @@ return B_OK; } +#if 0 // not used + // netfs_sync static int @@ -259,6 +261,8 @@ return error; } +#endif + // netfs_read_fs_stat static int @@ -279,6 +283,8 @@ return error; } +#if 0 // not used + // netfs_write_fs_stat static int @@ -299,6 +305,8 @@ return error; } +#endif + // #pragma mark - // #pragma mark ----- vnodes ----- @@ -355,6 +363,8 @@ // #pragma mark - // #pragma mark ----- nodes ----- +#if 0 // not used + // netfs_fsync static int @@ -367,6 +377,8 @@ return error; } +#endif + // netfs_read_stat static int Modified: haiku/trunk/src/add-ons/media/plugins/ac3_decoder/ac3_decoder.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ac3_decoder/ac3_decoder.cpp 2010-07-21 23:07:52 UTC (rev 37671) +++ haiku/trunk/src/add-ons/media/plugins/ac3_decoder/ac3_decoder.cpp 2010-07-21 23:10:57 UTC (rev 37672) @@ -43,7 +43,7 @@ { fInputBuffer = malloc(INPUT_BUFFER_MAX_SIZE); strcpy(fChannelInfo,"Unknown"); - + fState = a52_init(0); if (fState) { fSamples = a52_samples(fState); @@ -84,7 +84,7 @@ TRACE("AC3Decoder::Setup: couldn't get stream info\n"); return B_ERROR; } - + // Sample offsets of the output buffer are stored in fInterleaveOffset // When a channel is not present, it is skipped, the rest is shifted left // The block of samples order presented by liba52 is @@ -253,7 +253,7 @@ ioDecodedFormat->u.raw_audio.buffer_size = 6 * 256 * fFrameSize; ioDecodedFormat->u.raw_audio.channel_mask = fChannelMask; - + TRACE("AC3Decoder::NegotiateOutputFormat: fFlags 0x%x, fFrameRate %d, fBitRate %d, fChannelCount %d, fFrameSize %d\n", fFlags, fFrameRate, fBitRate, fChannelCount, fFrameSize); return B_OK; @@ -267,7 +267,7 @@ { fInputChunkSize = 0; fInputBufferSize = 0; - + TRACE("AC3Decoder::Seek called\n"); if (seekTo == B_MEDIA_SEEK_TO_TIME) { @@ -297,7 +297,7 @@ TRACE("AC3Decoder::Decode: DecodeNext failed\n"); return B_ERROR; } - + /* Every A/52 frame is composed of 6 blocks, each with an output of 256 samples for each channel. The a52_block() function decodes the next @@ -305,10 +305,10 @@ audio in the frame. After each call, you should extract the audio data from the sample buffer. */ - + // fInterleaveOffset[] is used to provide a correct interleave of // multi channel audio - + for (int i = 0; i < 6; i++) { a52_block(fState); for (int j = 0; j < fChannelCount; j++) { @@ -320,7 +320,7 @@ } } } - + mediaHeader->start_time = fStartTime; mediaHeader->type = B_MEDIA_RAW_AUDIO; mediaHeader->size_used = 6 * 256 * fFrameSize; @@ -344,7 +344,8 @@ return true; } if (fInputChunkSize > 0) { - int bytes = min_c(size - fInputBufferSize, fInputChunkSize); + int bytes + = min_c((size_t)(size - fInputBufferSize), fInputChunkSize); memcpy((char *)fInputBuffer + fInputBufferSize, (char *)fInputChunk + fInputChunkOffset, bytes); fInputChunkOffset += bytes; fInputChunkSize -= bytes; @@ -368,7 +369,7 @@ AC3Decoder::InputRemoveData(int size) { fInputBufferSize -= size; - + if (fInputBufferSize) memmove(fInputBuffer, (char *)fInputBuffer + size, fInputBufferSize); } @@ -398,9 +399,9 @@ TRACE("AC3Decoder::DecodeNext: can't get 7 bytes\n"); return false; } - + int flags, sample_rate, bit_rate; - + int bytes = a52_syncinfo((uint8_t *)input, &flags, &sample_rate, &bit_rate); if (bytes == 0) { TRACE("AC3Decoder::DecodeNext: syncinfo failed\n"); @@ -414,23 +415,23 @@ TRACE("AC3Decoder::DecodeNext: can't get %d data bytes\n", bytes); return false; } - + // printf("fFlags 0x%x, flags 0x%x\n", fFlags, flags); - + flags = fFlags | A52_ADJUST_LEVEL; sample_t level = 1.0; if (0 != a52_frame(fState, (uint8_t *)input, &flags, &level, 0)) { TRACE("AC3Decoder::DecodeNext: a52_frame failed\n"); return false; } - + TRACE("decoded %d bytes, flags 0x%x\n", bytes, fFlags); InputRemoveData(bytes); - + if (fDisableDynamicCompression) a52_dynrng(fState, NULL, 0); - + return true; } } Modified: haiku/trunk/src/servers/bluetooth/DeviceManager.cpp =================================================================== --- haiku/trunk/src/servers/bluetooth/DeviceManager.cpp 2010-07-21 23:07:52 UTC (rev 37671) +++ haiku/trunk/src/servers/bluetooth/DeviceManager.cpp 2010-07-21 23:10:57 UTC (rev 37672) @@ -35,16 +35,16 @@ entry_ref ref; const char *name; BDirectory dir; - + Output::Instance()->Post("Something new in the bus ... ", BLACKBOARD_DEVICEMANAGER); - + if ((msg->FindInt32("device", &ref.device)!=B_OK) || (msg->FindInt64("directory", &ref.directory)!=B_OK) || (msg->FindString("name", &name) != B_OK)) return; - + Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER, " -> %s\n", name); - + ref.set_name(name); // Check if the entry is a File or a directory @@ -53,7 +53,7 @@ node_ref nref; dir.GetNodeRef(&nref); AddDirectory(&nref); - + } else { printf("%s: Entry %s is taken as a file\n", __FUNCTION__, name); AddDevice(&ref); @@ -64,8 +64,8 @@ { Output::Instance()->Post("Something removed from the bus ...\n", BLACKBOARD_DEVICEMANAGER); - - } + + } break; case B_STAT_CHANGED: case B_ATTR_CHANGED: @@ -95,13 +95,13 @@ Output::Instance()->Post("AddDirectory::watch_node Failed\n", BLACKBOARD_DEVICEMANAGER); return status; } - + // BPath path(*nref); // BString str(path.Path()); -// -// Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER, +// +// Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER, // "Exploring entries in %s\n", str.String()); - + entry_ref ref; status_t error; while ((error = directory.GetNextRef(&ref)) == B_OK) { @@ -109,7 +109,7 @@ AddDevice(&ref); } - Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER, + Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER, "Finished exploring entries(%s)\n", strerror(error)); return (error == B_OK || error == B_ENTRY_NOT_FOUND)?B_OK:error; @@ -285,8 +285,8 @@ return err; // test if still monitored +/* bool stillMonitored = false; -/* int32 i = 0; while ((tmpaddon = (_BDeviceAddOn_ *)fDeviceAddons.ItemAt(i++)) !=NULL) { if (addon == tmpaddon)