X-Git-Url: http://git.squeep.com/?p=dcpu16;a=blobdiff_plain;f=hw_keyboard.c;h=9d6c996484e4e0929fba91288c38db2b5b7ecd8f;hp=f69b8f4227e7eaa07a69ce7ffcfdc3ab9f5c0004;hb=052f0d9ed1165dabd061c8eac39c3be71184a5cf;hpb=1470698024f5511a3b94b7bb50b1097cc6659b32 diff --git a/hw_keyboard.c b/hw_keyboard.c index f69b8f4..9d6c996 100644 --- a/hw_keyboard.c +++ b/hw_keyboard.c @@ -71,7 +71,7 @@ void keyboard_rfbevent_(rfbBool down, rfbKeySym key, rfbClientPtr cl) { struct keyboard_ *keyboard = (struct keyboard_ *)hw->data; #ifdef DEBUG - hw->vm->msg_cb_(MSG_DEBUG, "%s>> down:%u rfb_key:0x%04x", down, key); + hw->vm->msg_cb_(DCPU16_MSG_DEBUG, "%s>> down:%u rfb_key:0x%04x", down, key); #endif /* DEBUG */ if (keysym_rfbtodcpu(key, &dcpu_key)) { @@ -82,7 +82,7 @@ void keyboard_rfbevent_(rfbBool down, rfbKeySym key, rfbClientPtr cl) { keyboard->keys_pressed[dcpu_key] = (down ? 1 : 0); if (down) { if ((keyboard->buf_tail + 1) % keyboard->buf_sz == keyboard->buf_head) { - hw->vm->msg_cb_(MSG_INFO, "keyboard buffer overflow"); + hw->vm->msg_cb_(DCPU16_MSG_INFO, "keyboard buffer overflow"); return; } keyboard->buf[keyboard->buf_tail] = dcpu_key; @@ -152,13 +152,13 @@ int keyboard_data_init_(struct dcpu16_hw *hw, void *data) { hw->data = calloc(1, sizeof(struct keyboard_)); if (hw->data == NULL) { - hw->vm->msg_cb_(MSG_ERROR, "%s():%s", "calloc", strerror(errno)); + hw->vm->msg_cb_(DCPU16_MSG_ERROR, "%s():%s", "calloc", strerror(errno)); return -1; } ((struct keyboard_ *)(hw->data))->buf = malloc(buf_sz * sizeof *((struct keyboard_ *)(hw->data))->buf); if (((struct keyboard_ *)(hw->data))->buf == NULL) { - hw->vm->msg_cb_(MSG_ERROR, "%s():%s", "malloc", strerror(errno)); + hw->vm->msg_cb_(DCPU16_MSG_ERROR, "%s():%s", "malloc", strerror(errno)); free(hw->data); hw->data = NULL; return -1; @@ -202,12 +202,12 @@ int keyboard_data_ctl_(struct dcpu16_hw *hw, const char *cmd, void *data_in, voi if (buf_sz_in) { #ifdef DEBUG - hw->vm->msg_cb_(MSG_DEBUG, "%s>> resizing buffer from %zu to %zu", __func__, keyboard->buf_sz, *buf_sz_in); + hw->vm->msg_cb_(DCPU16_MSG_DEBUG, "%s>> resizing buffer from %zu to %zu", __func__, keyboard->buf_sz, *buf_sz_in); #endif /* DEBUG */ tmp_ptr = realloc(keyboard->buf, *buf_sz_in); if (tmp_ptr == NULL) { - hw->vm->msg_cb_(MSG_DEBUG, "%s():%s", "realloc", strerror(errno)); + hw->vm->msg_cb_(DCPU16_MSG_DEBUG, "%s():%s", "realloc", strerror(errno)); return -1; } keyboard->buf = tmp_ptr;