Commit f66f7192 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

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.
parent 66f0798d
Pipeline #61649 passed with stage
in 5 minutes and 23 seconds
......@@ -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");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment