sockpuppet9527
V2EX  ›  问与答

今天看到 libfuse 的接口,我傻了 [手动狗头]

  •  
  •   sockpuppet9527 · Aug 4, 2020 · 1534 views
    This topic created in 2134 days ago, the information mentioned may be changed or developed.

    前情提要:/t/693941

    
    int (*read) (const char *, char *, size_t, off_t,
    	struct fuse_file_info *);
    	
    int (*fallocate) (const char *, int, off_t, off_t,
    	struct fuse_file_info *);
                  
    ssize_t (*copy_file_range) (const char *path_in,
    	struct fuse_file_info *fi_in,
    	off_t offset_in, const char *path_out,
    	struct fuse_file_info *fi_out,
    	off_t offset_out, size_t size, int flags);
        
    

    都是在 fuse_operations 接口中的方法,我想如果让我波兰的同事来提 cr 肯定是一万个 commons

    1. 为什么 read 用 size_t 表示 size,在 fallocate 用 off_t 表示 size 啊?
    2. 为什么有些地方参数有名字,有些地方不加啊?
    3. 为什么注释格式不一样啊?
    4. 为什么不用返回值啊?

    手动狗头保命。纯吐槽

    2 replies    2020-08-04 15:29:46 +08:00
    BingoXuan
        1
    BingoXuan  
       Aug 4, 2020
    可能作者不是一个人
    cjw1115
        2
    cjw1115  
       Aug 4, 2020
    哈哈 波兰人 code review 可是很严谨的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5596 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 03:44 · PVG 11:44 · LAX 20:44 · JFK 23:44
    ♥ Do have faith in what you're doing.