Scanner: Remove global version check

libwayland-server ensures that the requested version is less than or
equal to the global version.

This change removes the global version check to simplify the generated
code and reduce memory usage footprint, however the latter shouldn't be
that noticeable.
This commit is contained in:
Vlad Zahorodnii 2021-05-12 14:41:15 +03:00
parent d9eb05c9a7
commit e4271a787f

View file

@ -645,7 +645,6 @@ bool Scanner::process()
printf(" struct ::wl_global *m_global;\n");
printf(" struct ::wl_display *m_display;\n");
printf(" struct wl_event_source *m_globalRemovedEvent;\n");
printf(" uint32_t m_globalVersion;\n");
printf(" struct DisplayDestroyedListener : ::wl_listener {\n");
printf(" %s *parent;\n", interfaceName);
printf(" };\n");
@ -794,7 +793,6 @@ bool Scanner::process()
printf(" {\n");
printf(" m_display = display;\n");
printf(" m_global = wl_global_create(display, &::%s_interface, version, this, bind_func);\n", interfaceName);
printf(" m_globalVersion = version;\n");
printf(" m_displayDestroyedListener.notify = %s::display_destroy_func;\n", interfaceName);
printf(" m_displayDestroyedListener.parent = this;\n");
printf(" wl_display_add_destroy_listener(display, &m_displayDestroyedListener);\n");
@ -831,7 +829,7 @@ bool Scanner::process()
printf(" void %s::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id)\n", interfaceName);
printf(" {\n");
printf(" %s *that = static_cast<%s *>(data);\n", interfaceName, interfaceName);
printf(" that->add(client, id, qMin(that->m_globalVersion, version));\n");
printf(" that->add(client, id, version);\n");
printf(" }\n");
printf("\n");