[haiku-commits] BRANCH jessicah-github.fixing-warnings [69f687ba5cea] in src: bin bin/debug/profile bin/mkdos add-ons/kernel/drivers/audio/ac97/auvia bin/mail_utils

  • From: jessicah-github.fixing-warnings <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 13 Apr 2017 12:00:36 +0200 (CEST)

added 1 changeset to branch 'refs/remotes/jessicah-github/fixing-warnings'
old head: 0000000000000000000000000000000000000000
new head: 69f687ba5ceab5456740800088392639822a2cc3
overview: https://github.com/jessicah/haiku/compare/69f687ba5cea

----------------------------------------------------------------------------

69f687ba5cea: Fix warning -Wformat=

                         [ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

----------------------------------------------------------------------------

Commit:      69f687ba5ceab5456740800088392639822a2cc3
Author:      Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date:        Mon Jan 23 15:51:15 2017 UTC

----------------------------------------------------------------------------

51 files changed, 536 insertions(+), 469 deletions(-)
build/jam/ArchitectureRules                      |   2 +
src/add-ons/kernel/drivers/audio/ac97/ac97.c     |  10 +-
.../kernel/drivers/audio/ac97/auich/auich.c      |  15 +-
.../kernel/drivers/audio/ac97/auich/multi.c      |   9 +-
.../kernel/drivers/audio/ac97/auvia/auvia.c      | 192 +++++++++----------
.../kernel/drivers/audio/ac97/auvia/multi.c      |  10 +-
.../drivers/audio/ac97/sis7018/Settings.cpp      |   2 +-
src/add-ons/kernel/drivers/audio/emuxki/emuxki.c |  21 +-
src/add-ons/kernel/drivers/audio/emuxki/multi.c  |  11 +-
src/add-ons/kernel/drivers/audio/hda/driver.h    |   4 +-
.../drivers/power/acpi_button/acpi_button.cpp    |   2 +-
.../kernel/file_systems/bindfs/DebugSupport.h    |  11 +-
src/add-ons/kernel/file_systems/ntfs/fs_func.c   |   2 +-
.../media/media-add-ons/usb_webcam/Producer.cpp  |  27 +--
.../video_producer_demo/Producer.cpp             |  73 +++----
src/add-ons/media/plugins/ffmpeg/gfx_util.cpp    |  10 +-
src/bin/debug/profile/BasicProfileResult.cpp     |  28 +--
src/bin/debug/profile/CallgrindProfileResult.cpp |  39 ++--
src/bin/debug/profile/SharedImage.cpp            |   7 +-
src/bin/debug/profile/Team.cpp                   |  18 +-
src/bin/debug/profile/profile.cpp                |   2 +-
src/bin/listfont.cpp                             |   4 +-
src/bin/listimage.c                              |   7 +-
src/bin/listport.c                               |  31 +--
src/bin/listres.cpp                              |   6 +-
src/bin/lsindex.cpp                              |  38 ++--
src/bin/mail_utils/mail2mbox.cpp                 |   2 +-
src/bin/mail_utils/spamdbm.cpp                   |  42 ++--
src/bin/mkdos/mkdos.cpp                          | 118 +++++++-----
src/bin/network/ftpd/ftpcmd.y                    |   7 +-
src/bin/network/ftpd/ftpd.c                      |  11 +-
src/bin/network/ifconfig/ifconfig.cpp            |   8 +-
src/bin/network/netstat/netstat.cpp              |   4 +-
src/bin/playsound/playsound.cpp                  |  66 ++++---
src/bin/screenmode/screenmode.cpp                |  13 +-
src/bin/setdecor.cpp                             |   8 +-
src/bin/shutdown.cpp                             |   2 +-
src/bin/top.cpp                                  |   8 +-
src/bin/uptime.cpp                               |  30 +--
src/bin/version.cpp                              |  18 +-
src/bin/vmstat.cpp                               |  17 +-
src/libs/agg/src/agg_trans_double_path.cpp       |  32 ++--
.../compat/freebsd_network/fbsd_busdma_x86.c     |  10 +-
src/libs/glut/glutGameMode.cpp                   |   2 +-
src/libs/gnu/xattr.cpp                           |   2 +-
src/libs/util/pidfile.c                          |   7 +-
src/system/kernel/fs/node_monitor.cpp            |   3 +-
src/tests/kits/net/tcptester/tcptester.cpp       |   2 +-
src/tools/gensyscalls/gensyscallinfos.cpp        |   2 +-
src/tools/locale/DefaultCatalog.cpp              |   6 +-
src/tools/locale/collectcatkeys.cpp              |   4 +-

----------------------------------------------------------------------------

diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules
index e55eba9..e8db60b 100644
--- a/build/jam/ArchitectureRules
+++ b/build/jam/ArchitectureRules
@@ -665,6 +665,8 @@ rule ArchitectureSetupWarnings architecture
        EnableWerror src system libroot posix locale ;
        EnableWerror src system libroot posix wchar ;
        EnableWerror src system runtime_loader ;
+#      EnableWerror src tests ;
+#      EnableWerror src tools ;
 }
 
 
