You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/09/17 11:42:17 UTC

[incubator-nuttx-apps] branch master updated: examples/fb: correct the munmap(2) parameter type

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 0f524ca  examples/fb: correct the munmap(2) parameter type
0f524ca is described below

commit 0f524ca013a1390304ed90156931389ac093f73a
Author: chao.an <an...@xiaomi.com>
AuthorDate: Thu Sep 17 16:55:05 2020 +0800

    examples/fb: correct the munmap(2) parameter type
    
    fb_main.c: In function 'fb_main':
    fb_main.c:473:15: warning: passing argument 1 of 'munmap' makes pointer from integer without a cast [-Wint-conversion]
      473 |   munmap(state.fd, state.fbmem);
          |          ~~~~~^~~
          |               |
          |               int
    In file included from fb_main.c:43:
    /home/archer/code/upload/incubator-nuttx/include/sys/mman.h:177:22: note: expected 'void *' but argument is of type 'int'
      177 | int munmap(FAR void *start, size_t length);
          |                ~~~~~~^~~~~
    fb_main.c:473:25: warning: passing argument 2 of 'munmap' makes integer from pointer without a cast [-Wint-conversion]
      473 |   munmap(state.fd, state.fbmem);
          |                    ~~~~~^~~~~~
          |                         |
          |                         void *
    In file included from fb_main.c:43:
    /home/archer/code/upload/incubator-nuttx/include/sys/mman.h:177:36: note: expected 'size_t' {aka 'unsigned int'} but argument is of type 'void *'
      177 | int munmap(FAR void *start, size_t length);
          |                             ~~~~~~~^~~~~~
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 examples/fb/fb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/fb/fb_main.c b/examples/fb/fb_main.c
index 86a6b13..d0d037b 100644
--- a/examples/fb/fb_main.c
+++ b/examples/fb/fb_main.c
@@ -470,7 +470,7 @@ int main(int argc, FAR char *argv[])
     }
 
   printf("Test finished\n");
-  munmap(state.fd, state.fbmem);
+  munmap(state.fbmem, state.pinfo.fblen);
   close(state.fd);
   return EXIT_SUCCESS;
 }