From patchwork Mon Jun 20 22:58:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2091 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DFDEC23E52 for ; Mon, 20 Jun 2011 22:58:53 +0000 (UTC) Received: from mail-vw0-f52.google.com (mail-vw0-f52.google.com [209.85.212.52]) by fiordland.canonical.com (Postfix) with ESMTP id B0538A182D4 for ; Mon, 20 Jun 2011 22:58:53 +0000 (UTC) Received: by mail-vw0-f52.google.com with SMTP id 16so4124077vws.11 for ; Mon, 20 Jun 2011 15:58:53 -0700 (PDT) Received: by 10.52.161.65 with SMTP id xq1mr502358vdb.167.1308610733374; Mon, 20 Jun 2011 15:58:53 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs32800vdc; Mon, 20 Jun 2011 15:58:53 -0700 (PDT) Received: by 10.227.5.194 with SMTP id 2mr5654652wbw.93.1308610732332; Mon, 20 Jun 2011 15:58:52 -0700 (PDT) Received: from smtp.smtpout.orange.fr (smtp03.smtpout.orange.fr [80.12.242.125]) by mx.google.com with ESMTP id p18si10279567wbh.40.2011.06.20.15.58.51; Mon, 20 Jun 2011 15:58:52 -0700 (PDT) Received-SPF: neutral (google.com: 80.12.242.125 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=80.12.242.125; Authentication-Results: mx.google.com; spf=neutral (google.com: 80.12.242.125 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: from monster.dhcp.lxc ([92.134.95.191]) by mwinf5d06 with ME id yNyp1g00347kPVY03NyrCn; Tue, 21 Jun 2011 00:58:51 +0200 From: Daniel Lezcano To: linaro-dev@lists.linaro.org Subject: [powerdebug 04/17] remove useless definition Date: Tue, 21 Jun 2011 00:58:12 +0200 Message-Id: <1308610705-23281-4-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1308610705-23281-1-git-send-email-daniel.lezcano@linaro.org> References: <1308610705-23281-1-git-send-email-daniel.lezcano@linaro.org> Remove the 'print' wrapper which inverts the screen coordinate. This is opposite to the ncurses function convention and may lead to wrong code. Signed-off-by: Daniel Lezcano --- display.c | 38 ++++++++++++++++++-------------------- 1 files changed, 18 insertions(+), 20 deletions(-) diff --git a/display.c b/display.c index 80663a7..1af12a3 100644 --- a/display.c +++ b/display.c @@ -22,8 +22,6 @@ #include "regulator.h" #include "display.h" -#define print(w, x, y, fmt, args...) do { mvwprintw(w, y, x, fmt, ##args); } while (0) - enum { PT_COLOR_DEFAULT = 1, PT_COLOR_HEADER_BAR, PT_COLOR_ERROR, @@ -84,7 +82,7 @@ static int show_header_footer(int win) wbkgd(header_win, COLOR_PAIR(PT_COLOR_HEADER_BAR)); werase(header_win); - print(header_win, curr_pointer, 0, "PowerDebug %s", VERSION); + mvwprintw(header_win, 0, curr_pointer, "PowerDebug %s", VERSION); curr_pointer += 20; for (i = 0; i < array_size; i++) { @@ -93,14 +91,14 @@ static int show_header_footer(int win) else wattroff(header_win, A_REVERSE); - print(header_win, curr_pointer, 0, " %s ", windata[i].name); + mvwprintw(header_win, 0, curr_pointer, " %s ", windata[i].name); curr_pointer += strlen(windata[i].name) + 2; } wrefresh(header_win); werase(footer_win); wattron(footer_win, A_REVERSE); - print(footer_win, 0, 0, "%s", footer_label); + mvwprintw(footer_win, 0, 0, "%s", footer_label); wattroff(footer_win, A_REVERSE); wrefresh(footer_win); @@ -376,14 +374,14 @@ void print_regulator_header(void) { werase(main_win); wattron(main_win, A_BOLD); - print(main_win, 0, 0, "Name"); - print(main_win, 12, 0, "Status"); - print(main_win, 24, 0, "State"); - print(main_win, 36, 0, "Type"); - print(main_win, 48, 0, "Users"); - print(main_win, 60, 0, "Microvolts"); - print(main_win, 72, 0, "Min u-volts"); - print(main_win, 84, 0, "Max u-volts"); + mvwprintw(main_win, 0, 0, "Name"); + mvwprintw(main_win, 0, 12, "Status"); + mvwprintw(main_win, 0, 24, "State"); + mvwprintw(main_win, 0, 36, "Type"); + mvwprintw(main_win, 0, 48, "Users"); + mvwprintw(main_win, 0, 60, "Microvolts"); + mvwprintw(main_win, 0, 72, "Min u-volts"); + mvwprintw(main_win, 0, 84, "Max u-volts"); wattroff(main_win, A_BOLD); wrefresh(main_win); @@ -394,11 +392,11 @@ void print_clock_header(void) { werase(main_win); wattron(main_win, A_BOLD); - print(main_win, 0, 0, "Name"); - print(main_win, 56, 0, "Flags"); - print(main_win, 75, 0, "Rate"); - print(main_win, 88, 0, "Usecount"); - print(main_win, 98, 0, "Children"); + mvwprintw(main_win, 0, 0, "Name"); + mvwprintw(main_win, 0, 56, "Flags"); + mvwprintw(main_win, 0, 75, "Rate"); + mvwprintw(main_win, 0, 88, "Usecount"); + mvwprintw(main_win, 0, 98, "Children"); wattroff(main_win, A_BOLD); wrefresh(main_win); @@ -409,8 +407,8 @@ void print_sensor_header(void) { werase(main_win); wattron(main_win, A_BOLD); - print(main_win, 0, 0, "Name"); - print(main_win, 36, 0, "Value"); + mvwprintw(main_win, 0, 0, "Name"); + mvwprintw(main_win, 0, 36, "Value"); wattroff(main_win, A_BOLD); wrefresh(main_win);