[Spice-devel] refactory and file names

Marc-André Lureau mlureau at redhat.com
Tue Nov 24 09:38:22 PST 2015



----- Original Message -----
> On 11/24/2015 05:52 PM, Frediano Ziglio wrote:
> >>
> >> Hi,
> >>
> >> On Mon, 2015-11-23 at 12:44 -0500, Frediano Ziglio wrote:
> >>> Hi,
> >>>    as part of the refactory there are some file renames. Actually
> >>> the patches with files renames where removed if the file was already
> >>> present and all new files has already the new names.
> >>>
> >>> The files should be (as the original changes) renamed like
> >>>
> >>> red_parse_qxl.c -> red-parse-qxl.c
> >>> red_record_qxl.c -> red-record-qxl.c
> >>> red_replay_qxl.c -> red-replay-qxl.c
> >>> red_parse_qxl.h -> red-parse-qxl.h
> >>> red_record_qxl.h -> red-record-qxl.h
> >>> red_replay_qxl.h -> red-replay-qxl.h
> >>> reds_stream.c -> reds-stream.c
> >>> reds_stream.h -> reds-stream.h
> >>> red_worker.h -> red-worker.h
> >>> red_worker.c -> red-worker.c
> >>> lz4_encoder.c -> lz4-encoder.c
> >>> lz4_encoder.h -> lz4-encoder.h
> >>> red_dispatcher.c -> red-dispatcher.c
> >>> red_dispatcher.h -> red-dispatcher.h
> >>> red_channel.c -> red-channel.c
> >>> red_channel.h -> red-channel.h
> >>> red_common.h -> common.h
> >>> red_client_cache.h -> cache_item.tmpl.c
> >>>
> >>> Also there are these patches
> >>> http://cgit.freedesktop.org/~fziglio/spice-server/commit/?h=refactory&id=d5ddf
> >>> 4c9d36c9b9238f86079f8668d38d911f54c
> >>> http://cgit.freedesktop.org/~fziglio/spice-server/commit/?h=refactory&id=ac2f5
> >>> 6d3faf64f0cb497c3245d2d997f235cdc87
> >>>
> >>> Now... what's the rationale of these patches?
> >>>
> >>> Prefer hyphen ('-') to underscore ('_') is surely one.
> >> I am ok with both, but spice-gtk uses '-' so maybe for the consistency...
> >> I
> >> am
> >> not sure if it is a strong enough argument.
> 
> I am ok with both, but would like justification.
> 
> Note that spice_style.pdf specifically mentions using
> underscore ('_') for file names.

spice_style.pdf is outdated in many ways, and too large, so hard to grasp. Furthermore, it's not in tree, so people don't go there.

Compare in size with: http://git.qemu.org/?p=qemu.git;a=blob_plain;f=CODING_STYLE;hb=HEAD

> It seems that gnome is using hyphen ('-').

And we are more and more align with gnome-style by using glib/gobject (however glib C-style is quite strange to me)

I dislike underscore in general, but it's indeed mostly by taste. 

he point of renaming for me is to have consistency. We had a mix of hyphen and underscore over time (even projects like spice-protocol have never been spice_protocol for instance).

See also http://blog.codinghorror.com/of-spaces-underscores-and-dashes/: dash is usually better.

> Alternatively we can rename spice-gtk files ;-)
> Also I think it's a good idea to keep sw_canvas as sw_canvas
> such that it's clear that other canvases are possible.

I don't follow, what meaning has the _ for you here?
 
cheers


More information about the Spice-devel mailing list