gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. ef5660c87b65242be964


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. ef5660c87b65242be96435093841d7aa6b25e4c2
Date: Thu, 09 Dec 2010 17:29:24 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  ef5660c87b65242be96435093841d7aa6b25e4c2 (commit)
      from  fbc5d9e9d82f596a5872a4e162b65aa48428aefc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=ef5660c87b65242be96435093841d7aa6b25e4c2


commit ef5660c87b65242be96435093841d7aa6b25e4c2
Author: Petter Reinholdtsen <address@hidden>
Date:   Thu Dec 9 10:01:05 2010 +0100

    Get rid of warnings in findwebcams.cpp
    
    [Petter Reinholdtsen]
    > I had a look at the following warnings from the current build on
    > squeeze-kfreebsd.
    >
    > findwebcams.cpp:132: warning: comparison between signed and unsigned 
integer expressions
    > findwebcams.cpp:161: warning: comparison between signed and unsigned 
integer expressions
    > findwebcams.cpp:170: warning: comparison between signed and unsigned 
integer expressions
    > findwebcams.cpp:173: warning: format '%d' expects type 'int', but 
argument 2 has type 'size_t'
    > findwebcams.cpp:208: warning: comparison between signed and unsigned 
integer expressions
    >
    > I believe this patch solve the issues, bu using size_t for
    > non-negative values and casting the size_t argument to %d to (int).
    
    Here is an updated patch, based on the current git repository.  The
    format issue is already fixed in git, so only the signed/unsigned
    issues are fixed in this patch.
    
    Signed-off-by: Sandro Santilli <address@hidden>

diff --git a/utilities/findwebcams.cpp b/utilities/findwebcams.cpp
index d98d160..c98113e 100644
--- a/utilities/findwebcams.cpp
+++ b/utilities/findwebcams.cpp
@@ -51,7 +51,7 @@ data::data() {
 
 gint numDuplicates = 0;
 
-gint findVidDevs(std::vector<data*>& vidVect) {
+size_t findVidDevs(std::vector<data*>& vidVect) {
     gint numdevs = 0;
     
     //vid test source
@@ -106,7 +106,6 @@ gint findVidDevs(std::vector<data*>& vidVect) {
     probe = NULL;
     element = NULL;
     devarr = NULL;
-    gint g;
     
     element = gst_element_factory_make ("v4l2src", "v4l2vidsrc");
     probe = GST_PROPERTY_PROBE (element);
@@ -130,7 +129,7 @@ gint findVidDevs(std::vector<data*>& vidVect) {
             vidVect[numdevs]->deviceNumber = numdevs;
             //mark duplicates (we like v4l2 sources more than v4l, so if
             //they're both detected, mark the v4l source as a duplicate)
-            for (g=1; g < (vidVect.size()-1); g++) {
+            for (size_t g=1; g < (vidVect.size()-1); g++) {
                 if (strcmp(vidVect[numdevs]->deviceName,
                         vidVect[g]->deviceName) == 0) {
                     vidVect[g]->duplicate = true;
@@ -149,7 +148,7 @@ gint findVidDevs(std::vector<data*>& vidVect) {
 int main () {
     //initialize gstreamer to probe for devs
     gst_init(NULL, NULL);
-    gint numdevs = 0;
+    size_t numdevs = 0;
     std::vector<data*> vidVector;
     
     int fromrc = rcfile.getWebcamDevice();
@@ -207,17 +206,17 @@ int main () {
             } else {
                 dev_select = atoi(fromCin.c_str());
             }
-            if ((dev_select < 0) || (dev_select > (numdevs - numDuplicates - 
1))) {
+            if ((dev_select < 0) || (dev_select > ((int)numdevs - 
numDuplicates - 1))) {
                 std::cout << "You must make a valid device selection" << 
std::endl;
             }
-        } while ((dev_select < 0) || (dev_select > (numdevs - numDuplicates - 
1)));
+        } while ((dev_select < 0) || (dev_select > ((int)numdevs - 
numDuplicates - 1)));
         std::cout << std::endl
              << "To select this camera, add this line to your gnashrc file:" 
<< std::endl
              << "set webcamDevice "
              << (vidVector[dev_select + numDuplicates]->deviceNumber) << 
std::endl;
     } else {
         numdevs = findVidDevs(vidVector);
-        if (fromrc <= (vidVector.size() - 1)) {
+        if ((size_t)fromrc <= (vidVector.size() - 1)) {
             std::cout << std::endl
                  << "The gnashrc file reports default webcam is set to:" << 
std::endl
                  << vidVector[fromrc]->deviceName

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

Summary of changes:
 utilities/findwebcams.cpp |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]