Ticket #1976 (new defect)

Opened 9 years ago

Last modified 7 years ago

unifying some declarations in src dir

Reported by: vit_r Owned by:
Priority: trivial Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description (last modified by slyfox) (diff)

Example

replacing

//  some  chars

    int line
    int start_line

by

/*  some  chars  */

    long line
    long start_line

Attachments

1976-unifying-some-declarations-in-src-dir.patch (14.2 KB) - added by vit_r 9 years ago.
trivial changes in some src-dir C-files

Change History

Changed 9 years ago by vit_r

trivial changes in some src-dir C-files

comment:1 follow-up: ↓ 2 Changed 9 years ago by slyfox

  • Description modified (diff)
  1. Why long, but not off_t?

2.

---MC_FLHGH_FTYPE_T_SPECIAL_DOOR, 
+++MC_FLHGH_FTYPE_T_SPECIAL_DOOR 

Wtf? Trailing comma is legal (and consistent with other declarations),
so appending new enum entries patch will affect only new strings.

3.

mcview__get_nroff_real_len (mcview_t * view, off_t start, off_t length)
mcview_get_nroff_real_len (mcview_t * view, off_t start, off_t length)

What was the point ?

Guess, You didn't see mc_search _ _ * set of functions.
It's kind of ${subsystem} _ _ ${local_name}. Maybe, it
should be documented somewhere in code style guidelines.

Thanks.

comment:2 in reply to: ↑ 1 ; follow-up: ↓ 3 Changed 9 years ago by vit_r

Replying to slyfox:

  1. Why long, but not off_t?

'long' because of edit/edit-widget.h:
long total_lines; /* total lines in the file */, etc

would be better 'off_t', meanwhile majority is still 'long'

And similar patch 1825 was partially merged (as i remember)


2.

---MC_FLHGH_FTYPE_T_SPECIAL_DOOR, 
+++MC_FLHGH_FTYPE_T_SPECIAL_DOOR 

Wtf?

i'm learning
Next adding
CFLAGS=" -pedantic -ansi " ./configure --enable-maintainer-mode
brings warning about comma. Nothing to worry about..
My task as i see (from my low level) is to bring as much as possible
Experts will choose
If only one line will be accepted - great !
I like MC so much..
If everything will be rejected (for a while) its OK
Time is coming when something
Au - and You are an expert ! Yes, of course
Then have a look please:

/usr/include/asm/ioctls.h == /usr/include/asm-x86/ioctls.h
#define TIOCLINUX	0x541C
--

src/tty/key.c
#if defined __linux__ || (defined __CYGWIN__ && defined TIOCLINUX)
    {
        unsigned char modifiers = 6;

        if (ioctl (0, TIOCLINUX, &modifiers) < 0)
            return 0;

The problem start:
ioctls.h is _NOT_ included at all in C-code
I tried to include, but in vain, such a pity..

Can You dig it ? IT IS REALLY IMPORTANT

PLEASE

3.
mcviewget_nroff_real_len (mcview_t * view, off_t start, off_t length)
Guess, You didn't see mc_search _ _ * set of functions.

Your Guess is correct

Thanks a lot

Your letter usefully touched me

ps

If You'll dig TIOCLINUX make a patch just at once
Please

pps
Sorry for my broken eng

comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 Changed 9 years ago by andrew_b

Replying to vit_r:

Then have a look please:

/usr/include/asm/ioctls.h == /usr/include/asm-x86/ioctls.h
#define TIOCLINUX	0x541C
--

src/tty/key.c
#if defined __linux__ || (defined __CYGWIN__ && defined TIOCLINUX)
    {
        unsigned char modifiers = 6;

        if (ioctl (0, TIOCLINUX, &modifiers) < 0)
            return 0;

The problem start:
ioctls.h is _NOT_ included at all in C-code

TIOCLINUX is being checked for CYGWIN not for Linux.

I tried to include, but in vain, such a pity..

I think you don't need direct include kernel headers in MC.

Can You dig it ? IT IS REALLY IMPORTANT

I believe that TIOCLINUX is defined in Cygwin in proper file.

comment:4 in reply to: ↑ 3 Changed 9 years ago by vit_r

Next line

src/tty/key.c:825:
#if defined __linux__ || (defined __CYGWIN__ && defined TIOCLINUX)

says "#if defined linux *OR* (defined CYGWIN && defined TIOCLINUX)"

On my Slack 13,0 unobvios problem exist ( much more than 99% chances its there ! )

Can Your look once more please

Meanwhile i'll try a deeper check

Thank You for spending time

comment:5 Changed 7 years ago by andrew_b

  • Version changed from version not selected to master
  • Branch state set to no branch
  • Milestone changed from 4.7 to Future Releases
Note: See TracTickets for help on using tickets.