bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some remarks about ncurses


From: philippe blain
Subject: Some remarks about ncurses
Date: Thu, 25 Jan 2001 07:00:50 +0100

From Philippe Blain,
74, rue Notre Dame
33000 Bordeaux, FRANCE
My computer : P133 - 8,4Go - 32 Mo       Red Hat Linux 7.0
 
To the maintainers of 'ncurses'. (Mr Dickey ?)
Subject : Remarks for ncurses-5.2-20010114
 
Here are some problems I found :
 
--------------------------------------------------------------------------------
REMARKS ONLY !!!!!!!!!
File : ncurses/tty/tty_update.c
 
Function 'TransformLine':
 
This function is called only by 'doupdate()' and 'ClearUpdate()'.
 
We can decompose it in 3 parts :
    a) Treat terminals with 'ceol_standout_glitch' (xhp).
    b) Treat terminals with 'magic_cookie_glitch' (xmc).
    c) Treat other terminals.
 
I would point out some remarks about part c).
 
'TransformLine' is the base function for refreshing the screen.
It's very complicated and I wonder why not using here 'firstchar' and
'lastchar', used everywhere in the library except here (don't know why ?).
 
Instead, a recherch for the first and last differing characters is performed.

So, this indicates that you are not sure of 'firstchar' and 'lastchar', that
possibly have not been set correctly somewhere.
 
There is also here a double calcul over the line:
looking for the first and last non-blank in order to use 'clr_bol' and 'clr_eol'.
In fact, 'firstnonblank' and 'lastnonblank' appear AS IMPORTANT AS
'firstdifferingchar' and 'lastdifferingchar'.
 

So, I think there is a possibly for some optimization here by knowing
by advance the correct position of this characters.

I don't know how, but I suggest you the idea.
This function needs to be better rewritten.
 
I suggest also to separe tests on characters position in old and new screen
from the tests concerning cost, and use only the first ones in 'TransformLine'
letting cost comparison in the basics functions such as ClrEOL, ClrBOL.
 

Function 'PutCharLR':
 
Think macro 'callPutChar' can be supressed and replaced by 'PutAttrChar'.
(This a relic of 'PutChar' after introducing 'PutCharLR' from 1.9.9g to 4.2)
 
--------------------------------------------------------------------------------
------ Philippe =:)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]