Ticket #1845 (closed task: fixed)

Opened 15 years ago

Last modified 15 years ago

Code cleanup before 4.7.0 release.

Reported by: slavazanko Owned by: slavazanko
Priority: major Milestone: 4.7.0
Component: mc-core Version: master
Keywords: code cleanup Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

Need to create branch with code cleanup(refatoring) for little changesets to avoid creating new ticket (with branch and votes) for any little patchset.

Change History

comment:1 Changed 15 years ago by slavazanko

  • Status changed from new to accepted
  • severity changed from no branch to on rework

Created branch 1845_code_cleanup

Initial changeset not specified, because this branch will rebased often (after any code changes in master). Just switch to this branch and review.

Now branch in 'on rework' stage until changes into 'master' branch will frozen (day before release).

comment:2 Changed 15 years ago by slavazanko

Added patch by Oswald Buddenhagen for refactoring src/filehighlight/get-color.c:c_fhl_is_stale_link() function:

diff --git a/src/filehighlight/get-color.c b/src/filehighlight/get-color.c
index a87ed63..a56811d 100644
--- a/src/filehighlight/get-color.c
+++ b/src/filehighlight/get-color.c
@@ -88,9 +88,7 @@ mc_fhl_is_link_to_dir (file_entry * fe)
 inline static gboolean
 mc_fhl_is_stale_link (file_entry * fe)
 {
-    gboolean is_link = mc_fhl_is_link (fe);
-
-    return (!is_link && !mc_fhl_is_file (fe)) || (is_link && (fe->f.stale_link));
+    return mc_fhl_is_link (fe) ? fe->f.stale_link : !mc_fhl_is_file (fe);
 }

 inline static gboolean

comment:3 Changed 15 years ago by andrew_b

  • Blocked By 1865 added

(In #1865) Don't create new tickets for some simple refactoring. Collect your patches in #1845.

comment:4 Changed 15 years ago by andrew_b

  • Blocked By 1861 added

comment:5 Changed 15 years ago by andrew_b

  • Blocked By 1857 added

comment:6 Changed 15 years ago by andrew_b

  • Blocked By 1855 added

comment:7 follow-up: ↓ 8 Changed 15 years ago by zaytsev

On clean install (rm -rf ~/.mc) and first start not all of the configuration variables are initialized.

1) Find file dialog (start at should be ".")
2) Find file dialog (file name should be "*")
3) Options, VFS (ftpfs directory cache timeout: -> not � !)

Please check if all the config variables are properly initialized and saved.

comment:8 in reply to: ↑ 7 Changed 15 years ago by andrew_b

Replying to zaytsev:

3) Options, VFS (ftpfs directory cache timeout: -> not � !)

Fixed in changeset:aa0db5d92dd7a6ba8d5346a8aefcda2576a9c76b

comment:9 Changed 15 years ago by andrew_b

  • Blocked By 1865 removed

(In #1865) Applied in #1845.

comment:10 Changed 15 years ago by andrew_b

  • Summary changed from Code cleanup before release. to Code cleanup before 4.7.0 release.

comment:11 Changed 15 years ago by slavazanko

  • Blocked By 1855 removed

(In #1855) Will applied into 1845

comment:12 Changed 15 years ago by slavazanko

  • Blocked By 1861 removed

(In #1861) Will applied into #1845

comment:13 Changed 15 years ago by angel_il

  • Blocked By 1872 added

comment:14 Changed 15 years ago by angel_il

  • Blocked By 1872 removed

comment:15 follow-up: ↓ 19 Changed 15 years ago by metux

Breaks all test builds at my site:

Making all in extfs
make[3]: Entering directory `/home/crosstool/tree/freemc/testfarm/1845_code_cleanup.git/vfs/extfs'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/crosstool/tree/freemc/testfarm/1845_code_cleanup.git/vfs/extfs'
make[3]: Entering directory `/home/crosstool/tree/freemc/testfarm/1845_code_cleanup.git/vfs'
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I.. -fdiagnostics-show-option -W
comment -Wdeclaration-after-statement -Wformat -Wimplicit-function-declaration -Wimplicit-int -Wmissing-braces -Wmissing-declaratio
ns -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wno-long-long -Wno-unreachable-code -Wparentheses -Wpointer-sign

-Wreturn-type -Wshadow -Wsign-compare -Wswitch -Wuninitialized -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value

-Wunused-variable -Wwrite-strings -Werror -Wwrite-strings -Wwrite-strings -MT tcputil.o -MD -MP -MF .deps/tcputil.Tpo -c -o tcputil.o tcputil.c
cc1: warnings being treated as errors
cc1: error: -Wuninitialized is not supported without -O [-Wuninitialized]
make[3]: * [tcputil.o] Error 1
make[3]: Leaving directory `/home/crosstool/tree/freemc/testfarm/1845_code_cleanup.git/vfs'
make[2]:
* [all-recursive] Error 1
make[2]: Leaving directory `/home/crosstool/tree/freemc/testfarm/1845_code_cleanup.git/vfs'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/home/crosstool/tree/freemc/testfarm/1845_code_cleanup.git'
make:
* [all] Error 2


comment:16 Changed 15 years ago by metux

  • Blocked By 1872 added

comment:17 Changed 15 years ago by andrew_b

  • Blocked By 1857 removed

comment:18 Changed 15 years ago by angel_il

  • Blocked By 1872 removed

comment:19 in reply to: ↑ 15 Changed 15 years ago by slavazanko

-Wunused-variable -Wwrite-strings -Werror -Wwrite-strings -Wwrite-strings -MT tcputil.o -MD > cc1: error: -Wuninitialized is not supported without -O [-Wuninitialized]

Yor CFLAGS contain '-Wwrite-strings -Wwrite-strings'
Try to compile with empty CFLAGS or add '-O' option to your CFLAGS

Also, no need for '-Wwrite-strings' option. This is added automatically

comment:20 Changed 15 years ago by slavazanko

  • severity changed from on rework to on review

comment:21 Changed 15 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:22 Changed 15 years ago by andrew_b

  • Votes for changeset changed from slavazanko to slavazanko andrew_b
  • severity changed from on review to approved

comment:23 Changed 15 years ago by slavazanko

  • Votes for changeset slavazanko andrew_b deleted
  • severity changed from approved to on rework

Branch 1845_code_cleanup now merged in master but not deleted (just rebased to new master).
Therefore branch 1845_code_cleanup now clean and ready for another cleanups.

comment:24 Changed 15 years ago by slavazanko

  • severity changed from on rework to on review

changesets in branch:

comment:25 Changed 15 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:26 Changed 15 years ago by andrew_b

  • Votes for changeset changed from slavazanko to slavazanko andrew_b
  • severity changed from on review to approved

comment:27 Changed 15 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko andrew_b to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:28 Changed 15 years ago by slavazanko

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.