Remove dependency on simul-efuns {f_,}format_mixed

Bug #245722 reported by Cody A.W. Somerville on 2008-07-05
2
Affects Status Importance Assigned to Milestone
Sapidlib
Medium
Unassigned

Bug Description

Please remove dependency on simul-efuns format_mixed and f_format_mixed as they are deprecated. The correct path of migration is to use the (s)printf efun with the %O token (see (s)printf documentation for details). Components requiring functionality or depend on the formatting produced by format_mixed should re-implement desired functionality (please do not copy and paste existing efun - only implement parts that you require) locally. This simul-efun will be removed within the next week or so.

Related branches

Changed in sapidlib:
importance: Undecided → Medium
status: New → Triaged

I am quite aware of the %O token in the (s)printf efun. The output generated by that token doesn't handle buffers (it just shows <buffer>) whereas the sefun shows the data.

If I knew how to override the %O token in (s)printf I would do it that way.

On Fri, Jul 4, 2008 at 10:42 PM, Richard Harrison <email address hidden>
wrote:

> I am quite aware of the %O token in the (s)printf efun. The output
> generated by that token doesn't handle buffers (it just shows <buffer>)
> whereas the sefun shows the data.
>
> If I knew how to override the %O token in (s)printf I would do it that
> way.

As I (feared) suspected, it doesn't handle all data types. For cases that do
work, please use (s)printf efun. The simul-efun won't actually be removed
until all dependencies are lifted. The ideal solution IMHO would be to file
a RFE with the driver maintainers but as we know only one driver has an
active maintainer (although since we already patch the drivers, we might
just port the patch but I'd prefer we try as close to vanilla as possible).
An alternate solution would to be create a simul-efun specifically for
printing out buffers OR create a helper object for common string type stuff
like this.

In conclusion, I think we need to have a BoF regarding simul-efuns, helper
objects, etc. to come up with solid criteria and definitions.

Cheers,

>
>
> --
> Remove dependency on simul-efuns {f_,}format_mixed
> https://bugs.launchpad.net/bugs/245722
> You received this bug notification because you are a member of Sapidlib
> Developers, which is subscribed to Sapidlib.
>

--
Cody A.W. Somerville
Software Engineer
Red Cow Marketing & Technologies, Inc.
Office: 506-458-1290
Toll Free: 1-877-733-2699
Fax: 506-453-9112
Cell: 506-449-5899
Email: <email address hidden>
http://www.redcow.ca

After a bit of thought I came up with a method of overriding the %O token. The sefun scans the format string and changes all %[modifier]O tokens to %[modifier]s tokens and also changes the corresponding argument to fomat_mixed(arg).

It's seems to be working ok on Rock the Halo.

Fix committed in branch 76

Changed in sapidlib:
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers