Opened 9 years ago

Closed 9 years ago

Last modified 13 months ago

#9356 closed patch

AGI: Convert preagi_winnie macros to inline functions

Reported by: SF/agf863 Owned by: SF/mthreepwood
Priority: normal Component: Engine: AGI
Keywords: Cc:
Game:

Description

preagi_winnie.cpp uses macros to inline two functions, "setTakeDrop()" and "makeSel()". In C++ I believe it's considered proper to do this is with real inline functions. setTakeDrop also seems to use too much code for what it needs to do.

This trivial patch replaces the two #defines with inline functions, and simplifies setTakeDrop. It was tested with MinGW on Windows 7.

Ticket imported from: #3298149. Ticket imported from: patches/1461.

Attachments (1)

preagi_winnie_inline.patch (4.1 KB ) - added by SF/agf863 9 years ago.
Patch to convert preagi_winnie macros to inline functions

Download all attachments as: .zip

Change History (5)

by SF/agf863, 9 years ago

Attachment: preagi_winnie_inline.patch added

Patch to convert preagi_winnie macros to inline functions

comment:1 by SF/mthreepwood, 9 years ago

Owner: set to SF/mthreepwood

comment:2 by SF/mthreepwood, 9 years ago

Committed a modified patch in 8dd17a2ae11db5033d732d3f625ec48ab556f2f3.

The functions don't need to be inline as the compiler can optimize the functions as it sees fit in these instances. In addition, the macro vs. inline thing is only a preference; the patch was committed because it was cleaner.

comment:3 by SF/mthreepwood, 9 years ago

Status: newclosed

comment:4 by digitall, 13 months ago

Component: Engine: AGI
Note: See TracTickets for help on using tickets.