diff --git a/src/add-ons/kernel/drivers/audio/ac97/ac97.c 
b/src/add-ons/kernel/drivers/audio/ac97/ac97.c
index 72f7130..add1194 100644
--- a/src/add-ons/kernel/drivers/audio/ac97/ac97.c
+++ b/src/add-ons/kernel/drivers/audio/ac97/ac97.c
@@ -313,7 +313,7 @@ ac97_attach(ac97_dev **_dev, codec_reg_read reg_read, 
codec_reg_write reg_write,
        /* set record line in */
        ac97_reg_update(dev, AC97_RECORD_SELECT, 0x0404);
 
-       LOG(("codec vendor id      = %#08lx\n", dev->codec_id));
+       LOG(("codec vendor id      = %#08" B_PRIx32 "\n", dev->codec_id));
        LOG(("codec description     = %s\n", dev->codec_info));
        LOG(("codec 3d enhancement = %s\n", dev->codec_3d_stereo_enhancement));
 
@@ -438,7 +438,8 @@ ac97_set_rate(ac97_dev *dev, uint8 reg, uint32 rate)
 
        value = (uint32)((rate * 48000ULL) / dev->clock); /* need 64 bit 
calculation for rates 96000 or higher */
 
-       LOG(("ac97_set_rate: clock = %ld, rate = %ld, value = %ld\n", 
dev->clock, rate, value));
+       LOG(("ac97_set_rate: clock = %" B_PRIu32 ", rate = %" B_PRIu32
+               ", value = %" B_PRIu32 "\n", dev->clock, rate, value));
 
        /* if double rate audio is currently enabled, divide value by 2 */
        if (ac97_reg_cached_read(dev, AC97_EXTENDED_STAT_CTRL) & 0x0002)
@@ -483,7 +484,7 @@ ac97_get_rate(ac97_dev *dev, uint8 reg, uint32 *rate)
 void
 ac97_set_clock(ac97_dev *dev, uint32 clock)
 {
-       LOG(("ac97_set_clock: clock = %ld\n", clock));
+       LOG(("ac97_set_clock: clock = %" B_PRIu32 "\n", clock));
        dev->clock = clock;
        ac97_detect_rates(dev);
        ac97_dump_capabilities(dev);
@@ -756,7 +757,8 @@ ad1819_set_rate(ac97_dev *dev, uint8 reg, uint32 rate)
 
        value = (uint32)((rate * 48000ULL) / dev->clock); /* need 64 bit 
calculation for rates 96000 or higher */
 
-       LOG(("ad1819_set_rate: clock = %ld, rate = %ld, value = %ld\n", 
dev->clock, rate, value));
+       LOG(("ad1819_set_rate: clock = %" B_PRIu32 ", rate = %" B_PRIu32
+               ", value = %" B_PRIu32 "\n", dev->clock, rate, value));
 
        if (value < 0x1B58 || value > 0xBB80)
                return false;
diff --git a/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c 
b/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c
index 7c1da40..7ac9952 100644
--- a/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c
+++ b/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c
@@ -195,10 +195,10 @@ auich_stream_commit_parms(auich_stream *stream)
        auich_reg_write_8(&stream->card->config, stream->base + AUICH_REG_X_CR, 
0);
        snooze(10000); // 10 ms
 
-       auich_reg_write_8(&stream->card->config, 
+       auich_reg_write_8(&stream->card->config,
                stream->base + AUICH_REG_X_CR, CR_RR);
        for (i = 10000; i > 0; i--) {
-               if (0 == auich_reg_read_8(&stream->card->config, 
+               if (0 == auich_reg_read_8(&stream->card->config,
                        stream->base + AUICH_REG_X_CR)) {
                        LOG(("channel reset finished, %x, %d\n", stream->base, 
i));
                        break;
@@ -459,11 +459,12 @@ auich_int(void *arg)
                        }
 
                if (sta != 0) {
-                       dprintf("global status not fully handled %lx!\n", sta);
+                       dprintf("global status not fully handled %" B_PRIx32 
"!\n", sta);
                        auich_reg_write_32(&card->config, AUICH_REG_GLOB_STA, 
sta);
                }
        } else if (sta != 0) {
-               dprintf("interrupt masked %lx, sta %lx\n", 
card->interrupt_mask, sta);
+               dprintf("interrupt masked %" B_PRIx32 ", sta %" B_PRIx32 "\n",
+                       card->interrupt_mask, sta);
        }
 
        if (gotone)
@@ -637,7 +638,7 @@ auich_setup(auich_dev * card)
        if (card->info.device_id == SIS_SI7012_AC97_DEVICE_ID)
                card->config.type |= TYPE_SIS7012;
 
-       PRINT(("%s deviceid = %#04x chiprev = %x model = %x enhanced at %lx\n",
+       PRINT(("%s deviceid = %#04x chiprev = %x model = %x enhanced at %" 
B_PRIx32 "\n",
                card->name, card->info.device_id, card->info.revision,
                card->info.u.h0.subsystem_id, card->config.nabmbar));
 
@@ -730,7 +731,7 @@ auich_setup(auich_dev * card)
                        "auich interrupt poller", B_REAL_TIME_PRIORITY, card);
                resume_thread(int_thread_id);
        } else {
-               PRINT(("installing interrupt : %lx\n", card->config.irq));
+               PRINT(("installing interrupt : %" B_PRIx32 "\n", 
card->config.irq));
                err = install_io_interrupt_handler(card->config.irq, auich_int,
                        card, 0);
                if (err != B_OK) {
@@ -818,7 +819,7 @@ init_driver(void)
                        }
 #endif
                        if (auich_setup(&cards[num_cards])) {
-                               PRINT(("Setup of auich %ld failed\n", 
num_cards+1));
+                               PRINT(("Setup of auich %" B_PRId32 " failed\n", 
num_cards+1));
 #ifdef __HAIKU__
                                (*pci->unreserve_device)(info.bus, info.device, 
info.function,
                                        DRIVER_NAME, &cards[num_cards]);
diff --git a/src/add-ons/kernel/drivers/audio/ac97/auich/multi.c 
b/src/add-ons/kernel/drivers/audio/ac97/auich/multi.c
index b12b646..a946ddf 100644
--- a/src/add-ons/kernel/drivers/audio/ac97/auich/multi.c
+++ b/src/add-ons/kernel/drivers/audio/ac97/auich/multi.c
@@ -394,7 +394,8 @@ auich_get_mix(auich_dev *card, multi_mix_value_info * mmvi)
        for (i = 0; i < mmvi->item_count; i++) {
                id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
                if (id < 0 || id >= card->multi.control_count) {
-                       PRINT(("auich_get_mix : invalid control id requested : 
%li\n", id));
+                       PRINT(("auich_get_mix : invalid control id requested : "
+                               "%" B_PRId32 "\n", id));
                        continue;
                }
                control = &card->multi.controls[id];
@@ -434,7 +435,8 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
        for (i = 0; i < mmvi->item_count; i++) {
                id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
                if (id < 0 || id >= card->multi.control_count) {
-                       PRINT(("auich_set_mix : invalid control id requested : 
%li\n", id));
+                       PRINT(("auich_set_mix : invalid control id requested : "
+                               "%" B_PRId32 "\n", id));
                        continue;
                }
                control = &card->multi.controls[id];
@@ -444,7 +446,8 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
                        if (i+1<mmvi->item_count) {
                                id = mmvi->values[i + 1].id - 
EMU_MULTI_CONTROL_FIRSTID;
                                if (id < 0 || id >= card->multi.control_count) {
-                                       PRINT(("auich_set_mix : invalid control 
id requested : %li\n", id));
+                                       PRINT(("auich_set_mix : invalid control 
id requested : "
+                                               "%" B_PRId32 "\n", id));
                                } else {
                                        control2 = &card->multi.controls[id];
                                        if (control2->mix_control.master != 
control->mix_control.id)
diff --git a/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.c 
b/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.c
index bc74378..d78e7ab 100644
--- a/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.c
+++ b/src/add-ons/kernel/drivers/audio/ac97/auvia/auvia.c
@@ -2,7 +2,7 @@
  * Auvia BeOS Driver for Via VT82xx Southbridge audio
  *
  * Copyright (c) 2003, Jerome Duval (jerome.duval@xxxxxxx)

+
  * This code is derived from software contributed to The NetBSD Foundation
  * by Tyler C. Sarna
  *
@@ -34,7 +34,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */

+
 #include <KernelExport.h>
 #include <PCI.h>
 #include <string.h>
@@ -96,7 +96,7 @@ static void *
 auvia_mem_alloc(auvia_dev *card, size_t size)
 {
        auvia_mem *mem;
-       
+
        mem = auvia_mem_new(card, size);
        if (mem == NULL)
                return (NULL);
@@ -111,12 +111,12 @@ static void
 auvia_mem_free(auvia_dev *card, void *ptr)
 {
        auvia_mem               *mem;
-       
+
        LIST_FOREACH(mem, &card->mems, next) {
                if (mem->log_base != ptr)
                        continue;
                LIST_REMOVE(mem, next);
-               
+
                auvia_mem_delete(mem);
                break;
        }
@@ -132,27 +132,27 @@ auvia_stream_set_audioparms(auvia_stream *stream, uint8 
channels,
        LOG(("auvia_stream_set_audioparms\n"));
 
        if ((stream->channels == channels) &&
-               (stream->b16 == b16) && 
+               (stream->b16 == b16) &&
                (stream->sample_rate == sample_rate))
                return B_OK;
-       
+
        if(stream->buffer)
                auvia_mem_free(stream->card, stream->buffer->log_base);
-               
+
        stream->b16 = b16;
        stream->sample_rate = sample_rate;
        stream->channels = channels;
-       
+
        sample_size = stream->b16 + 1;
        frame_size = sample_size * stream->channels;
-       
-       stream->buffer = auvia_mem_alloc(stream->card, stream->bufframes 
+
+       stream->buffer = auvia_mem_alloc(stream->card, stream->bufframes
                * frame_size * stream->bufcount);
-       
+
        stream->trigblk = 0;    /* This shouldn't be needed */
        stream->blkmod = stream->bufcount;
        stream->blksize = stream->bufframes * frame_size;
-               
+
        return B_OK;
 }
 
@@ -164,72 +164,72 @@ auvia_stream_commit_parms(auvia_stream *stream)
        uint32          *page;
        uint32                  value;
        LOG(("auvia_stream_commit_parms\n"));
-       
+
        page = stream->dmaops_log_base;
-       
+
        for(i = 0; i < stream->bufcount; i++) {
-               page[2*i] = ((uint32)stream->buffer->phy_base) + 
+               page[2*i] = ((uint32)stream->buffer->phy_base) +
                        i * stream->blksize;
                page[2*i + 1] = AUVIA_DMAOP_FLAG | stream->blksize;
        }
-       
+
        page[2*stream->bufcount - 1] &= ~AUVIA_DMAOP_FLAG;
        page[2*stream->bufcount - 1] |= AUVIA_DMAOP_EOL;
-       
-       auvia_reg_write_32(&stream->card->config, stream->base + 
AUVIA_RP_DMAOPS_BASE, 
+
+       auvia_reg_write_32(&stream->card->config, stream->base + 
AUVIA_RP_DMAOPS_BASE,
                (uint32)stream->dmaops_phy_base);
-               
+
        if(stream->use & AUVIA_USE_RECORD)
-               auvia_codec_write(&stream->card->config, AC97_PCM_L_R_ADC_RATE, 
+               auvia_codec_write(&stream->card->config, AC97_PCM_L_R_ADC_RATE,
                        (uint16)stream->sample_rate);
        else
-               auvia_codec_write(&stream->card->config, 
AC97_PCM_FRONT_DAC_RATE, 
+               auvia_codec_write(&stream->card->config, 
AC97_PCM_FRONT_DAC_RATE,
                        (uint16)stream->sample_rate);
-       
+
        if(IS_8233(&stream->card->config)) {
                if(stream->base != AUVIA_8233_MP_BASE) {
-                       value = auvia_reg_read_32(&stream->card->config, 
stream->base 
+                       value = auvia_reg_read_32(&stream->card->config, 
stream->base
                                + AUVIA_8233_RP_RATEFMT);
-                       value &= ~(AUVIA_8233_RATEFMT_48K | 
AUVIA_8233_RATEFMT_STEREO 
+                       value &= ~(AUVIA_8233_RATEFMT_48K | 
AUVIA_8233_RATEFMT_STEREO
                                | AUVIA_8233_RATEFMT_16BIT);
                        if(stream->use & AUVIA_USE_PLAY)
-                               value |= AUVIA_8233_RATEFMT_48K * 
(stream->sample_rate / 20) 
+                               value |= AUVIA_8233_RATEFMT_48K * 
(stream->sample_rate / 20)
                                        / (48000 / 20);
                        value |= (stream->channels == 2 ? 
AUVIA_8233_RATEFMT_STEREO : 0)
                                | (stream->b16 ? AUVIA_8233_RATEFMT_16BIT : 0);
-                       auvia_reg_write_32(&stream->card->config, stream->base 
+                       auvia_reg_write_32(&stream->card->config, stream->base
                                + AUVIA_8233_RP_RATEFMT, value);
                } else {
-                       static const uint32 slottab[7] = {0, 0xff000011, 
0xff000021, 
+                       static const uint32 slottab[7] = {0, 0xff000011, 
0xff000021,
                                0xff000521, 0xff004321, 0xff054321, 0xff654321};
                        value = (stream->b16 ? AUVIA_8233_MP_FORMAT_16BIT : 
AUVIA_8233_MP_FORMAT_8BIT)
                                | ((stream->channels << 4) & 
AUVIA_8233_MP_FORMAT_CHANNEL_MASK) ;
-                       auvia_reg_write_8(&stream->card->config, stream->base 
+                       auvia_reg_write_8(&stream->card->config, stream->base
                                + AUVIA_8233_OFF_MP_FORMAT, value);
-                       auvia_reg_write_32(&stream->card->config, stream->base 
+                       auvia_reg_write_32(&stream->card->config, stream->base
                                + AUVIA_8233_OFF_MP_STOP, 
slottab[stream->channels]);
                }
        }
        //auvia_codec_write(&stream->card->config, AC97_SPDIF_CONTROL, 
(uint16)stream->sample_rate);
-               
+
        return B_OK;
 }
 
 
 status_t
-auvia_stream_get_nth_buffer(auvia_stream *stream, uint8 chan, uint8 buf, 
+auvia_stream_get_nth_buffer(auvia_stream *stream, uint8 chan, uint8 buf,
                                        char** buffer, size_t *stride)
 {
        uint8                   sample_size, frame_size;
        LOG(("auvia_stream_get_nth_buffer\n"));
-       
+
        sample_size = stream->b16 + 1;
        frame_size = sample_size * stream->channels;
-       
+
        *buffer = stream->buffer->log_base + (buf * stream->bufframes * 
frame_size)
                + chan * sample_size;
        *stride = frame_size;
-       
+
        return B_OK;
 }
 
@@ -254,18 +254,18 @@ void
 auvia_stream_start(auvia_stream *stream, void (*inth) (void *), void 
*inthparam)
 {
        LOG(("auvia_stream_start\n"));
-       
+
        stream->inth = inth;
        stream->inthparam = inthparam;
-               
+
        stream->state |= AUVIA_STATE_STARTED;
-       
+
        if(IS_8233(&stream->card->config)) {
                if(stream->base != AUVIA_8233_MP_BASE) {
                        auvia_reg_write_8(&stream->card->config, stream->base + 
AUVIA_8233_RP_DXS_LVOL, 0);
                        auvia_reg_write_8(&stream->card->config, stream->base + 
AUVIA_8233_RP_DXS_RVOL, 0);
                }
-               auvia_reg_write_8(&stream->card->config, stream->base + 
AUVIA_RP_CONTROL, 
+               auvia_reg_write_8(&stream->card->config, stream->base + 
AUVIA_RP_CONTROL,
                        AUVIA_RPCTRL_START | AUVIA_RPCTRL_AUTOSTART | 
AUVIA_RPCTRL_STOP
                        | AUVIA_RPCTRL_EOL | AUVIA_RPCTRL_FLAG);
        } else {
@@ -283,10 +283,10 @@ void
 auvia_stream_halt(auvia_stream *stream)
 {
        LOG(("auvia_stream_halt\n"));
-                       
+
        stream->state &= ~AUVIA_STATE_STARTED;
-       
-       auvia_reg_write_8(&stream->card->config, stream->base + 
AUVIA_RP_CONTROL, 
+
+       auvia_reg_write_8(&stream->card->config, stream->base + 
AUVIA_RP_CONTROL,
                AUVIA_RPCTRL_TERMINATE);
 }
 
@@ -315,7 +315,7 @@ auvia_stream_new(auvia_dev *card, uint8 use, uint32 
bufframes, uint8 bufcount)
        stream->blksize = 0;
        stream->trigblk = 0;
        stream->blkmod = 0;
-       
+
        if(use & AUVIA_USE_PLAY) {
                if(IS_8233(&card->config))
                        stream->base = AUVIA_8233_MP_BASE;
@@ -328,26 +328,26 @@ auvia_stream_new(auvia_dev *card, uint8 use, uint32 
bufframes, uint8 bufcount)
                else
                        stream->base = AUVIA_RECORD_BASE;
        }
-               
+
        stream->frames_count = 0;
        stream->real_time = 0;
        stream->buffer_cycle = 0;
        stream->update_needed = false;
-       
+
        /* allocate memory for our dma ops */
-       stream->dmaops_area = alloc_mem(&stream->dmaops_phy_base, 
&stream->dmaops_log_base, 
+       stream->dmaops_area = alloc_mem(&stream->dmaops_phy_base, 
&stream->dmaops_log_base,
                VIA_TABLE_SIZE, "auvia dmaops");
-               
+
        if (stream->dmaops_area < B_OK) {
                PRINT(("couldn't allocate memory\n"));
                free(stream);
-               return NULL;    
+               return NULL;
        }
 
        status = lock();
        LIST_INSERT_HEAD((&card->streams), stream, next);
        unlock(status);
-       
+
        return stream;
 }
 
@@ -357,61 +357,61 @@ auvia_stream_delete(auvia_stream *stream)
 {
        cpu_status status;
        LOG(("auvia_stream_delete\n"));
-       
+
        auvia_stream_halt(stream);
-       
+
        auvia_reg_write_32(&stream->card->config, stream->base + 
AUVIA_RP_DMAOPS_BASE, 0);
-       
+
        if (stream->dmaops_area > B_OK)
                delete_area(stream->dmaops_area);
-               
+
        if(stream->buffer)
                auvia_mem_free(stream->card, stream->buffer->log_base);
-       
+
        status = lock();
        LIST_REMOVE(stream, next);
        unlock(status);
-       
+
        free(stream);
 }
 
 /* Auvia interrupt */
 
-static int32 
+static int32
 auvia_int(void *arg)
 {
        auvia_dev        *card = arg;
        bool gotone = false;
        uint32       curblk;
        auvia_stream *stream;
-       
-       if(auvia_reg_read_32(&card->config, AUVIA_SGD_SHADOW) 
+
+       if(auvia_reg_read_32(&card->config, AUVIA_SGD_SHADOW)
                & card->interrupt_mask) {
-       
+
                LIST_FOREACH(stream, &card->streams, next)
                        if(auvia_reg_read_8(&card->config, stream->base + 
AUVIA_RP_STAT) & AUVIA_RPSTAT_INTR) {
                                gotone = true;
                                //TRACE(("interrupt\n"));
-                               
+
                                curblk = auvia_stream_curaddr(stream);
                                TRACE(("RPSTAT_INTR at trigblk %lu, 
stream->trigblk %lu\n", curblk, stream->trigblk));
                                if (curblk == stream->trigblk) {
                                        //TRACE(("AUVIA_RPSTAT_INTR at trigblk 
%lu\n", curblk));
-                                               
+
                                        if(stream->inth)
                                                stream->inth(stream->inthparam);
-                                               
+
                                        stream->trigblk++;
                                        stream->trigblk %= stream->blkmod;
-                               }                               
-                               
+                               }
+
                                auvia_reg_write_8(&card->config, stream->base + 
AUVIA_RP_STAT, AUVIA_RPSTAT_INTR);
                        }
        } else {
-               TRACE(("SGD_SHADOW %x %x\n", card->interrupt_mask, 
+               TRACE(("SGD_SHADOW %x %x\n", card->interrupt_mask,
                        auvia_reg_read_32(&card->config, AUVIA_SGD_SHADOW)));
        }
-       
+
        if(gotone)
                return B_INVOKE_SCHEDULER;
 
@@ -422,13 +422,13 @@ auvia_int(void *arg)
 /*     Auvia driver functions */
 
 /* detect presence of our hardware */
-status_t 
+status_t
 init_hardware(void)
 {
        int ix=0;
        pci_info info;
        status_t err = ENODEV;
-       
+
        LOG_CREATE();
 
        PRINT(("init_hardware()\n"));
@@ -445,7 +445,7 @@ init_hardware(void)
                }
                ix++;
        }
-               
+
        put_module(B_PCI_MODULE_NAME);
 
        return err;
@@ -467,22 +467,22 @@ auvia_init(auvia_dev * card)
 {
        uint32 pr;
 
-       pr = (*pci->read_pci_config)(card->info.bus, card->info.device, 
+       pr = (*pci->read_pci_config)(card->info.bus, card->info.device,
                card->info.function, AUVIA_PCICONF_JUNK, 4);
-       PRINT(("AUVIA_PCICONF_JUNK before: %lx\n", pr));
+       PRINT(("AUVIA_PCICONF_JUNK before: %" B_PRIx32 "\n", pr));
        pr &= ~AUVIA_PCICONF_ENABLES;
-       pr |= AUVIA_PCICONF_ACLINKENAB | AUVIA_PCICONF_ACNOTRST 
+       pr |= AUVIA_PCICONF_ACLINKENAB | AUVIA_PCICONF_ACNOTRST
                | AUVIA_PCICONF_ACVSR | AUVIA_PCICONF_ACSGD;
        pr &= ~(AUVIA_PCICONF_ACFM | AUVIA_PCICONF_ACSB);
-       (*pci->write_pci_config)(card->info.bus, card->info.device, 
+       (*pci->write_pci_config)(card->info.bus, card->info.device,
                card->info.function, AUVIA_PCICONF_JUNK, 4, pr );
-       snooze(100); 
-       pr = (*pci->read_pci_config)(card->info.bus, card->info.device, 
+       snooze(100);
+       pr = (*pci->read_pci_config)(card->info.bus, card->info.device,
                card->info.function, AUVIA_PCICONF_JUNK, 4);
-       PRINT(("AUVIA_PCICONF_JUNK after: %lx\n", pr));
+       PRINT(("AUVIA_PCICONF_JUNK after: %" B_PRIx32 "\n", pr));
 
        if(IS_8233(&card->config)) {
-               card->interrupt_mask = 
+               card->interrupt_mask =
                        AUVIA_8233_SGD_STAT_FLAG_EOL |
                        AUVIA_8233_SGD_STAT_FLAG_EOL << 4 |
                        AUVIA_8233_SGD_STAT_FLAG_EOL << 8 |
@@ -494,13 +494,13 @@ auvia_init(auvia_dev * card)
                card->interrupt_mask = AUVIA_SGD_STAT_ALL | (AUVIA_SGD_STAT_ALL 
<< 4);
        }
 
-       
+
        /* Init streams list */
        LIST_INIT(&(card->streams));
-       
+
        /* Init mems list */
        LIST_INIT(&(card->mems));
-       
+
        return B_OK;
 }
 
@@ -519,11 +519,11 @@ auvia_setup(auvia_dev * card)
 {
        status_t err = B_OK;
        unsigned char cmd;
-       
+
        PRINT(("auvia_setup(%p)\n", card));
 
        make_device_names(card);
-       
+
        card->config.subvendor_id = card->info.u.h0.subsystem_vendor_id;
        card->config.subsystem_id = card->info.u.h0.subsystem_id;
        card->config.nabmbar = card->info.u.h0.base_registers[0];
@@ -533,17 +533,17 @@ auvia_setup(auvia_dev * card)
                card->config.type |= TYPE_686;
        if(card->info.device_id == VIATECH_8233_AC97_DEVICE_ID)
                card->config.type |= TYPE_8233;
-       
-       PRINT(("%s deviceid = %#04x chiprev = %x model = %x enhanced at %lx\n", 
-               card->name, card->info.device_id, card->info.revision, 
+
+       PRINT(("%s deviceid = %#04x chiprev = %x model = %x enhanced at %" 
B_PRIx32 "\n",
+               card->name, card->info.device_id, card->info.revision,
                card->info.u.h0.subsystem_id, card->config.nabmbar));
-               
-       cmd = (*pci->read_pci_config)(card->info.bus, card->info.device, 
+
+       cmd = (*pci->read_pci_config)(card->info.bus, card->info.device,
                card->info.function, PCI_command, 2);
        PRINT(("PCI command before: %x\n", cmd));
-       (*pci->write_pci_config)(card->info.bus, card->info.device, 
+       (*pci->write_pci_config)(card->info.bus, card->info.device,
                card->info.function, PCI_command, 2, cmd | PCI_command_io);
-       cmd = (*pci->read_pci_config)(card->info.bus, card->info.device, 
+       cmd = (*pci->read_pci_config)(card->info.bus, card->info.device,
                card->info.function, PCI_command, 2);
        PRINT(("PCI command after: %x\n", cmd));
 
@@ -553,19 +553,19 @@ auvia_setup(auvia_dev * card)
                (codec_reg_write)auvia_codec_write, &card->config,
                card->config.subvendor_id, card->config.subsystem_id);
 
-       PRINT(("installing interrupt : %lx\n", card->config.irq));
+       PRINT(("installing interrupt : %" B_PRIx32 "\n", card->config.irq));
        err = install_io_interrupt_handler(card->config.irq, auvia_int, card, 
0);
        if (err != B_OK) {
                PRINT(("failed to install interrupt\n"));
                ac97_detach(card->config.ac97);
                return err;
        }
-               
+
        if ((err = auvia_init(card))) {
                auvia_shutdown(card);
                return err;
        }
-               
+
        PRINT(("init_driver done\n"));
 
        return err;
@@ -584,10 +584,10 @@ init_driver(void)
 
        if (get_module(B_PCI_MODULE_NAME, (module_info **)&pci))
                return ENOSYS;
-               
+
        while ((*pci->get_nth_pci_info)(ix++, &info) == B_OK) {
                if (info.vendor_id == VIATECH_VENDOR_ID &&
-                       (info.device_id == VIATECH_82C686_AC97_DEVICE_ID 
+                       (info.device_id == VIATECH_82C686_AC97_DEVICE_ID
                        || info.device_id == VIATECH_8233_AC97_DEVICE_ID
                        )) {
                        if (num_cards == NUM_CARDS) {
@@ -606,7 +606,7 @@ init_driver(void)
                        }
 #endif
                        if (auvia_setup(&cards[num_cards])) {
-                               PRINT(("Setup of auvia %ld failed\n", 
num_cards+1));
+                               PRINT(("Setup of auvia %" B_PRId32 " failed\n", 
num_cards+1));
 #ifdef __HAIKU__
                                (*pci->unreserve_device)(info.bus, info.device, 
info.function,
                                        DRIVER_NAME, &cards[num_cards]);
@@ -624,7 +624,7 @@ init_driver(void)
                return ENODEV;
        }
 
-       
+
 #if DEBUG
        //add_debugger_command("auvia", auvia_debug, "auvia [card# (1-n)]");
 #endif
diff --git a/src/add-ons/kernel/drivers/audio/ac97/auvia/multi.c 
b/src/add-ons/kernel/drivers/audio/ac97/auvia/multi.c
index 0cfd2a1..deac618 100644
--- a/src/add-ons/kernel/drivers/audio/ac97/auvia/multi.c
+++ b/src/add-ons/kernel/drivers/audio/ac97/auvia/multi.c
@@ -390,7 +390,7 @@ auvia_create_controls_list(multi_dev *multi)
        }
 
        multi->control_count = index;
-       PRINT(("multi->control_count %lu\n", multi->control_count));
+       PRINT(("multi->control_count %" B_PRIu32 "\n", multi->control_count));
        return B_OK;
 }
 
@@ -403,7 +403,7 @@ auvia_get_mix(auvia_dev *card, multi_mix_value_info * mmvi)
        for (i = 0; i < mmvi->item_count; i++) {
                id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
                if (id < 0 || id >= card->multi.control_count) {
-                       PRINT(("auvia_get_mix : invalid control id requested : 
%li\n", id));
+                       PRINT(("auvia_get_mix : invalid control id requested : 
%" B_PRId32 "\n", id));
                        continue;
                }
                control = &card->multi.controls[id];
@@ -443,7 +443,8 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * mmvi)
        for (i = 0; i < mmvi->item_count; i++) {
                id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
                if (id < 0 || id >= card->multi.control_count) {
-                       PRINT(("auvia_set_mix : invalid control id requested : 
%li\n", id));
+                       PRINT(("auvia_set_mix : invalid control id requested : "
+                               "%" B_PRId32 "\n", id));
                        continue;
                }
                control = &card->multi.controls[id];
@@ -453,7 +454,8 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * mmvi)
                        if (i + 1 < mmvi->item_count) {
                                id = mmvi->values[i + 1].id - 
EMU_MULTI_CONTROL_FIRSTID;
                                if (id < 0 || id >= card->multi.control_count) {
-                                       PRINT(("auvia_set_mix : invalid control 
id requested : %li\n", id));
+                                       PRINT(("auvia_set_mix : invalid control 
id requested : "
+                                               "%" B_PRId32 "\n", id));
                                } else {
                                        control2 = &card->multi.controls[id];
                                        if (control2->mix_control.master != 
control->mix_control.id)
diff --git a/src/add-ons/kernel/drivers/audio/ac97/sis7018/Settings.cpp 
b/src/add-ons/kernel/drivers/audio/ac97/sis7018/Settings.cpp
index 06df5c8..0477c8b 100644
--- a/src/add-ons/kernel/drivers/audio/ac97/sis7018/Settings.cpp
+++ b/src/add-ons/kernel/drivers/audio/ac97/sis7018/Settings.cpp
@@ -87,7 +87,7 @@ void SiS7018_trace(bool force, const char* func, const char 
*fmt, ...)
                bigtime_t time  = system_time();
                uint32 msec             = time / 1000;
                uint32 sec              = msec / 1000;
-               sprintf(buf_ptr, "%02ld.%02ld.%03ld:",
+               sprintf(buf_ptr, "%02" B_PRIu32 ".%02" B_PRIu32 ".%03" B_PRIu32 
":",
                                sec / 60, sec % 60, msec % 1000);
                buf_ptr += strlen(buf_ptr);
        }
diff --git a/src/add-ons/kernel/drivers/audio/emuxki/emuxki.c 
b/src/add-ons/kernel/drivers/audio/emuxki/emuxki.c
index 7135546..cec9ee9 100644
--- a/src/add-ons/kernel/drivers/audio/emuxki/emuxki.c
+++ b/src/add-ons/kernel/drivers/audio/emuxki/emuxki.c
@@ -269,7 +269,7 @@ emuxki_pmem_alloc(emuxki_dev *card, size_t size)
                                    != silentpage)
                                        break;
                        if (j == numblocks) {
-                               PRINT(("emuxki_pmem_alloc : j == numblocks 
%ld\n", j));
+                               PRINT(("emuxki_pmem_alloc : j == numblocks %" 
B_PRIu32 "\n", j));
                                if ((mem = emuxki_mem_new(card, i, size)) == 
NULL) {
                                        //splx(s);
                                        return (NULL);
@@ -286,7 +286,7 @@ emuxki_pmem_alloc(emuxki_dev *card, size_t size)
                                //splx(s);
                                return mem->log_base;
                        } else {
-                               PRINT(("emuxki_pmem_alloc : j != numblocks 
%ld\n", j));
+                               PRINT(("emuxki_pmem_alloc : j != numblocks %" 
B_PRIu32 "\n", j));
                                i += j;
                        }
                        //splx(s);
@@ -1310,7 +1310,8 @@ emuxki_voice_adc_rate(emuxki_voice *voice)
                        if (IS_AUDIGY(&voice->stream->card->config))
                                return EMU_A_ADCCR_SAMPLERATE_12;
                        else
-                               PRINT(("recording sample_rate not supported : 
%lu\n", voice->sample_rate));
+                               PRINT(("recording sample_rate not supported : 
%" B_PRIu32 "\n",
+                                       voice->sample_rate));
                        break;
                case 11000:
                        if (IS_AUDIGY(&voice->stream->card->config))
@@ -1325,7 +1326,8 @@ emuxki_voice_adc_rate(emuxki_voice *voice)
                                return EMU_ADCCR_SAMPLERATE_8;
                        break;
                default:
-                       PRINT(("recording sample_rate not supported : %lu\n", 
voice->sample_rate));
+                       PRINT(("recording sample_rate not supported : %" 
B_PRIu32 "\n",
+                               voice->sample_rate));
        }
        return 0;
 }
@@ -2147,8 +2149,9 @@ emuxki_setup(emuxki_dev * card)
        } else if (card->info.device_id == CREATIVELABS_AUDIGY2_VALUE_DEVICE_ID)
                card->config.type |= TYPE_AUDIGY | TYPE_AUDIGY2 | 
TYPE_AUDIGY2_VALUE;
 
-       PRINT(("%s deviceid = %#04x chiprev = %x model = %x enhanced at %lx\n", 
card->name, card->info.device_id,
-               card->info.revision, card->info.u.h0.subsystem_id, 
card->config.nabmbar));
+       PRINT(("%s deviceid = %#04x chiprev = %x model = %x enhanced at %" 
B_PRIx32 "\n",
+               card->name, card->info.device_id, card->info.revision,
+               card->info.u.h0.subsystem_id, card->config.nabmbar));
 
        cmd = (*pci->read_pci_config)(card->info.bus, card->info.device, 
card->info.function, PCI_command, 2);
        PRINT(("PCI command before: %x\n", cmd));
@@ -2191,7 +2194,7 @@ emuxki_setup(emuxki_dev * card)
        ac97_init(&card->config);
        ac97_amp_enable(&card->config, true);
 
-       PRINT(("codec vendor id      = 
%#08lx\n",ac97_get_vendor_id(&card->config)));
+       PRINT(("codec vendor id      = %#08" B_PRIx32 
"\n",ac97_get_vendor_id(&card->config)));
        PRINT(("codec description     = 
%s\n",ac97_get_vendor_id_description(&card->config)));
        PRINT(("codec 3d enhancement = 
%s\n",ac97_get_3d_stereo_enhancement(&card->config)));
 
@@ -2272,7 +2275,7 @@ emuxki_setup(emuxki_dev * card)
                }
        }
 
-       PRINT(("installing interrupt : %lx\n", card->config.irq));
+       PRINT(("installing interrupt : %" B_PRIx32 "\n", card->config.irq));
        err = install_io_interrupt_handler(card->config.irq, emuxki_int, card, 
0);
        if (err != B_OK) {
                PRINT(("failed to install interrupt\n"));
@@ -2945,7 +2948,7 @@ init_driver(void)
                        }
 #endif
                        if (emuxki_setup(&cards[num_cards])) {
-                               PRINT(("Setup of emuxki %ld failed\n", 
num_cards+1));
+                               PRINT(("Setup of emuxki %" B_PRId32 " 
failed\n", num_cards+1));
 #ifdef __HAIKU__
                                (*pci->unreserve_device)(info.bus, info.device, 
info.function,
                                        DRIVER_NAME, &cards[num_cards]);
diff --git a/src/add-ons/kernel/drivers/audio/emuxki/multi.c 
b/src/add-ons/kernel/drivers/audio/emuxki/multi.c
index 387c58e..0924576 100644
--- a/src/add-ons/kernel/drivers/audio/emuxki/multi.c
+++ b/src/add-ons/kernel/drivers/audio/emuxki/multi.c
@@ -515,7 +515,7 @@ emuxki_create_controls_list(multi_dev *multi)
        }
 
        multi->control_count = index;
-       PRINT(("multi->control_count %lu\n", multi->control_count));
+       PRINT(("multi->control_count %" B_PRIu32 "\n", multi->control_count));
        return B_OK;
 }
 
@@ -528,7 +528,8 @@ emuxki_get_mix(emuxki_dev *card, multi_mix_value_info * 
mmvi)
        for (i = 0; i < mmvi->item_count; i++) {
                id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
                if (id < 0 || id >= card->multi.control_count) {
-                       PRINT(("emuxki_get_mix : invalid control id requested : 
%li\n", id));
+                       PRINT(("emuxki_get_mix : invalid control id requested : 
"
+                               "%" B_PRIu32 "\n", id));
                        continue;
                }
                control = &card->multi.controls[id];
@@ -568,7 +569,8 @@ emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * 
mmvi)
        for (i = 0; i < mmvi->item_count; i++) {
                id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
                if (id < 0 || id >= card->multi.control_count) {
-                       PRINT(("emuxki_set_mix : invalid control id requested : 
%li\n", id));
+                       PRINT(("emuxki_set_mix : invalid control id requested : 
"
+                               "%" B_PRIu32 "\n", id));
                        continue;
                }
                control = &card->multi.controls[id];
@@ -578,7 +580,8 @@ emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * 
mmvi)
                        if (i+1<mmvi->item_count) {
                                id = mmvi->values[i + 1].id - 
EMU_MULTI_CONTROL_FIRSTID;
                                if (id < 0 || id >= card->multi.control_count) {
-                                       PRINT(("emuxki_set_mix : invalid 
control id requested : %li\n", id));
+                                       PRINT(("emuxki_set_mix : invalid 
control id requested : "
+                                               "%" B_PRIu32 "\n", id));
                                } else {
                                        control2 = &card->multi.controls[id];
                                        if (control2->mix_control.master != 
control->mix_control.id)
diff --git a/src/add-ons/kernel/drivers/audio/hda/driver.h 
b/src/add-ons/kernel/drivers/audio/hda/driver.h
index c550ca8..d233dec 100644
--- a/src/add-ons/kernel/drivers/audio/hda/driver.h
+++ b/src/add-ons/kernel/drivers/audio/hda/driver.h
@@ -18,10 +18,10 @@
 #include <stdlib.h>
 
 #ifndef HAIKU_TARGET_PLATFORM_HAIKU
-#      define DEVFS_PATH_FORMAT        "audio/multi/hda/%lu"
+#      define DEVFS_PATH_FORMAT        "audio/multi/hda/%" B_PRIu32
 #      include <multi_audio.h>
 #else
-#      define DEVFS_PATH_FORMAT        "audio/hmulti/hda/%lu"
+#      define DEVFS_PATH_FORMAT        "audio/hmulti/hda/%" B_PRIu32
 #      include <hmulti_audio.h>
 #endif
 
diff --git a/src/add-ons/kernel/drivers/power/acpi_button/acpi_button.cpp 
b/src/add-ons/kernel/drivers/power/acpi_button/acpi_button.cpp
index 0c8089f..4c2f5fb 100644
--- a/src/add-ons/kernel/drivers/power/acpi_button/acpi_button.cpp
+++ b/src/add-ons/kernel/drivers/power/acpi_button/acpi_button.cpp
@@ -209,7 +209,7 @@ acpi_button_select(void *_cookie, uint8 event, selectsync 
*sync)
        status_t error = add_select_sync_pool_entry(&device->select_pool, sync,
                event);
        if (error != B_OK) {
-               ERROR("add_select_sync_pool_entry() failed: %#lx\n", error);
+               ERROR("add_select_sync_pool_entry() failed: %#" B_PRIx32 "\n", 
error);
                return error;
        }
 
diff --git a/src/add-ons/kernel/file_systems/bindfs/DebugSupport.h 
b/src/add-ons/kernel/file_systems/bindfs/DebugSupport.h
index 394e1ba..69c9938 100644
--- a/src/add-ons/kernel/file_systems/bindfs/DebugSupport.h
+++ b/src/add-ons/kernel/file_systems/bindfs/DebugSupport.h
@@ -100,23 +100,24 @@ void dbg_printf_end();
 #define DEBUG_CONTEXT(x)                                                       
                                                \
 {                                                                              
                                                                        \
        dbg_printf_begin();                                                     
                                                        \
-       __out(DEBUG_APP " [%Ld: %5ld] ", system_time(), DEBUG_THREAD);          
        \
+       __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] ", 
system_time(),\
+               DEBUG_THREAD);                                                  
                                                        \
        x;                                                                      
                                                                        \
        dbg_printf_end();                                                       
                                                        \
 }
 #define DEBUG_CONTEXT_FUNCTION(prefix, x)                                      
                                \
 {                                                                              
                                                                        \
        dbg_printf_begin();                                                     
                                                        \
-       __out(DEBUG_APP " [%Ld: %5ld] %s" prefix, system_time(), DEBUG_THREAD,  
\
-               __PRETTY_FUNCTION__);                                           
                                                \
+       __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s" prefix,      
        \
+               system_time(), DEBUG_THREAD, __PRETTY_FUNCTION__);              
                        \
        x;                                                                      
                                                                        \
        dbg_printf_end();                                                       
                                                        \
 }
 #define DEBUG_CONTEXT_LINE(x)                                                  
                                        \
 {                                                                              
                                                                        \
        dbg_printf_begin();                                                     
                                                        \
-       __out(DEBUG_APP " [%Ld: %5ld] %s:%d: ", system_time(), DEBUG_THREAD,    
\
-               __PRETTY_FUNCTION__, __LINE__);                                 
                                        \
+       __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s:%d: ",        
        \
+               system_time(), DEBUG_THREAD, __PRETTY_FUNCTION__, __LINE__);    
        \
        x;                                                                      
                                                                        \
        dbg_printf_end();                                                       
                                                        \
 }
diff --git a/src/add-ons/kernel/file_systems/ntfs/fs_func.c 
b/src/add-ons/kernel/file_systems/ntfs/fs_func.c
index 0c7db53..b386dec 100644
--- a/src/add-ons/kernel/file_systems/ntfs/fs_func.c
+++ b/src/add-ons/kernel/file_systems/ntfs/fs_func.c
@@ -367,7 +367,7 @@ fs_mount(fs_volume *_vol, const char *device, ulong flags, 
const char *args,
 
        strcpy(ns->devicePath,device);
 
-       sprintf(lockname, "ntfs_lock %lx", ns->id);
+       sprintf(lockname, "ntfs_lock %" B_PRIdDEV, ns->id);
        recursive_lock_init_etc(&(ns->vlock), lockname, MUTEX_FLAG_CLONE_NAME);
 
        handle = load_driver_settings("ntfs");
diff --git a/src/add-ons/media/media-add-ons/usb_webcam/Producer.cpp 
b/src/add-ons/media/media-add-ons/usb_webcam/Producer.cpp
index 2ef797c..ac95cfc 100644
--- a/src/add-ons/media/media-add-ons/usb_webcam/Producer.cpp
+++ b/src/add-ons/media/media-add-ons/usb_webcam/Producer.cpp
@@ -180,9 +180,8 @@ VideoProducer::NodeRegistered()
        state->AddItem(B_HOST_TO_LENDIAN_INT32(0x000000ff), "Blue");
        */
 
-       BParameter *p;
        g = main->MakeGroup("Info");
-       p = g->MakeTextParameter(
+       g->MakeTextParameter(
                P_INFO, B_MEDIA_RAW_VIDEO, "", "Info", 256);
 
        int32 id = P_LAST;
@@ -289,7 +288,8 @@ VideoProducer::HandleEvent(const media_timed_event *event,
                case BTimedEventQueue::B_DATA_STATUS:
                case BTimedEventQueue::B_PARAMETER:
                default:
-                       PRINTF(-1, ("HandleEvent: Unhandled event -- %lx\n", 
event->type));
+                       PRINTF(-1, ("HandleEvent: Unhandled event -- %" 
B_PRIx32 "\n",
+                               event->type));
                        break;
        }
 }
@@ -335,7 +335,7 @@ VideoProducer::FormatSuggestionRequested(
 
        TOUCH(quality);
 
-       PRINTF(1, ("FormatSuggestionRequested() %ldx%ld\n", \
+       PRINTF(1, ("FormatSuggestionRequested() %" B_PRIu32 "x%" B_PRIu32 "\n", 
\
                        format->u.raw_video.display.line_width, \
                        format->u.raw_video.display.line_count));
 
@@ -361,7 +361,7 @@ VideoProducer::FormatProposal(const media_source &output, 
media_format *format)
        if (output != fOutput.source)
                return B_MEDIA_BAD_SOURCE;
 
-       PRINTF(1, ("FormatProposal() %ldx%ld\n", \
+       PRINTF(1, ("FormatProposal() %" B_PRIu32 "x%" B_PRIu32 "\n", \
                        format->u.raw_video.display.line_width, \
                        format->u.raw_video.display.line_count));
 
@@ -381,7 +381,7 @@ VideoProducer::FormatProposal(const media_source &output, 
media_format *format)
                }
        }
 
-       PRINTF(1, ("FormatProposal: %ldx%ld\n", \
+       PRINTF(1, ("FormatProposal: %" B_PRIu32 "x%" B_PRIu32 "\n", \
                        format->u.raw_video.display.line_width, \
                        format->u.raw_video.display.line_count));
 
@@ -464,7 +464,7 @@ VideoProducer::PrepareToConnect(const media_source &source,
 {
        status_t err;
 
-       PRINTF(1, ("PrepareToConnect() %ldx%ld\n", \
+       PRINTF(1, ("PrepareToConnect() %" B_PRIu32 "x%" B_PRIu32 "\n", \
                        format->u.raw_video.display.line_width, \
                        format->u.raw_video.display.line_count));
 
@@ -539,7 +539,7 @@ VideoProducer::Connect(status_t error, const media_source 
&source,
                const media_destination &destination, const media_format 
&format,
                char *io_name)
 {
-       PRINTF(1, ("Connect() %ldx%ld\n", \
+       PRINTF(1, ("Connect() %" B_PRIu32 "x%" B_PRIu32 "\n", \
                        format.u.raw_video.display.line_width, \
                        format.u.raw_video.display.line_count));
 
@@ -710,7 +710,7 @@ VideoProducer::GetParameterValue(
                        *((uint32 *)value) = fColor;
                        return B_OK;
                case P_INFO:
-                       if (*size < fInfoString.Length() + 1)
+                       if (*size < (size_t)(fInfoString.Length() + 1))
                                return EINVAL;
                        *last_change = fLastColorChange;
                        *size = fInfoString.Length() + 1;
@@ -785,7 +785,7 @@ VideoProducer::HandleStart(bigtime_t performance_time)
 {
        /* Start producing frames, even if the output hasn't been connected 
yet. */
 
-       PRINTF(1, ("HandleStart(%Ld)\n", performance_time));
+       PRINTF(1, ("HandleStart(%" B_PRIdBIGTIME ")\n", performance_time));
 
        if (fRunning) {
                PRINTF(-1, ("HandleStart: Node already started\n"));
@@ -889,7 +889,9 @@ VideoProducer::FrameGenerator()
        bigtime_t wait_until = system_time();
 
        while (1) {
-               PRINTF(1, ("FrameGenerator: acquire_sem_etc() until %Ldµs (in 
%Ldµs)\n", wait_until, wait_until - system_time()));
+               PRINTF(1, ("FrameGenerator: acquire_sem_etc() until %" 
B_PRIdBIGTIME
+                               "µs (in %" B_PRIdBIGTIME "µs)\n", wait_until, 
wait_until -
+                                       system_time()));
                status_t err = acquire_sem_etc(fFrameSync, 1, 
B_ABSOLUTE_TIMEOUT,
                                wait_until);
 
@@ -915,7 +917,8 @@ PRINT(("PS: %Ld\n", fProcessingLatency));
                if (wait_until < system_time())
                        continue;
 
-               PRINTF(1, ("FrameGenerator: wait until %Ld, %ctimed out, 
%crunning, %cenabled.\n",
+               PRINTF(1, ("FrameGenerator: wait until %" B_PRIdBIGTIME ", 
%ctimed out,"
+                                       " %crunning, %cenabled.\n",
                                        wait_until,
                                        (err == B_OK)?'!':' ',
                                        (fRunning)?' ':'!',
diff --git a/src/add-ons/media/media-add-ons/video_producer_demo/Producer.cpp 
b/src/add-ons/media/media-add-ons/video_producer_demo/Producer.cpp
index fe089df..6c3cf8e 100644
--- a/src/add-ons/media/media-add-ons/video_producer_demo/Producer.cpp
+++ b/src/add-ons/media/media-add-ons/video_producer_demo/Producer.cpp
@@ -90,13 +90,13 @@ VideoProducer::AddOn(int32 *internal_id) const
        return fAddOn;
 }
 
-status_t 
+status_t
 VideoProducer::HandleMessage(int32 message, const void *data, size_t size)
 {
        return B_ERROR;
 }
 
-void 
+void
 VideoProducer::Preroll()
 {
        /* This hook may be called before the node is started to give the 
hardware
@@ -118,7 +118,7 @@ VideoProducer::RequestCompleted(const media_request_info 
&info)
 
 /* BMediaEventLooper */
 
-void 
+void
 VideoProducer::NodeRegistered()
 {
        if (fInitStatus != B_OK) {
@@ -147,7 +147,7 @@ VideoProducer::NodeRegistered()
        fOutput.source.port = ControlPort();
        fOutput.source.id = 0;
        fOutput.destination = media_destination::null;
-       strcpy(fOutput.name, Name());   
+       strcpy(fOutput.name, Name());
 
        /* Tailor these for the output of your device */
        fOutput.format.type = B_MEDIA_RAW_VIDEO;
@@ -195,7 +195,7 @@ VideoProducer::SetRunMode(run_mode mode)
        BMediaEventLooper::SetRunMode(mode);
 }
 
-void 
+void
 VideoProducer::HandleEvent(const media_timed_event *event,
                bigtime_t lateness, bool realTimeEvent)
 {
@@ -219,12 +219,13 @@ VideoProducer::HandleEvent(const media_timed_event *event,
                case BTimedEventQueue::B_DATA_STATUS:
                case BTimedEventQueue::B_PARAMETER:
                default:
-                       PRINTF(-1, ("HandleEvent: Unhandled event -- %lx\n", 
event->type));
+                       PRINTF(-1, ("HandleEvent: Unhandled event -- %" 
B_PRIx32 "\n",
+                               event->type));
                        break;
        }
 }
 
-void 
+void
 VideoProducer::CleanUpEvent(const media_timed_event *event)
 {
        BMediaEventLooper::CleanUpEvent(event);
@@ -250,7 +251,7 @@ VideoProducer::DeleteHook(BMediaNode * node)
 
 /* BBufferProducer */
 
-status_t 
+status_t
 VideoProducer::FormatSuggestionRequested(
                media_type type, int32 quality, media_format *format)
 {
@@ -270,7 +271,7 @@ VideoProducer::FormatSuggestionRequested(
        return B_OK;
 }
 
-status_t 
+status_t
 VideoProducer::FormatProposal(const media_source &output, media_format *format)
 {
        status_t err;
@@ -285,10 +286,10 @@ VideoProducer::FormatProposal(const media_source &output, 
media_format *format)
                        B_OK : B_MEDIA_BAD_FORMAT;
        *format = fOutput.format;
 
-       return err;             
+       return err;
 }
 
-status_t 
+status_t
 VideoProducer::FormatChangeRequested(const media_source &source,
                const media_destination &destination, media_format *io_format,
                int32 *_deprecated_)
@@ -296,11 +297,11 @@ VideoProducer::FormatChangeRequested(const media_source 
&source,
        TOUCH(destination); TOUCH(io_format); TOUCH(_deprecated_);
        if (source != fOutput.source)
                return B_MEDIA_BAD_SOURCE;
-               
-       return B_ERROR; 
+
+       return B_ERROR;
 }
 
-status_t 
+status_t
 VideoProducer::GetNextOutput(int32 *cookie, media_output *out_output)
 {
        if (!out_output)
@@ -308,13 +309,13 @@ VideoProducer::GetNextOutput(int32 *cookie, media_output 
*out_output)
 
        if ((*cookie) != 0)
                return B_BAD_INDEX;
-       
+
        *out_output = fOutput;
        (*cookie)++;
        return B_OK;
 }
 
-status_t 
+status_t
 VideoProducer::DisposeOutputCookie(int32 cookie)
 {
        TOUCH(cookie);
@@ -322,7 +323,7 @@ VideoProducer::DisposeOutputCookie(int32 cookie)
        return B_OK;
 }
 
-status_t 
+status_t
 VideoProducer::SetBufferGroup(const media_source &for_source,
                BBufferGroup *group)
 {
@@ -331,7 +332,7 @@ VideoProducer::SetBufferGroup(const media_source 
&for_source,
        return B_ERROR;
 }
 
-status_t 
+status_t
 VideoProducer::VideoClippingChanged(const media_source &for_source,
                int16 num_shorts, int16 *clip_data,
                const media_video_display_info &display, int32 *_deprecated_)
@@ -342,19 +343,19 @@ VideoProducer::VideoClippingChanged(const media_source 
&for_source,
        return B_ERROR;
 }
 
-status_t 
+status_t
 VideoProducer::GetLatency(bigtime_t *out_latency)
 {
        *out_latency = EventLatency() + SchedulingLatency();
        return B_OK;
 }
 
-status_t 
+status_t
 VideoProducer::PrepareToConnect(const media_source &source,
                const media_destination &destination, media_format *format,
                media_source *out_source, char *out_name)
 {
-       PRINTF(1, ("PrepareToConnect() %ldx%ld\n", \
+       PRINTF(1, ("PrepareToConnect() %" B_PRIu32 "x%" B_PRIu32 "\n", \
                        format->u.raw_video.display.line_width, \
                        format->u.raw_video.display.line_count));
 
@@ -365,7 +366,7 @@ VideoProducer::PrepareToConnect(const media_source &source,
 
        if (source != fOutput.source)
                return B_MEDIA_BAD_SOURCE;
-       
+
        if (fOutput.destination != media_destination::null)
                return B_MEDIA_ALREADY_CONNECTED;
 
@@ -391,12 +392,12 @@ VideoProducer::PrepareToConnect(const media_source 
&source,
        return B_OK;
 }
 
-void 
+void
 VideoProducer::Connect(status_t error, const media_source &source,
                const media_destination &destination, const media_format 
&format,
                char *io_name)
 {
-       PRINTF(1, ("Connect() %ldx%ld\n", \
+       PRINTF(1, ("Connect() %" B_PRIu32 "x%" B_PRIu32 "\n", \
                        format.u.raw_video.display.line_width, \
                        format.u.raw_video.display.line_count));
 
@@ -421,7 +422,7 @@ VideoProducer::Connect(status_t error, const media_source 
&source,
                                        (1000000 / 
fOutput.format.u.raw_video.field_rate));
                fFrameBase = fFrame;
        }
-       
+
        fConnectedFormat = format.u.raw_video;
 
        /* get the latency */
@@ -461,7 +462,7 @@ VideoProducer::Connect(status_t error, const media_source 
&source,
        release_sem(fFrameSync);
 }
 
-void 
+void
 VideoProducer::Disconnect(const media_source &source,
                const media_destination &destination)
 {
@@ -488,14 +489,14 @@ VideoProducer::Disconnect(const media_source &source,
        fConnected = false;
 }
 
-void 
+void
 VideoProducer::LateNoticeReceived(const media_source &source,
                bigtime_t how_much, bigtime_t performance_time)
 {
        TOUCH(source); TOUCH(how_much); TOUCH(performance_time);
 }
 
-void 
+void
 VideoProducer::EnableOutput(const media_source &source, bool enabled,
                int32 *_deprecated_)
 {
@@ -507,7 +508,7 @@ VideoProducer::EnableOutput(const media_source &source, 
bool enabled,
        fEnabled = enabled;
 }
 
-status_t 
+status_t
 VideoProducer::SetPlayRate(int32 numer, int32 denom)
 {
        TOUCH(numer); TOUCH(denom);
@@ -515,7 +516,7 @@ VideoProducer::SetPlayRate(int32 numer, int32 denom)
        return B_ERROR;
 }
 
-void 
+void
 VideoProducer::AdditionalBufferRequested(const media_source &source,
                media_buffer_id prev_buffer, bigtime_t prev_time,
                const media_seek_tag *prev_tag)
@@ -523,7 +524,7 @@ VideoProducer::AdditionalBufferRequested(const media_source 
&source,
        TOUCH(source); TOUCH(prev_buffer); TOUCH(prev_time); TOUCH(prev_tag);
 }
 
-void 
+void
 VideoProducer::LatencyChanged(const media_source &source,
                const media_destination &destination, bigtime_t new_latency,
                uint32 flags)
@@ -531,9 +532,9 @@ VideoProducer::LatencyChanged(const media_source &source,
        TOUCH(source); TOUCH(destination); TOUCH(new_latency); TOUCH(flags);
 }
 
-/* BControllable */                                                            
        
+/* BControllable */
 
-status_t 
+status_t
 VideoProducer::GetParameterValue(
        int32 id, bigtime_t *last_change, void *value, size_t *size)
 {
@@ -577,7 +578,7 @@ VideoProducer::HandleStart(bigtime_t performance_time)
 {
        /* Start producing frames, even if the output hasn't been connected 
yet. */
 
-       PRINTF(1, ("HandleStart(%Ld)\n", performance_time));
+       PRINTF(1, ("HandleStart(%" B_PRIdBIGTIME ")\n", performance_time));
 
        if (fRunning) {
                PRINTF(-1, ("HandleStart: Node already started\n"));
@@ -646,7 +647,7 @@ VideoProducer::HandleSeek(bigtime_t performance_time)
 
 /* The following functions form the thread that generates frames. You should
  * replace this with the code that interfaces to your hardware. */
-int32 
+int32
 VideoProducer::FrameGenerator()
 {
        bigtime_t wait_until = system_time();
@@ -739,7 +740,7 @@ VideoProducer::FrameGenerator()
                                for (int x = 0; x < 
(int)fConnectedFormat.display.line_width; x++)
                                        *(p++) = ((((x+y)^0^x)+fFrame) & 0xff) 
* (0x01010101 & fColor);
                }
-               
+
                /* Send the buffer on down to the consumer */
                if (SendBuffer(buffer, fOutput.source, fOutput.destination) < 
B_OK) {
                        PRINTF(-1, ("FrameGenerator: Error sending buffer\n"));
diff --git a/src/add-ons/media/plugins/ffmpeg/gfx_util.cpp 
b/src/add-ons/media/plugins/ffmpeg/gfx_util.cpp
index a2496cb..8a5481b 100644
--- a/src/add-ons/media/plugins/ffmpeg/gfx_util.cpp
+++ b/src/add-ons/media/plugins/ffmpeg/gfx_util.cpp
@@ -23,7 +23,7 @@ extern "C" {
 #endif
 
 #if LIBAVCODEC_VERSION_INT < ((54 << 16) | (50 << 8))
-#define AVPixelFormat PixelFormat 
+#define AVPixelFormat PixelFormat
 #define AV_PIX_FMT_NONE PIX_FMT_NONE
 #define AV_PIX_FMT_YUV410P PIX_FMT_YUV410P
 #define AV_PIX_FMT_YUV411P PIX_FMT_YUV411P
@@ -286,8 +286,8 @@ colorspace_to_pixfmt(color_space format)
 void
 dump_ffframe_audio(AVFrame* frame, const char* name)
 {
-       printf(BEGIN_TAG"AVFrame(%s) [ pkt_dts:%-10lld #samples:%-5d %s"
-               " ]\n"END_TAG,
+       printf(BEGIN_TAG "AVFrame(%s) [ pkt_dts:%-10" B_PRId64 " #samples:%-5d 
%s"
+               " ]\n" END_TAG,
                name,
                frame->pkt_dts,
                frame->nb_samples,
@@ -300,8 +300,8 @@ dump_ffframe_video(AVFrame* frame, const char* name)
 {
        const char* picttypes[] = {"no pict type", "intra", "predicted",
                "bidir pre", "s(gmc)-vop"};
-       printf(BEGIN_TAG"AVFrame(%s) [ pkt_dts:%-10lld cnum:%-5d dnum:%-5d %s%s"
-               " ]\n"END_TAG,
+       printf(BEGIN_TAG "AVFrame(%s) [ pkt_dts:%-10" B_PRId64 " cnum:%-5d "
+               "dnum:%-5d %s%s ]\n" END_TAG,
                name,
                frame->pkt_dts,
                frame->coded_picture_number,
diff --git a/src/bin/debug/profile/BasicProfileResult.cpp 
b/src/bin/debug/profile/BasicProfileResult.cpp
index 52f707f..5d7006f 100644
--- a/src/bin/debug/profile/BasicProfileResult.cpp
+++ b/src/bin/debug/profile/BasicProfileResult.cpp
@@ -175,16 +175,16 @@ 
BasicProfileResult::PrintResults(ImageProfileResultContainer* container)
        fprintf(gOptions.output, "\nprofiling results for %s \"%s\" "
                "(%" B_PRId32 "):\n", fEntity->EntityType(), 
fEntity->EntityName(),
                fEntity->EntityID());
-       fprintf(gOptions.output, "  tick interval:  %lld us\n", fInterval);
-       fprintf(gOptions.output, "  total ticks:    %lld (%lld us)\n",
-               totalTicks, totalTicks * fInterval);
+       fprintf(gOptions.output, "  tick interval:  %" B_PRId64 " us\n", 
fInterval);
+       fprintf(gOptions.output, "  total ticks:    %" B_PRId64 " (%" B_PRId64
+               " us)\n", totalTicks, totalTicks * fInterval);
        if (totalTicks == 0)
                totalTicks = 1;
-       fprintf(gOptions.output, "  unknown ticks:  %lld (%lld us, %6.2f%%)\n",
-               fUnkownTicks, fUnkownTicks * fInterval,
+       fprintf(gOptions.output, "  unknown ticks:  %" B_PRId64 " (%" B_PRId64
+               " us, %6.2f%%)\n", fUnkownTicks, fUnkownTicks * fInterval,
                100.0 * fUnkownTicks / totalTicks);
-       fprintf(gOptions.output, "  dropped ticks:  %lld (%lld us, %6.2f%%)\n",
-               fDroppedTicks, fDroppedTicks * fInterval,
+       fprintf(gOptions.output, "  dropped ticks:  %" B_PRId64 " (%" B_PRId64
+               " us, %6.2f%%)\n", fDroppedTicks, fDroppedTicks * fInterval,
                100.0 * fDroppedTicks / totalTicks);
        if (gOptions.analyze_full_stack) {
                fprintf(gOptions.output, "  samples/tick:   %.1f\n",
@@ -198,9 +198,9 @@ 
BasicProfileResult::PrintResults(ImageProfileResultContainer* container)
                        "---------------------------------------\n");
                for (int32 k = 0; k < imageCount; k++) {
                        BasicImageProfileResult* image = images[k];
-                       fprintf(gOptions.output, "  %10lld  %10lld  %7ld %s\n",
-                               image->TotalHits(), image->UnknownHits(),
-                               image->ID(), image->GetImage()->Name());
+                       fprintf(gOptions.output, "  %10" B_PRId64 "  %10" 
B_PRId64
+                               "  %7" B_PRId32 " %s\n", image->TotalHits(),
+                               image->UnknownHits(), image->ID(), 
image->GetImage()->Name());
                }
        }
 
@@ -222,10 +222,10 @@ 
BasicProfileResult::PrintResults(ImageProfileResultContainer* container)
 #else
                        const char* symbolName = symbol->Name();
 #endif
-                       fprintf(gOptions.output, "  %10lld  %10lld  %6.2f  %6ld 
 %s\n",
-                               hitSymbol.hits, hitSymbol.hits * fInterval,
-                               100.0 * hitSymbol.hits / totalTicks, 
hitSymbol.imageID,
-                               symbolName);
+                       fprintf(gOptions.output, "  %10" B_PRId64 "  %10" 
B_PRId64
+                               "  %6.2f  %6" B_PRId32 "  %s\n", hitSymbol.hits,
+                               hitSymbol.hits * fInterval, 100.0 * 
hitSymbol.hits / totalTicks,
+                               hitSymbol.imageID, symbolName);
 #if __GNUC__ > 2
                        if (status == 0)
                                free(const_cast<char*>(symbolName));
diff --git a/src/bin/debug/profile/CallgrindProfileResult.cpp 
b/src/bin/debug/profile/CallgrindProfileResult.cpp
index eec6008..62ae991 100644
--- a/src/bin/debug/profile/CallgrindProfileResult.cpp
+++ b/src/bin/debug/profile/CallgrindProfileResult.cpp
@@ -187,9 +187,9 @@ 
CallgrindProfileResult::PrintResults(ImageProfileResultContainer* container)
 
        // create the file name
        char fileName[B_PATH_NAME_LENGTH];
-       snprintf(fileName, sizeof(fileName), "%s/callgrind.out.%ld.%s.%lldms",
-               gOptions.callgrind_directory, fEntity->EntityID(), entityName,
-               fTotalTicks * fInterval);
+       snprintf(fileName, sizeof(fileName), "%s/callgrind.out.%" B_PRId32 
".%s.%"
+               B_PRId64 "ms", gOptions.callgrind_directory, 
fEntity->EntityID(),
+               entityName, fTotalTicks * fInterval);
 
        // create the file
        FILE* out = fopen(fileName, "w+");
@@ -202,13 +202,14 @@ 
CallgrindProfileResult::PrintResults(ImageProfileResultContainer* container)
        // write the header
        fprintf(out, "version: 1\n");
        fprintf(out, "creator: Haiku profile\n");
-       fprintf(out, "pid: %ld\n", fEntity->EntityID());
+       fprintf(out, "pid: %" B_PRId32 "\n", fEntity->EntityID());
        fprintf(out, "cmd: %s\n", fEntity->EntityName());
        fprintf(out, "part: 1\n\n");
 
        fprintf(out, "positions: line\n");
        fprintf(out, "events: Ticks Time\n");
-       fprintf(out, "summary: %lld %lld\n", fTotalTicks, fTotalTicks * 
fInterval);
+       fprintf(out, "summary: %" B_PRId64 " %" B_PRId64 "\n", fTotalTicks,
+               fTotalTicks * fInterval);
 
        // get hit images
        CallgrindImageProfileResult* images[container->CountImages()];
@@ -226,16 +227,16 @@ 
CallgrindProfileResult::PrintResults(ImageProfileResultContainer* container)
 
                        fprintf(out, "\n");
                        _PrintFunction(out, image, k, false);
-                       fprintf(out, "0 %lld %lld\n", function.hits,
+                       fprintf(out, "0 %" B_PRId64 " %" B_PRId64 "\n", 
function.hits,
                                function.hits * fInterval);
 
                        CallgrindCalledFunction* calledFunction = 
function.calledFunctions;
                        while (calledFunction != NULL) {
                                _PrintFunction(out, calledFunction->image,
                                        calledFunction->function, true);
-                               fprintf(out, "calls=%lld 0\n", 
calledFunction->hits);
-                               fprintf(out, "0 %lld %lld\n", 
calledFunction->hits,
-                                       calledFunction->hits * fInterval);
+                               fprintf(out, "calls=%" B_PRId64 " 0\n", 
calledFunction->hits);
+                               fprintf(out, "0 %" B_PRId64 " %" B_PRId64 "\n",
+                                       calledFunction->hits, 
calledFunction->hits * fInterval);
                                calledFunction = calledFunction->next;
                        }
                }
@@ -247,16 +248,17 @@ 
CallgrindProfileResult::PrintResults(ImageProfileResultContainer* container)
 
                if (fUnkownTicks > 0) {
                        fprintf(out, "\nfn=unknown\n");
-                       fprintf(out, "0 %lld\n", fUnkownTicks);
+                       fprintf(out, "0 %" B_PRId64 "\n", fUnkownTicks);
                }
 
                if (fDroppedTicks > 0) {
                        fprintf(out, "\nfn=dropped\n");
-                       fprintf(out, "0 %lld\n", fDroppedTicks);
+                       fprintf(out, "0 %" B_PRId64 "\n", fDroppedTicks);
                }
        }
 
-       fprintf(out, "\ntotals: %lld %lld\n", fTotalTicks, fTotalTicks * 
fInterval);
+       fprintf(out, "\ntotals: %" B_PRId64 " %" B_PRId64 "\n", fTotalTicks,
+               fTotalTicks * fInterval);
 
        fclose(out);
 }
@@ -290,22 +292,25 @@ CallgrindProfileResult::_PrintFunction(FILE* out,
                // need to print the image name
                int32 index = fNextImageOutputIndex++;
                image->SetOutputIndex(index);
-               fprintf(out, "%sob=(%ld) %s:%ld\n", called ? "c" : "", index,
-                       image->GetImage()->Name(), image->ID());
+               fprintf(out, "%sob=(%" B_PRId32 ") %s:%" B_PRId32 "\n", called 
? "c" : "",
+                       index, image->GetImage()->Name(), image->ID());
        } else {
                // image is already known
                // TODO: We may not need to print it at all!
-               fprintf(out, "%sob=(%ld)\n", called ? "c" : "", 
image->OutputIndex());
+               fprintf(out, "%sob=(%" B_PRId32 ")\n", called ? "c" : "",
+                       image->OutputIndex());
        }
 
        CallgrindFunction& function = image->Functions()[functionIndex];
        if (function.outputIndex == 0) {
                // need to print the function name
                function.outputIndex = fNextFunctionOutputIndex++;
-               fprintf(out, "%sfn=(%ld) %s\n", called ? "c" : "", 
function.outputIndex,
+               fprintf(out, "%sfn=(%" B_PRId32 ") %s\n", called ? "c" : "",
+                       function.outputIndex,
                        image->GetImage()->Symbols()[functionIndex]->Name());
        } else {
                // function is already known
-               fprintf(out, "%sfn=(%ld)\n", called ? "c" : "", 
function.outputIndex);
+               fprintf(out, "%sfn=(%" B_PRId32 ")\n", called ? "c" : "",
+                       function.outputIndex);
        }
 }
diff --git a/src/bin/debug/profile/SharedImage.cpp 
b/src/bin/debug/profile/SharedImage.cpp
index 9d3f453..47985a5 100644
--- a/src/bin/debug/profile/SharedImage.cpp
+++ b/src/bin/debug/profile/SharedImage.cpp
@@ -44,7 +44,8 @@ SharedImage::Init(team_id owner, image_id imageID)
                &lookupContext);
        if (error != B_OK) {
                fprintf(stderr, "%s: Failed to create symbol lookup context "
-                       "for team %ld: %s\n", kCommandName, owner, 
strerror(error));
+                       "for team %" B_PRId32 ": %s\n", kCommandName, owner,
+                       strerror(error));
                return error;
        }
 
@@ -56,8 +57,8 @@ SharedImage::Init(team_id owner, image_id imageID)
        error = debug_create_image_symbol_iterator(lookupContext, imageID,
                &iterator);
        if (error != B_OK) {
-               fprintf(stderr, "Failed to init symbol iterator for image %ld: 
%s\n",
-                       imageID, strerror(error));
+               fprintf(stderr, "Failed to init symbol iterator for image %" 
B_PRId32
+                       ": %s\n", imageID, strerror(error));
                debug_delete_symbol_lookup_context(lookupContext);
                return error;
        }
diff --git a/src/bin/debug/profile/Team.cpp b/src/bin/debug/profile/Team.cpp
index 433fde1..2516c0c 100644
--- a/src/bin/debug/profile/Team.cpp
+++ b/src/bin/debug/profile/Team.cpp
@@ -71,16 +71,16 @@ Team::Init(team_id teamID, port_id debuggerPort)
        // install ourselves as the team debugger
        fNubPort = install_team_debugger(teamID, debuggerPort);
        if (fNubPort < 0) {
-               fprintf(stderr, "%s: Failed to install as debugger for team 
%ld: "
-                       "%s\n", kCommandName, teamID, strerror(fNubPort));
+               fprintf(stderr, "%s: Failed to install as debugger for team %"
+                       B_PRId32 ": %s\n", kCommandName, teamID, 
strerror(fNubPort));
                return fNubPort;
        }
 
        // init debug context
        error = init_debug_context(&fDebugContext, teamID, fNubPort);
        if (error != B_OK) {
-               fprintf(stderr, "%s: Failed to init debug context for team %ld: 
"
-                       "%s\n", kCommandName, teamID, strerror(error));
+               fprintf(stderr, "%s: Failed to init debug context for team %" 
B_PRId32
+                       ": %s\n", kCommandName, teamID, strerror(error));
                return error;
        }
 
@@ -112,14 +112,14 @@ Team::InitThread(Thread* thread)
 
        // create the sample area
        char areaName[B_OS_NAME_LENGTH];
-       snprintf(areaName, sizeof(areaName), "profiling samples %ld",
+       snprintf(areaName, sizeof(areaName), "profiling samples %" B_PRId32,
                thread->ID());
        void* samples;
        area_id sampleArea = create_area(areaName, &samples, B_ANY_ADDRESS,
                SAMPLE_AREA_SIZE, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
        if (sampleArea < 0) {
-               fprintf(stderr, "%s: Failed to create sample area for thread 
%ld: "
-                       "%s\n", kCommandName, thread->ID(), 
strerror(sampleArea));
+               fprintf(stderr, "%s: Failed to create sample area for thread %"
+                       B_PRId32 ": %s\n", kCommandName, thread->ID(), 
strerror(sampleArea));
                return sampleArea;
        }
 
@@ -160,8 +160,8 @@ Team::InitThread(Thread* thread)
                        B_DEBUG_START_PROFILER, &message, sizeof(message), 
&reply,
                        sizeof(reply));
                if (error != B_OK || (error = reply.error) != B_OK) {
-                       fprintf(stderr, "%s: Failed to start profiler for 
thread %ld: %s\n",
-                               kCommandName, thread->ID(), strerror(error));
+                       fprintf(stderr, "%s: Failed to start profiler for 
thread %"
+                               B_PRId32 ": %s\n", kCommandName, thread->ID(), 
strerror(error));
                        return error;
                }
 
diff --git a/src/bin/debug/profile/profile.cpp 
b/src/bin/debug/profile/profile.cpp
index 22f6338..b081d18 100644
--- a/src/bin/debug/profile/profile.cpp
+++ b/src/bin/debug/profile/profile.cpp
@@ -858,7 +858,7 @@ profile_single(const char* const* programArgs, int 
programArgCount)
        thread_info threadInfo;
        status_t error = get_thread_info(threadID, &threadInfo);
        if (error != B_OK) {
-               fprintf(stderr, "%s: Failed to get info for thread %ld: %s\n",
+               fprintf(stderr, "%s: Failed to get info for thread %" B_PRId32 
": %s\n",
                        kCommandName, threadID, strerror(error));
                exit(1);
        }
diff --git a/src/bin/listfont.cpp b/src/bin/listfont.cpp
index bcd15dc..930c814 100644
--- a/src/bin/listfont.cpp
+++ b/src/bin/listfont.cpp
@@ -140,14 +140,14 @@ main(int argc, char **argv)
                                        printf(", ");
 
                                int32 tunedCount = font.CountTuned();
-                               printf("%ld tuned", tunedCount);
+                               printf("%" B_PRId32 " tuned", tunedCount);
 
                                if (displayTuned) {
                                        printf(":");
                                        for (int32 i = 0; i < tunedCount; i++) {
                                                tuned_font_info info;
                                                font.GetTunedInfo(i, &info);
-                                               printf("\n\t(size %4.1f, shear 
%5.3f, rot. %5.3f, flags 0x%lx, face 0x%x)",
+                                               printf("\n\t(size %4.1f, shear 
%5.3f, rot. %5.3f, flags 0x%" B_PRIx32 ", face 0x%x)",
                                                        info.size,
                                                        info.shear, 
info.rotation, info.flags, info.face);
                                        }
diff --git a/src/bin/listimage.c b/src/bin/listimage.c
index 995988c..85b280f 100644
--- a/src/bin/listimage.c
+++ b/src/bin/listimage.c
@@ -23,6 +23,7 @@
 static status_t
 list_images_for_team_by_id(team_id id)
 {
+
        image_info imageInfo;
        int32 cookie = 0;
        team_info teamInfo;
@@ -34,12 +35,12 @@ list_images_for_team_by_id(team_id id)
                return result;
 
        i = asprintf(&header, "   ID   %*s   %*s  Seq#      Init# Name",
-               sizeof(uintptr_t) * 2, "Text", sizeof(uintptr_t) * 2, "Data");
+               (int)sizeof(uintptr_t) * 2, "Text", (int)sizeof(uintptr_t) * 2, 
"Data");
        if (i == -1)
                return B_NO_MEMORY;
 
-       i = asprintf(&format, "%%5" B_PRId32 " 0x%%0%" B_PRIu32 PRIxPTR
-               " 0x%%0%" B_PRIu32 PRIxPTR "  %%4" B_PRId32 " %%10" B_PRIu32 " 
%%s\n",
+       i = asprintf(&format, "%%5" B_PRId32 " 0x%%0%" B_PRIuSIZE PRIxPTR
+               " 0x%%0%" B_PRIuSIZE PRIxPTR "  %%4" B_PRId32 " %%10" B_PRIu32 
" %%s\n",
                sizeof(uintptr_t) * 2, sizeof(uintptr_t) * 2);
        if (i == -1) {
                free(header);
diff --git a/src/bin/listport.c b/src/bin/listport.c
index 5c8b87e..c9acfb3 100644
--- a/src/bin/listport.c
+++ b/src/bin/listport.c
@@ -2,7 +2,7 @@
 //
 //  Copyright (c) 2001-2003, OpenBeOS
 //
-//  This software is part of the OpenBeOS distribution and is covered 
+//  This software is part of the OpenBeOS distribution and is covered
 //  by the MIT License.
 //
 //
@@ -18,7 +18,7 @@
 
 
 void list_team_ports  (team_id id);
-void show_port_totals (void); 
+void show_port_totals (void);
 
 
 
@@ -26,11 +26,11 @@ int
 main(int argc, char **argv)
 {
        show_port_totals();
-       
+
        if (argc == 1) {
                int32     cookie = 0;
                team_info info;
-               
+
                // list for all teams
                while (get_next_team_info(&cookie, &info) >= B_OK)
                        list_team_ports(info.team);
@@ -39,7 +39,7 @@ main(int argc, char **argv)
                // list for each team_id on the command line
                while (--argc)
                        list_team_ports(atoi(*++argv));
-       
+
        return 0;
 }
 
@@ -49,36 +49,37 @@ show_port_totals()
 {
        int32       max = 0, used = 0, left;
        system_info sys;
-       
+
        if (get_system_info(&sys) == B_OK) {
                max  = sys.max_ports;
                used = sys.used_ports;
        }
-       
+
        left = max - used;
-       
-       printf("port: total: %5ld, used: %5ld, left: %5ld\n", max, used, left);
+
+       printf("port: total: %5" B_PRId32 ", used: %5" B_PRId32 ", left: %5"
+               B_PRId32 "\n", max, used, left);
 }
 
 
 void
 list_team_ports(team_id id)
-{      
+{
        int32      cookie = 0;
        port_info  this_port;
        team_info  this_team;
-       
+
        if (get_team_info(id, &this_team) == B_BAD_TEAM_ID) {
-               printf("\nteam %ld unknown\n", id);
+               printf("\nteam %" B_PRId32 " unknown\n", id);
                return;
        }
 
-       printf("\nTEAM %4ld (%s):\n", id, this_team.args);
+       printf("\nTEAM %4" B_PRId32 " (%s):\n", id, this_team.args);
        printf("   ID                         name  capacity  queued\n");
        printf("----------------------------------------------------\n");
-       
+
        while (get_next_port_info(id, &cookie, &this_port) == B_OK) {
-               printf("%5ld %28s  %8ld  %6ld\n",
+               printf("%5" B_PRId32 " %28s  %8" B_PRId32 "  %6" B_PRId32 "\n",
                        this_port.port,
                        this_port.name,
                        this_port.capacity,
diff --git a/src/bin/listres.cpp b/src/bin/listres.cpp
index c4419ca..f94215f 100644
--- a/src/bin/listres.cpp
+++ b/src/bin/listres.cpp
@@ -69,7 +69,7 @@ get_type(type_code type)
                        if (missed < 2)
                                sprintf(buffer, "'%c%c%c%c'", value[0], 
value[1], value[2], value[3]);
                        else
-                               sprintf(buffer, "0x%08lx", type);
+                               sprintf(buffer, "0x%08" B_PRIx32 "", type);
                        return buffer;
                }
        }
@@ -120,13 +120,13 @@ main(int argc, char *argv[])
                size_t size;
                int32 id;
                while (resources.GetResourceInfo(index++, &type, &id, &name, 
&size)) {
-                       printf("%11s %6ld %9ld  \"%s\"\n",
+                       printf("%11s %6" B_PRId32 " %9" B_PRIuSIZE "  \"%s\"\n",
                                get_type(type), id, size, name);
 
                        total += size;
                }
        }
 
-       printf("\n%Ld bytes total in resources.\n", total);
+       printf("\n%" B_PRIdOFF " bytes total in resources.\n", total);
        return 0;
 }
diff --git a/src/bin/lsindex.cpp b/src/bin/lsindex.cpp
index e0c9f68..367ad54 100644
--- a/src/bin/lsindex.cpp
+++ b/src/bin/lsindex.cpp
@@ -18,7 +18,7 @@
 static void
 print_help(void)
 {
-       fprintf (stderr, 
+       fprintf (stderr,
                "Usage: lsindex [--help | -v | --verbose | --mkindex | -l | 
--long] [volume path]\n"
                "   -l --long\t outputs long listing\n"
                "   -v --verbose\t gives index type, dates and owner\n"
@@ -46,7 +46,7 @@ print_index_type(const index_info &info, bool mkindexOutput)
                        return mkindexOutput ? "double" : "Double";
 
                default:
-                       sprintf(buffer, mkindexOutput ? "0x%08lx" : "Unknown 
type (0x%lx)", info.type);
+                       sprintf(buffer, mkindexOutput ? "0x%08" B_PRIx32 "" : 
"Unknown type(0x%" B_PRIx32 "", info.type);
                        return buffer;
        }
 }
@@ -110,8 +110,10 @@ static void
 print_index_long_stat(const index_info &info, char *name)
 {
        char modified[30];
-       strftime(modified, 30, "%m/%d/%Y %I:%M %p", 
localtime(&info.modification_time));
-       printf("%16s  %s  %8Ld %s\n", print_index_type(info, false), modified, 
info.size, name);
+       strftime(modified, 30, "%m/%d/%Y %I:%M %p",
+               localtime(&info.modification_time));
+       printf("%16s  %s  %8" B_PRIdOFF " %s\n", print_index_type(info, false),
+               modified, info.size, name);
 }
 
 
@@ -125,18 +127,20 @@ print_index_verbose_stat(const index_info &info, char 
*name)
        if (typeString != NULL)
                printf("%-10s\t", typeString);
        else
-               printf("%ld\t", info.type);
+               printf("%" B_PRIu32 "\t", info.type);
 
        // Size
-       printf("%10Ld  ", info.size);
+       printf("%10" B_PRIdOFF "  ", info.size);
 
        // Created
        char string[30];
-       strftime(string, sizeof(string), "%Y-%m-%d %H:%M", 
localtime(&info.creation_time)); 
+       strftime(string, sizeof(string), "%Y-%m-%d %H:%M",
+               localtime(&info.creation_time));
        printf("%s  ", string);
 
        // Modified
-       strftime(string, sizeof(string), "%Y-%m-%d %H:%M", 
localtime(&info.modification_time)); 
+       strftime(string, sizeof(string), "%Y-%m-%d %H:%M",
+               localtime(&info.modification_time));
        printf("%s", string);
 
        // User
@@ -168,13 +172,15 @@ main(int argc, char **argv)
                        else if (!strcmp(argv[i], "--mkindex"))
                                mkindexOutput = true;
                        else {
-                               fprintf(stderr, "%s: option %s is not 
understood (use --help for help)\n", argv[0], argv[i]);
+                               fprintf(stderr, "%s: option %s is not 
understood (use --help "
+                                       "for help)\n", argv[0], argv[i]);
                                return -1;
                        }
                } else {
                        device = dev_for_path(argv[i]);
                        if (device < 0) {
-                               fprintf(stderr, "%s: can't get information 
about volume: %s\n", argv[0], argv[i]);
+                               fprintf(stderr, "%s: can't get information 
about volume: %s\n",
+                                       argv[0], argv[i]);
                                return -1;
                        }
                }
@@ -182,7 +188,8 @@ main(int argc, char **argv)
 
        indices = fs_open_index_dir(device);
        if (indices == NULL) {
-               fprintf(stderr, "%s: can't open index dir of device %ld\n", 
argv[0], device);
+               fprintf(stderr, "%s: can't open index dir of device %" 
B_PRIdDEV "\n",
+                       argv[0], device);
                return -1;
        }
 
@@ -195,7 +202,8 @@ main(int argc, char **argv)
                dirent *index = fs_read_index_dir(indices);
                if (index == NULL) {
                        if (errno != B_ENTRY_NOT_FOUND && errno != B_OK) {
-                               printf("%s: fs_read_index_dir: (%d) %s\n", 
argv[0], errno, strerror(errno));
+                               printf("%s: fs_read_index_dir: (%d) %s\n", 
argv[0], errno,
+                                       strerror(errno));
                                return errno;
                        }
                        break;
@@ -205,7 +213,8 @@ main(int argc, char **argv)
                        index_info info;
 
                        if (fs_stat_index(device, index->d_name, &info) != 
B_OK) {
-                               printf("%s: fs_stat_index(): (%d) %s\n", 
argv[0], errno, strerror(errno));
+                               printf("%s: fs_stat_index(): (%d) %s\n", 
argv[0], errno,
+                                       strerror(errno));
                                return errno;
                        }
 
@@ -214,7 +223,8 @@ main(int argc, char **argv)
                        else if (longListing)
                                print_index_long_stat(info, index->d_name);
                        else /* mkindexOutput */
-                               printf("mkindex -t %s '%s'\n", 
print_index_type(info, true), index->d_name);
+                               printf("mkindex -t %s '%s'\n", 
print_index_type(info, true),
+                                       index->d_name);
                } else
                        printf("%s\n", index->d_name);
        }
diff --git a/src/bin/mail_utils/mail2mbox.cpp b/src/bin/mail_utils/mail2mbox.cpp
index 6e51ea1..bdaff43 100644
--- a/src/bin/mail_utils/mail2mbox.cpp
+++ b/src/bin/mail_utils/mail2mbox.cpp
@@ -55,7 +55,7 @@ DisplayErrorMessage(const char* messageString = NULL, 
status_t errorNumber = 0,
        }
 
        if (errorNumber != 0) {
-               snprintf(errorBuffer, sizeof(errorBuffer), "%s: %s (%lx)"
+               snprintf(errorBuffer, sizeof(errorBuffer), "%s: %s (%" B_PRIx32 
")"
                        "has occured.", messageString, strerror(errorNumber), 
errorNumber);
                messageString = errorBuffer;
        }
diff --git a/src/bin/mail_utils/spamdbm.cpp b/src/bin/mail_utils/spamdbm.cpp
index d89cd28..72304b3 100644
--- a/src/bin/mail_utils/spamdbm.cpp
+++ b/src/bin/mail_utils/spamdbm.cpp
@@ -2613,9 +2613,9 @@ status_t ABSApp::AddPositionIOToDatabase (
   NewAge = m_TotalGenuineMessages + m_TotalSpamMessages;
   if (NewAge >= 0xFFFFFFF0UL)
   {
-    sprintf (ErrorMessage, "The database is full!  There are %lu messages in "
-      "it and we can't add any more without overflowing the maximum integer "
-      "representation in 32 bits", NewAge);
+    sprintf (ErrorMessage, "The database is full!  There are %" B_PRIu32
+      " messages in it and we can't add any more without overflowing the "
+      "maximum integer representation in 32 bits", NewAge);
     return B_NO_MEMORY;
   }
 
@@ -3708,7 +3708,7 @@ status_t ABSApp::LoadSaveDatabase (bool DoLoad, char 
*ErrorMessage)
   else /* Saving */
   {
     fprintf (DatabaseFile,
-      "Classifications and total messages:\t%s\t%lu\t%s\t%lu\n",
+      "Classifications and total messages:\t%s\t%" B_PRIu32 "\t%s\t%" B_PRIu32 
"\n",
       g_ClassifiedGenuine, m_TotalGenuineMessages,
       g_ClassifiedSpam, m_TotalSpamMessages);
   }
@@ -3799,7 +3799,7 @@ status_t ABSApp::LoadSaveDatabase (bool DoLoad, char 
*ErrorMessage)
     EndIter = m_WordMap.end ();
     for (DataIter = m_WordMap.begin (); DataIter != EndIter; DataIter++)
     {
-      if (fprintf (DatabaseFile, "%s\t%lu\t%lu\t%lu\n",
+      if (fprintf (DatabaseFile, "%s\t%" B_PRIu32 "\t%" B_PRIu32 "\t%" 
B_PRIu32 "\n",
       DataIter->first.c_str (), DataIter->second.age,
       DataIter->second.genuineCount, DataIter->second.spamCount) <= 0)
       {
@@ -4240,7 +4240,7 @@ ABSApp::ProcessScriptingMessage (
     CommandText.Append (ArgumentBool ? " true" : " false");
   if (ArgumentGotInt32)
   {
-    sprintf (TempString, " %ld", ArgumentInt32);
+    sprintf (TempString, " %" B_PRId32, ArgumentInt32);
     CommandText.Append (TempString);
   }
 
@@ -4760,8 +4760,8 @@ ABSApp::PurgeOldWords (char *ErrorMessage)
   /* Just a little bug check here.  Just in case. */
 
   if (m_WordCount != m_WordMap.size ()) {
-    sprintf (TempString, "Our word count of %lu doesn't match the "
-      "size of the database, %lu", m_WordCount, m_WordMap.size());
+    sprintf (TempString, "Our word count of %" B_PRIu32 " doesn't match the "
+      "size of the database, %" B_PRIuSIZE, m_WordCount, m_WordMap.size());
     DisplayErrorMessage (TempString, -1, "Bug!");
     m_WordCount = m_WordMap.size ();
   }
@@ -5634,7 +5634,7 @@ CommanderLooper::CommandReferences (
 /* This function is called by other threads to see if the CommanderLooper is
 busy working on something. */
 
-bool 
+bool
 CommanderLooper::IsBusy ()
 {
   if (m_IsBusy)
@@ -6946,7 +6946,7 @@ ControlsView::PollServerForChanges ()
   m_PurgeAgeTextboxPntr != NULL)
   {
     m_PurgeAgeCachedValue = MyAppPntr->m_PurgeAge;
-    sprintf (TempString, "%lu", m_PurgeAgeCachedValue);
+    sprintf (TempString, "%" B_PRIu32, m_PurgeAgeCachedValue);
     m_PurgeAgeTextboxPntr->SetText (TempString);
   }
 
@@ -6956,7 +6956,7 @@ ControlsView::PollServerForChanges ()
   m_PurgePopularityTextboxPntr != NULL)
   {
     m_PurgePopularityCachedValue = MyAppPntr->m_PurgePopularity;
-    sprintf (TempString, "%lu", m_PurgePopularityCachedValue);
+    sprintf (TempString, "%" B_PRIu32, m_PurgePopularityCachedValue);
     m_PurgePopularityTextboxPntr->SetText (TempString);
   }
 
@@ -6978,7 +6978,7 @@ ControlsView::PollServerForChanges ()
   m_GenuineCountTextboxPntr != NULL)
   {
     m_GenuineCountCachedValue = MyAppPntr->m_TotalGenuineMessages;
-    sprintf (TempString, "%lu", m_GenuineCountCachedValue);
+    sprintf (TempString, "%" B_PRIu32, m_GenuineCountCachedValue);
     m_GenuineCountTextboxPntr->SetText (TempString);
   }
 
@@ -6988,7 +6988,7 @@ ControlsView::PollServerForChanges ()
   m_SpamCountTextboxPntr != NULL)
   {
     m_SpamCountCachedValue = MyAppPntr->m_TotalSpamMessages;
-    sprintf (TempString, "%lu", m_SpamCountCachedValue);
+    sprintf (TempString, "%" B_PRIu32, m_SpamCountCachedValue);
     m_SpamCountTextboxPntr->SetText (TempString);
   }
 
@@ -6998,7 +6998,7 @@ ControlsView::PollServerForChanges ()
   m_WordCountTextboxPntr != NULL)
   {
     m_WordCountCachedValue = MyAppPntr->m_WordCount;
-    sprintf (TempString, "%lu", m_WordCountCachedValue);
+    sprintf (TempString, "%" B_PRIu32, m_WordCountCachedValue);
     m_WordCountTextboxPntr->SetText (TempString);
   }
 
@@ -7090,11 +7090,11 @@ DatabaseWindow::DatabaseWindow ()
   if (m_WordsViewPntr == NULL)
     goto ErrorExit;
   AddChild (m_WordsViewPntr);

- /* Minimize the window if we are starting up in server mode.  This is done    
 
-       before the window is open so it doesn't flash onto the screen, and 
possibly      
-       steal a keystroke or two.  The ControlsView will further update the 
minimize     
-       mode when it detects changes in the server mode. */ 
+
+ /* Minimize the window if we are starting up in server mode.  This is done
+       before the window is open so it doesn't flash onto the screen, and 
possibly
+       steal a keystroke or two.  The ControlsView will further update the 
minimize
+       mode when it detects changes in the server mode. */
   Minimize (g_ServerMode);
 
   return;
@@ -7487,7 +7487,7 @@ WordsView::Draw (BRect UpdateRect)
     SetHighColor (0, 0, 0);
     SetDrawingMode (B_OP_OVER); /* So that antialiased text mixes better. */
 
-    sprintf (TempString, "%lu", StatisticsPntr->genuineCount);
+    sprintf (TempString, "%" B_PRIu32, StatisticsPntr->genuineCount);
     Width = m_TextFont.StringWidth (TempString);
     MovePenTo (ceilf (ColumnLeftCenterX - Width / 2), Y + m_AscentHeight);
     DrawString (TempString);
@@ -7497,7 +7497,7 @@ WordsView::Draw (BRect UpdateRect)
     MovePenTo (ceilf (ColumnMiddleCenterX - Width / 2), Y + m_AscentHeight);
     DrawString (TempString);
 
-    sprintf (TempString, "%lu", StatisticsPntr->spamCount);
+    sprintf (TempString, "%" B_PRIu32, StatisticsPntr->spamCount);
     Width = m_TextFont.StringWidth (TempString);
     MovePenTo (ceilf (ColumnRightCenterX - Width / 2), Y + m_AscentHeight);
     DrawString (TempString);
diff --git a/src/bin/mkdos/mkdos.cpp b/src/bin/mkdos/mkdos.cpp
index bd65352..d9ada96 100644
--- a/src/bin/mkdos/mkdos.cpp
+++ b/src/bin/mkdos/mkdos.cpp
@@ -43,56 +43,56 @@ void PrintUsage();
 void CreateVolumeLabel(void *sector, const char *label);
 status_t Initialize(int fatbits, const char *device, const char *label, bool 
noprompt, bool testmode);
 
-int 
+int
 main(int argc, char *argv[])
 {
        if (sizeof(bootsector1216) != 512 || sizeof(bootsector32) != 512 || 
sizeof(fsinfosector32) != 512) {
                printf("compilation error: struct alignment wrong\n");
                return 1;
        }
-       
+
        const char *device = NULL;
        const char *label = NULL;
        bool noprompt = false;
        bool test = false;
        int fat = 0;
-       
-       while (1) { 
+
+       while (1) {
                int c;
-               int option_index = 0; 
-               static struct option long_options[] = 
-               { 
-                       {"noprompt", no_argument, 0, 'n'}, 
-                       {"test", no_argument, 0, 't'}, 
-                       {"fat", required_argument, 0, 'f'}, 
-                       {0, 0, 0, 0} 
-               }; 
-               
-               c = getopt_long (argc, argv, "ntf:", long_options, 
&option_index); 
-               if (c == -1) 
-                       break; 
-
-               switch (c) { 
-                       case 'n': 
+               int option_index = 0;
+               static struct option long_options[] =
+               {
+                       {"noprompt", no_argument, 0, 'n'},
+                       {"test", no_argument, 0, 't'},
+                       {"fat", required_argument, 0, 'f'},
+                       {0, 0, 0, 0}
+               };
+
+               c = getopt_long (argc, argv, "ntf:", long_options, 
&option_index);
+               if (c == -1)
+                       break;
+
+               switch (c) {
+                       case 'n':
                                noprompt = true;
-                               break; 
+                               break;
 
                        case 't':
                                test = true;
-                               break; 
+                               break;
 
                        case 'f':
                                fat = strtol(optarg, NULL, 10);
-                               if (fat == 0) 
+                               if (fat == 0)
                                        fat = -1;
-                               break; 
+                               break;
 
-                       default: 
+                       default:
                        printf("\n");
                                PrintUsage();
                                return 1;
-               } 
-       } 
+               }
+       }
 
        if (optind < argc)
                device = argv[optind];
@@ -121,7 +121,7 @@ main(int argc, char *argv[])
 
        if (test)
                printf("test mode enabled (no writes will occur)\n");
-               
+
        status_t s;
        s = Initialize(fat, device, label, noprompt, test);
 
@@ -175,21 +175,28 @@ status_t Initialize(int fatbits, const char *device, 
const char *label, bool nop
                isRawDevice = true;
 
        if (hasBiosGeometry) {
-               printf("bios geometry: %ld heads, %ld cylinders, %ld 
sectors/track, %ld bytes/sector\n",
-                       
biosGeometry.head_count,biosGeometry.cylinder_count,biosGeometry.sectors_per_track,biosGeometry.bytes_per_sector);
+               printf("bios geometry: %" B_PRIu32 " heads, %" B_PRIu32 " 
cylinders, "
+                       "%" B_PRIu32 " sectors/track, %" B_PRIu32 " 
bytes/sector\n",
+                       biosGeometry.head_count, biosGeometry.cylinder_count,
+                       biosGeometry.sectors_per_track, 
biosGeometry.bytes_per_sector);
        }
        if (hasBiosGeometry) {
-               printf("device geometry: %ld heads, %ld cylinders, %ld 
sectors/track, %ld bytes/sector\n",
-                       
deviceGeometry.head_count,deviceGeometry.cylinder_count,deviceGeometry.sectors_per_track,deviceGeometry.bytes_per_sector);
+               printf("device geometry: %" B_PRIu32 " heads, %" B_PRIu32 " 
cylinders, "
+                       "%" B_PRIu32 " sectors/track, %" B_PRIu32 " 
bytes/sector\n",
+                       deviceGeometry.head_count, 
deviceGeometry.cylinder_count,
+                       deviceGeometry.sectors_per_track, 
deviceGeometry.bytes_per_sector);
        }
        if (hasPartitionInfo) {
-               printf("partition info: start at %Ld bytes (%Ld sectors), %Ld 
KB, %Ld MB, %Ld GB\n",
+               printf("partition info: start at %" B_PRIdOFF " bytes (%" 
B_PRIdOFF
+                       " sectors), %" B_PRIdOFF " KB, %" B_PRIdOFF " MB, %" 
B_PRIdOFF
+                       " GB\n",
                        partitionInfo.offset,
                        partitionInfo.offset / 512,
                        partitionInfo.offset / 1024,
                        partitionInfo.offset / (1024 * 1024),
                        partitionInfo.offset / (1024 * 1024 * 1024));
-               printf("partition info: size %Ld bytes, %Ld KB, %Ld MB, %Ld 
GB\n",
+               printf("partition info: size %" B_PRIdOFF " bytes, %" B_PRIdOFF 
" KB, "
+                       "%" B_PRIdOFF " MB, %" B_PRIdOFF " GB\n",
                        partitionInfo.size,
                        partitionInfo.size / 1024,
                        partitionInfo.size / (1024 * 1024),
@@ -199,14 +206,14 @@ status_t Initialize(int fatbits, const char *device, 
const char *label, bool nop
        if (!isRawDevice && !hasPartitionInfo) {
                fprintf(stderr,"Warning: couldn't get partition information\n");
        }
-       if ((hasBiosGeometry && biosGeometry.bytes_per_sector != 512) 
+       if ((hasBiosGeometry && biosGeometry.bytes_per_sector != 512)
                ||      (hasDeviceGeometry && deviceGeometry.bytes_per_sector 
!= 512)) {
                fprintf(stderr,"Error: geometry block size not 512 bytes\n");
                close(fd);
                return B_ERROR;
        } else if (hasPartitionInfo && partitionInfo.logical_block_size != 512) 
{
-               printf("partition logical block size is not 512, it's %ld 
bytes\n",
-                       partitionInfo.logical_block_size);
+               printf("partition logical block size is not 512, it's %" 
B_PRId32
+                       " bytes\n", partitionInfo.logical_block_size);
        }
 
        if (hasDeviceGeometry && deviceGeometry.read_only) {
@@ -245,13 +252,14 @@ status_t Initialize(int fatbits, const char *device, 
const char *label, bool nop
                return B_ERROR;
        }*/
 
-       printf("size = %Ld bytes (%Ld sectors), %Ld KB, %Ld MB, %Ld GB\n",
+       printf("size = %" B_PRIu64 " bytes (%" B_PRIu64 " sectors), %" B_PRIu64
+               " KB, %" B_PRIu64 " MB, %" B_PRIu64 " GB\n",
                size,
                size / 512,
                size / 1024,
                size / (1024 * 1024),
                size / (1024 * 1024 * 1024));
-       
+
        if (fatbits == 0) {
                //auto determine fat type
                if (isRawDevice && size <= FLOPPY_MAX_SIZE && (size / 
FAT12_CLUSTER_MAX_SIZE) < FAT12_MAX_CLUSTER_COUNT) {
@@ -279,8 +287,8 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
                if (size <= 2091008LL)
                        sectorPerCluster = 1;   // XXX don't know the correct 
value
        } else if (fatbits == 16) {
-               // special BAD_CLUSTER value is 0xFFF7, 
-               // but this should work anyway, since space required by 
+               // special BAD_CLUSTER value is 0xFFF7,
+               // but this should work anyway, since space required by
                // two FATs will make maximum cluster count smaller.
                // at least, this is what I think *should* happen
                sectorPerCluster = 0;                           //larger than 2 
GB must fail
@@ -358,14 +366,14 @@ status_t Initialize(int fatbits, const char *device, 
const char *label, bool nop
        // RootDirSectors should now contain the size of the fat12/16 root 
directory, measured in sectors
 
        printf("fatbits = %d, clustersize = %d\n", fatbits, sectorPerCluster * 
512);
-       printf("FAT size is %ld sectors\n", FATSize);
+       printf("FAT size is %" B_PRIu32 " sectors\n", FATSize);
        printf("disk label: %s\n", label);
 
        char bootsector[512];
        memset(bootsector,0x00,512);
        memcpy(bootsector + BOOTJMP_START_OFFSET, bootjmp, sizeof(bootjmp));
        memcpy(bootsector + BOOTCODE_START_OFFSET, bootcode, sizeof(bootcode));
-       
+
        if (fatbits == 32) {
                bootsector32 *bs = (bootsector32 *)bootsector;
                uint16 temp16;
@@ -454,7 +462,7 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
                close(fd);
                return B_OK;
        }
-       
+
        // Disk layout:
        // 0) reserved sectors, this includes the bootsector, fsinfosector and 
bootsector backup
        // 1) FAT
@@ -474,7 +482,8 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
                ssize_t writesize = min_c(bytes_to_write, 65536);
                written = write_pos(fd, pos, zerobuffer, writesize);
                if (written != writesize) {
-                       fprintf(stderr,"Error: write error near sector 
%Ld\n",pos / 512);
+                       fprintf(stderr, "Error: write error near sector %" 
B_PRId64 "\n",
+                               pos / 512);
                        close(fd);
                        return B_ERROR;
                }
@@ -482,7 +491,7 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
                pos += writesize;
        }
        free(zerobuffer);
-       
+
        //write boot sector
        printf("Writing boot block\n");
        written = write_pos(fd, BOOT_SECTOR_NUM * 512, bootsector, 512);
@@ -500,7 +509,7 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
                        return B_ERROR;
                }
        }
-       
+
        //write first fat sector
        printf("Writing first FAT sector\n");
        uint8 sec[512];
@@ -544,7 +553,8 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
        if (numFATs > 1) {
                written = write_pos(fd, (reservedSectorCount + FATSize) * 
512,sec,512);
                if (written != 512) {
-                       fprintf(stderr,"Error: write error at sector %ld\n", 
reservedSectorCount + FATSize);
+                       fprintf(stderr,"Error: write error at sector %" 
B_PRIu32 "\n",
+                               reservedSectorCount + FATSize);
                        close(fd);
                        return B_ERROR;
                }
@@ -560,7 +570,7 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
                //convert from sector to clustercount
                free_count /= sectorPerCluster;
                //and account for 1 already used cluster of root directory
-               free_count -= 1; 
+               free_count -= 1;
                fsinfosector32 fsinfosector;
                memset(&fsinfosector,0x00,512);
                fsinfosector.FSI_LeadSig        = 
B_HOST_TO_LENDIAN_INT32(0x41615252);
@@ -585,7 +595,8 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
                uint32 rootDirSector = reservedSectorCount + (numFATs * 
FATSize);
                written = write_pos(fd, rootDirSector * 512, data, 512);
                if (written != 512) {
-                       fprintf(stderr,"Error: write error at sector %ld\n", 
rootDirSector);
+                       fprintf(stderr,"Error: write error at sector %" 
B_PRIu32 "\n",
+                               rootDirSector);
                        close(fd);
                        return B_ERROR;
                }
@@ -598,7 +609,8 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
                written = write_pos(fd, rootDirSector * 512, cluster, size);
                free(cluster);
                if (written != size) {
-                       fprintf(stderr,"Error: write error at sector %ld\n", 
rootDirSector);
+                       fprintf(stderr,"Error: write error at sector %" 
B_PRIu32 "\n",
+                               rootDirSector);
                        close(fd);
                        return B_ERROR;
                }
@@ -606,7 +618,7 @@ status_t Initialize(int fatbits, const char *device, const 
char *label, bool nop
 
        ioctl(fd, B_FLUSH_DRIVE_CACHE);
        close(fd);
-       
+
        return B_OK;
 }
 
@@ -616,7 +628,7 @@ void CreateVolumeLabel(void *sector, const char *label)
        // XXX convert from UTF8, and check for valid characters
        // XXX this could be changed to use long file name entrys,
        // XXX but the dosfs would have to be updated, too
-       
+
        dirent *d = (dirent *)sector;
        memset(d, 0, sizeof(*d));
        memset(d->Name, 0x20, 11);
@@ -633,4 +645,4 @@ void PrintUsage()
        printf("       -n, --noprompt  do not prompt before writing\n");
        printf("       -t, --test      enable test mode (will not write to 
disk)\n");
        printf("       -f, --fat       use FAT entries of the specified 
size\n");
-}       
+}
diff --git a/src/bin/network/ftpd/ftpcmd.y b/src/bin/network/ftpd/ftpcmd.y
index 6ecd924..2caf028 100644
--- a/src/bin/network/ftpd/ftpcmd.y
+++ b/src/bin/network/ftpd/ftpcmd.y
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD: src/libexec/ftpd/ftpcmd.y,v 1.66 
2007/04/18 22:43:39 yar Exp
 #include <ctype.h>
 #include <errno.h>
 #include <glob.h>
+#include <inttypes.h>
 #include <libutil.h>
 #include <limits.h>
 #include <md5.h>
@@ -915,7 +916,7 @@ rcmd
                                        free(fromname);
                                fromname = NULL;
                                restart_point = $4.o;
-                               reply(350, "Restarting at %lld. %s",
+                               reply(350, "Restarting at %" PRId64 ". %s",
                                    (intmax_t)restart_point,
                                    "Send STORE or RETRIEVE to initiate 
transfer.");
                        }
@@ -1608,7 +1609,7 @@ sizecmd(char *filename)
                else if (!S_ISREG(stbuf.st_mode))
                        reply(550, "%s: not a plain file.", filename);
                else
-                       reply(213, "%lld", (intmax_t)stbuf.st_size);
+                       reply(213, "%" PRId64, (intmax_t)stbuf.st_size);
                break; }
        case TYPE_A: {
                FILE *fin;
@@ -1642,7 +1643,7 @@ sizecmd(char *filename)
                }
                (void) fclose(fin);
 
-               reply(213, "%lld", (intmax_t)count);
+               reply(213, "%" PRId64, (intmax_t)count);
                break; }
        default:
                reply(504, "SIZE not implemented for type %s.",
diff --git a/src/bin/network/ftpd/ftpd.c b/src/bin/network/ftpd/ftpd.c
index 92f1a81..fc3f984 100644
--- a/src/bin/network/ftpd/ftpd.c
+++ b/src/bin/network/ftpd/ftpd.c
@@ -75,6 +75,7 @@ __FBSDID("$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.212 
2007/04/18 22:43:39 yar Exp
 #include <errno.h>
 #include <fcntl.h>
 #include <glob.h>
+#include <inttypes.h>
 #include <limits.h>
 #include <netdb.h>
 #include <pwd.h>
@@ -1939,7 +1940,7 @@ dataconn(char *name, off_t size, char *mode)
        byte_count = 0;
        if (size != -1)
                (void) snprintf(sizebuf, sizeof(sizebuf),
-                               " (%lld bytes)", (intmax_t)size);
+                               " (%" PRId64 " bytes)", (intmax_t)size);
        else
                *sizebuf = '\0';
        if (pdata >= 0) {
@@ -2852,10 +2853,10 @@ myoob(void)
        if (strcmp(cp, "STAT\r\n") == 0) {
                tmpline[0] = '\0';
                if (file_size != -1)
-                       reply(213, "Status: %lld of %lld bytes transferred.",
+                       reply(213, "Status: %" PRId64 " of %" PRId64 " bytes 
transferred.",
                                   (intmax_t)byte_count, (intmax_t)file_size);
                else
-                       reply(213, "Status: %lld bytes transferred.",
+                       reply(213, "Status: %" PRId64 " bytes transferred.",
                                   (intmax_t)byte_count);
        }
        return (0);
@@ -3395,7 +3396,7 @@ logcmd(char *cmd, char *file1, char *file2, off_t cnt)
        if (file2)
                appendf(&msg, " %s", file2);
        if (cnt >= 0)
-               appendf(&msg, " = %lld bytes", (intmax_t)cnt);
+               appendf(&msg, " = %" PRId64 " bytes", (intmax_t)cnt);
        appendf(&msg, " (wd: %s", wd);
        if (guest || dochroot)
                appendf(&msg, "; chrooted");
@@ -3417,7 +3418,7 @@ logxfer(char *name, off_t size, time_t start)
                        syslog(LOG_NOTICE, "realpath failed on %s: %m", path);
                        return;
                }
-               snprintf(buf, sizeof(buf), "%.20s!%s!%s!%s!%lld!%ld\n",
+               snprintf(buf, sizeof(buf), "%.20s!%s!%s!%s!%" PRId64 "!%ld\n",
                        ctime(&now)+4, ident, remotehost,
                        path, (intmax_t)size,
                        (long)(now - start + (now == start)));
diff --git a/src/bin/network/ifconfig/ifconfig.cpp 
b/src/bin/network/ifconfig/ifconfig.cpp
index 9c14bff..8722c9b 100644
--- a/src/bin/network/ifconfig/ifconfig.cpp
+++ b/src/bin/network/ifconfig/ifconfig.cpp
@@ -590,12 +590,12 @@ list_interface(const char* name)
 
        ifreq_stats stats;
        if (interface.GetStats(stats) == B_OK) {
-               printf("\tReceive: %d packets, %d errors, %Ld bytes, %d mcasts, 
%d "
-                       "dropped\n", stats.receive.packets, 
stats.receive.errors,
+               printf("\tReceive: %d packets, %d errors, %" B_PRIu64 " bytes, 
%d "
+                       "mcasts, %d dropped\n", stats.receive.packets, 
stats.receive.errors,
                        stats.receive.bytes, stats.receive.multicast_packets,
                        stats.receive.dropped);
-               printf("\tTransmit: %d packets, %d errors, %Ld bytes, %d 
mcasts, %d "
-                       "dropped\n", stats.send.packets, stats.send.errors,
+               printf("\tTransmit: %d packets, %d errors, %" B_PRIu64 " bytes, 
%d "
+                       "mcasts, %d dropped\n", stats.send.packets, 
stats.send.errors,
                        stats.send.bytes, stats.send.multicast_packets, 
stats.send.dropped);
                printf("\tCollisions: %d\n", stats.collisions);
        }
diff --git a/src/bin/network/netstat/netstat.cpp 
b/src/bin/network/netstat/netstat.cpp
index 85fde80..b1538d3 100644
--- a/src/bin/network/netstat/netstat.cpp
+++ b/src/bin/network/netstat/netstat.cpp
@@ -196,9 +196,9 @@ main(int argc, char** argv)
                        else
                                name = info.args;
 
-                       printf("%ld/%s\n", stat.owner, name);
+                       printf("%" B_PRId32 "/%s\n", stat.owner, name);
                } else
-                       printf("%ld\n", stat.owner);
+                       printf("%" B_PRId32 "\n", stat.owner);
        }
 
        return 0;
diff --git a/src/bin/playsound/playsound.cpp b/src/bin/playsound/playsound.cpp
index b6aa495..fe701e0 100644
--- a/src/bin/playsound/playsound.cpp
+++ b/src/bin/playsound/playsound.cpp
@@ -53,34 +53,34 @@ main(int argc, char *argv[])
        bool loop = false;
        int gain = 100;
        int pan = 0;
-       
-       while (1) { 
+
+       while (1) {
                int c;
-               int option_index = 0; 
-               static struct option long_options[] = 
-               { 
-                       {"loop", no_argument, 0, 'l'}, 
-                       {"gain", required_argument, 0, 'g'}, 
-                       {"pan", required_argument, 0, 'p'}, 
-                       {0, 0, 0, 0} 
-               }; 
-               
-               c = getopt_long (argc, argv, "lgp:", long_options, 
&option_index); 
-               if (c == -1) 
-                       break; 
-
-               switch (c) { 
-                       case 'l': 
+               int option_index = 0;
+               static struct option long_options[] =
+               {
+                       {"loop", no_argument, 0, 'l'},
+                       {"gain", required_argument, 0, 'g'},
+                       {"pan", required_argument, 0, 'p'},
+                       {0, 0, 0, 0}
+               };
+

[ *** diff truncated: 686 lines dropped *** ]




Other related posts:

  • » [haiku-commits] BRANCH jessicah-github.fixing-warnings [69f687ba5cea] in src: bin bin/debug/profile bin/mkdos add-ons/kernel/drivers/audio/ac97/auvia bin/mail_utils - jessicah-github . fixing-warnings