You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/11 18:38:17 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6596: vncserver enhancement

pkarashchenko commented on code in PR #6596:
URL: https://github.com/apache/incubator-nuttx/pull/6596#discussion_r918240928


##########
drivers/video/vnc/vnc_fbdev.c:
##########
@@ -631,6 +694,27 @@ int up_fbinitialize(int display)
 
   session->mouseout = vnc_touch_event;
 #endif
+
+#ifdef CONFIG_VNCSERVER_KBD
+  ret = snprintf(kbd_name, NAME_MAX, CONFIG_VNCSERVER_KBD_DEVNAME "%d",
+                 display);

Review Comment:
   ```suggestion
     ret = snprintf(kbd_name, sizeof(kbd_name), CONFIG_VNCSERVER_KBD_DEVNAME "%d",
                    display);
   ```



##########
drivers/video/vnc/vnc_fbdev.c:
##########
@@ -855,5 +942,17 @@ void up_fbuninitialize(int display)
 
       vnc_touch_unregister(session, devname);
 #endif
+
+#ifdef CONFIG_VNCSERVER_KBD
+      ret = snprintf(devname, NAME_MAX, CONFIG_VNCSERVER_KBD_DEVNAME "%d",
+                    display);

Review Comment:
   ```suggestion
         ret = snprintf(devname, sizeof(devname), CONFIG_VNCSERVER_KBD_DEVNAME "%d",
                        display);
   ```
   and same for above



##########
drivers/video/vnc/vnc_fbdev.c:
##########
@@ -602,17 +660,22 @@ int up_fbinitialize(int display)
   int ret;
   FAR struct vnc_session_s *session;
 #ifdef CONFIG_VNCSERVER_TOUCH
-  char devname[NAME_MAX];
+  char touch_name[NAME_MAX];
+#endif
+#ifdef CONFIG_VNCSERVER_KBD
+  char kbd_name[NAME_MAX];
 #endif
 
   DEBUGASSERT(display >= 0 && display < RFB_MAX_DISPLAYS);
 
+  ret = vnc_session_alloc();
+
   /* Save the input callout function information in the session structure. */
 
   session           = g_vnc_sessions[display];
 #ifdef CONFIG_VNCSERVER_TOUCH
 
-  ret = snprintf(devname, NAME_MAX, CONFIG_VNCSERVER_TOUCH_DEVNAME "%d",
+  ret = snprintf(touch_name, NAME_MAX, CONFIG_VNCSERVER_TOUCH_DEVNAME "%d",
                  display);

Review Comment:
   ```suggestion
     ret = snprintf(touch_name, sizeof(touch_name), CONFIG_VNCSERVER_TOUCH_DEVNAME "%d",
                    display);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org