[openbeos-preferences] Re: Codycam Warning fixes
- From: Sikosis <phil@xxxxxxxxxxx>
- To: openbeos-preferences@xxxxxxxxxxxxx
- Date: Mon, 1 Dec 2003 09:47:40 +1100
Do you have write access ?
Cheers
Sikosis
OBOS Pref Team Leader
http://obos.gravity24hr.com/
http://openbeos.org/
Quoting Niels Reedijk <n.reedijk@xxxxxxxxx>:
> Hi,
>
> I've fixed a whole number of warnings.
>
> patch-1
> Fix numerous warnings in codycam
>
> Can I merge these with the main cvs repository?
>
> Niels
>
>
> --- orig/CodyCam.cpp
> +++ mod/CodyCam.cpp
> @@ -93,9 +93,6 @@
> CodyCam::ReadyToRun()
> {
> /* create the window for the app */
> - uint32 x = WINDOW_SIZE_X;
> - uint32 y = WINDOW_SIZE_Y;
> -
> fWindow = new VideoWindow(BRect(28, 28, 28 + (WINDOW_SIZE_X-1),
> 28 + (WINDOW_SIZE_Y-1)),
> (const
> char *)"CodyCam", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE, &
> fPort);
>
> @@ -127,8 +124,6 @@
> void
> CodyCam::MessageReceived(BMessage *message)
> {
> - status_t status;
> -
> switch (message->what)
> {
> case msg_start:
> @@ -368,7 +363,7 @@
> ErrorAlert(const char * message, status_t err)
> {
> char msg[256];
> - sprintf(msg, "%s\n%s [%x]", message, strerror(err), err);
> + sprintf(msg, "%s\n%s [%lx]", message, strerror(err), err);
> (new BAlert("", msg, "Quit"))->Go();
> be_app->PostMessage(B_QUIT_REQUESTED);
> }
> @@ -424,9 +419,9 @@
>
> VideoWindow::VideoWindow (BRect frame, const char *title, window_type
> type, uint32 flags, port_id * consumerport) :
> BWindow(frame,title,type,flags),
> + fPortPtr(consumerport),
> fView(NULL),
> - fVideoView(NULL),
> - fPortPtr(consumerport)
> + fVideoView(NULL)
> {
> fFtpInfo.port = 0;
> fFtpInfo.rate = 0x7fffffff;
> @@ -519,7 +514,6 @@
> VideoWindow::MessageReceived(BMessage *message)
> {
> BControl *p;
> - uint32 index;
>
> p = NULL;
> message->FindPointer((const char *)"source",(void **)&p);
> @@ -868,7 +862,6 @@
> ControlWindow::MessageReceived(BMessage * message)
> {
> BParameterWeb * web = NULL;
> - BView * panel = NULL;
> status_t err;
>
> switch (message->what)
>
> --- orig/FtpClient.cpp
> +++ mod/FtpClient.cpp
> @@ -44,7 +44,7 @@
> {
> bool rc = false;
> string cmd, replystr;
> - int code, codetype, i, numread;
> + int code, codetype, numread;
> char buf[513];
>
> cmd = "TYPE A";
> @@ -453,7 +453,7 @@
>
> if(m_control != 0)
> {
> - if(cmd.find("PASS") != -1)
> + if(cmd.find("PASS") != string::npos)
> printf("PASS <suppressed> (real password sent)
> \n");
> else
> printf("%s\n", ccmd.c_str());
> @@ -607,7 +607,6 @@
> unsigned short port;
> BNetAddress addr;
> int i, code, codetype;
> - char buf[32];
> bool rc = false;
> struct sockaddr_in sa;
>
> --- orig/VideoConsumer.cpp
> +++ mod/VideoConsumer.cpp
> @@ -43,21 +43,21 @@
> BMediaNode(name),
> BMediaEventLooper(),
> BBufferConsumer(B_MEDIA_RAW_VIDEO),
> - mView(view),
> - mWindow(NULL),
> mStatusLine(statusLine),
> mInternalID(internal_id),
> mAddOn(addon),
> - mTimeToFtp(false),
> - mFtpComplete(true),
> - mRate(1000000),
> - mImageFormat(0),
> - mTranslator(0),
> - mPassiveFtp(true),
> mConnectionActive(false),
> mMyLatency(20000),
> + mWindow(NULL),
> + mView(view),
> + mOurBuffers(false),
> mBuffers(NULL),
> - mOurBuffers(false)
> + mTimeToFtp(false),
> + mFtpComplete(true),
> + mRate(1000000),
> + mImageFormat(0),
> + mTranslator(0),
> + mPassiveFtp(true)
> {
> FUNCTION("VideoConsumer::VideoConsumer\n");
>
> @@ -85,7 +85,6 @@
> VideoConsumer::~VideoConsumer()
> {
> FUNCTION("VideoConsumer::~VideoConsumer\n");
> - status_t status;
>
> Quit();
>
> @@ -196,6 +195,9 @@
>
> ERROR("VideoConsumer::RequestCompleted: Not using our buffers!\n");
> }
> break;
> + default:
> + ERROR("VideoConsumer::RequestCompleted: Invalid
> argument\n");
> + break;
> }
> return B_OK;
> }
> @@ -240,7 +242,7 @@
> void
> VideoConsumer::BufferReceived(BBuffer * buffer)
> {
> - LOOP("VideoConsumer::Buffer #%d received\n", buffer->ID());
> + LOOP("VideoConsumer::Buffer #%ld received\n", buffer->ID());
>
> if (RunState() == B_STOPPED)
> {
> @@ -284,7 +286,6 @@
> // create a buffer group
> uint32 mXSize = with_format.u.raw_video.display.line_width;
> uint32 mYSize = with_format.u.raw_video.display.line_count;
> - uint32 mRowBytes =
> with_format.u.raw_video.display.bytes_per_row;
> color_space mColorspace =
> with_format.u.raw_video.display.format;
> PROGRESS("VideoConsumer::CreateBuffers - Colorspace = %d\n",
> mColorspace);
>
> @@ -317,7 +318,7 @@
> }
> else
> {
> - ERROR("VideoConsumer::CreateBuffers - ERROR
> CREATING VIDEO RING BUFFER: %08x\n", status);
> + ERROR("VideoConsumer::CreateBuffers - ERROR
> CREATING VIDEO RING BUFFER: %08lx\n", status);
> return B_ERROR;
> }
> }
> @@ -330,7 +331,7 @@
> if (buffList[j] != NULL)
> {
> mBufferMap[j] = (uint32) buffList[j];
> - PROGRESS(" j = %d buffer = %08x\n", j,
> mBufferMap[j]);
> + PROGRESS(" j = %d buffer = %08lx\n", j,
> mBufferMap[j]);
> }
> else
> {
> @@ -350,7 +351,6 @@
> VideoConsumer::DeleteBuffers()
> {
> FUNCTION("VideoConsumer::DeleteBuffers\n");
> - status_t status;
>
> if (mBuffers)
> {
>
- References:
- [openbeos-preferences] Codycam Warning fixes
- From: Niels Reedijk
Other related posts:
- » [openbeos-preferences] Codycam Warning fixes
- » [openbeos-preferences] Re: Codycam Warning fixes
- [openbeos-preferences] Codycam Warning fixes
- From: Niels Reedijk