[XviD-devel] [BUG]

Edouard Gomez ed.gomez at free.fr
Mon Oct 27 17:28:32 CET 2003


skal (skal at planet-d.net) wrote:
> (btw: please,  very please,  don't replace spaces  by tabs. This  is a
> very Bad Habit).

Arf grrmmpf, a bit late, I spent  all my afternoon to indent all the asm
code the same way... I'll do a pass of M-x untabify all over the buffers.

Btw using tabs  is not a bad  habit, it's just a troll  topic for insane
people using spaces ;-)

Anyway, the  bitch work i've  done today was  to be done,  because there
were very ugly, unreadable files (in particular the optimized 3dne). And
tabs (one or two  depending on the file) seemed to be  the more used way
of indenting code.

Style i used this afternoon is:
BITS 32
SECTION .rodata  ; as  we do thread  safe code,  no other type  of .data
                 ; section should be used
label:
tab db 1,2,3,4
or (if this looks better)
label: space db space data

SECTION .text

cglobal func1
cglobal func2
cglobal func3

ALIGN 16
func1:
tab opcode (tab)+ operand[, operand]*
            ^
            depending on the larger opcode of the code unit

tabs are width==4 as all the rest of XviD sources.

And for people using emacs:

(defun xvid-asm-mode ()
"ASM mode for XviD"
(interactive)
(asm-mode)
(message "Loading xvid-asm-mode")
(setq mode-name "XviD ASM")
(setq tab-width 4)
(setq tab-stop-list (loop for i from 4 to 120 by 4 collect i))
)
(setq auto-mode-alist
      (cons '("/.*/xvidcore.*/.*\\.asm$" . xvid-asm-mode)
       auto-mode-alist))

I'll probably have to add:
(setq indent-tabs-mode nil) to use spaces *sic* *cough*

Are you really sure you want spaces ?

-- 
Edouard Gomez


More information about the XviD-devel mailing list