[CRIU] [RFC 0/6] Headers mocking

Pavel Emelyanov xemul at parallels.com
Mon Dec 24 06:36:58 EST 2012


On 12/22/2012 10:22 PM, Cyrill Gorcunov wrote:
> Hi guys,
> 
> while been thinking on parasite rework I've noticed that
> we have a kind mess in our headers #define's. Here is a
> series which unifies the naming. The idea is to make
> headers consist of
> 
> #ifndef CR_some-name-here_H__
> #define CR_some-name-here_H__
> 
> ...
> 
> #endif /* CR_some-name-here_H__ */
> 
> I believe this will help headers transition in arch
> specific sake as well.

The #ifndef/#define part could be done a) w/o patch set of 5 patches
and b) *reliably* with a single sed command

for i in include/*.h ; do sed -e '1,2s/#\(ifndef\|define\) _\?_\?\(CR_\)\?/#\1 __CR_/' -e '1,2s/_H_\?_\?.*$/_H__/' -i $i; done

I'm committing this one instead.

> Cyrill Gorcunov (6):
>   headers: Add missing slashes for headers guards
>   header: Drop redundant macro assignment
>   headers: Add CR_ prefix where needed
>   compiler.h: Drop redundant \Space
>   parasite-syscall.h: Get rid of redundant \Space
>   headers: Add ending comment for include guard
> 
>  include/atomic.h           |  6 +++---
>  include/bitops.h           |  6 +++---
>  include/compiler.h         |  8 ++++----
>  include/cpu.h              |  6 +++---
>  include/crtools.h          |  6 +++---
>  include/eventfd.h          |  6 +++---
>  include/eventpoll.h        |  6 +++---
>  include/fifo.h             |  6 +++---
>  include/file-ids.h         |  6 +++---
>  include/files-reg.h        |  6 +++---
>  include/files.h            |  6 +++---
>  include/fpu.h              |  6 +++---
>  include/image.h            |  6 +++---
>  include/inet_diag.h        |  6 +++---
>  include/inotify.h          |  6 +++---
>  include/ipc_ns.h           |  6 +++---
>  include/kcmp-ids.h         |  6 +++---
>  include/libnetlink.h       |  6 +++---
>  include/linkage.h          |  6 +++---
>  include/list.h             |  6 +++---
>  include/lock.h             |  6 +++---
>  include/log-levels.h       |  6 +++---
>  include/log.h              |  6 +++---
>  include/memcpy_64.h        |  6 +++---
>  include/mount.h            |  7 ++++---
>  include/namespaces.h       |  7 ++++---
>  include/net.h              |  7 ++++---
>  include/netfilter.h        |  7 ++++---
>  include/packet_diag.h      |  6 +++---
>  include/parasite-syscall.h | 14 +++++++-------
>  include/parasite.h         |  7 ++++---
>  include/pipes.h            |  6 +++---
>  include/proc_parse.h       |  6 +++---
>  include/protobuf.h         |  7 ++++---
>  include/pstree.h           |  8 +++++---
>  include/ptrace.h           |  6 +++---
>  include/rbtree.h           |  6 +++---
>  include/shmem.h            |  7 ++++---
>  include/signalfd.h         |  8 +++++---
>  include/sk-inet.h          |  7 ++++---
>  include/sk-packet.h        |  6 +++---
>  include/sk-queue.h         |  6 +++---
>  include/syscall-types.h    |  6 +++---
>  include/sysctl.h           |  6 +++---
>  include/types.h            |  6 +++---
>  include/unix_diag.h        |  6 +++---
>  include/util-net.h         |  6 +++---
>  include/util.h             |  6 +++---
>  include/uts_ns.h           |  6 +++---
>  49 files changed, 164 insertions(+), 152 deletions(-)
> 




More information about the CRIU mailing list