Changeset 5132379 in mainline


Ignore:
Timestamp:
2024-10-03T21:31:52Z (7 days ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
47d060d, 8c4120d
Parents:
e273e9e
Message:

A list is sometimes just a list.

Location:
uspace/srv/hid/remcons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/remcons/remcons.c

    re273e9e r5132379  
    3434 */
    3535
    36 #include <adt/prodcons.h>
     36#include <adt/list.h>
    3737#include <as.h>
    3838#include <async.h>
     
    369369        size_t nread;
    370370
    371         while (list_empty(&remcons->in_events.list)) {
     371        while (list_empty(&remcons->in_events)) {
    372372                char next_byte = 0;
    373373
     
    380380        }
    381381
    382         link_t *link = prodcons_consume(&remcons->in_events);
     382        link_t *link = list_first(&remcons->in_events);
     383        list_remove(link);
     384
    383385        remcons_event_t *tmp = list_get_instance(link, remcons_event_t, link);
    384386
     
    591593        assert(down);
    592594        assert(up);
    593         prodcons_produce(&remcons->in_events, &down->link);
    594         prodcons_produce(&remcons->in_events, &up->link);
     595        list_append(&down->link, &remcons->in_events);
     596        list_append(&up->link, &remcons->in_events);
    595597}
    596598
     
    611613        remcons->enable_rgb = !no_ctl && !no_rgb;
    612614        remcons->user = user;
    613         prodcons_initialize(&remcons->in_events);
     615        list_initialize(&remcons->in_events);
    614616
    615617        if (remcons->enable_ctl) {
  • uspace/srv/hid/remcons/remcons.h

    re273e9e r5132379  
    3737#define REMCONS_H_
    3838
    39 #include <adt/prodcons.h>
     39#include <adt/list.h>
    4040#include <io/kbd_event.h>
    4141#include <stdbool.h>
     
    5757        bool curs_visible;      /**< cursor is visible */
    5858
    59         /** Producer-consumer of remcons_event_t. */
    60         prodcons_t in_events;
     59        /** List of remcons_event_t. */
     60        list_t in_events;
    6161} remcons_t;
    6262
Note: See TracChangeset for help on using the changeset viewer.