Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 06 Sep 2011 17:36:38 -0500 Message-ID: <4E66A076.3575@mindspring.com> Date: Tue, 06 Sep 2011 18:36:38 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: My latest magnum opus! References: <4E60142A.575D@mindspring.com> <0b156eba-fe6d-4e08-984a-be93ce4a7fc0@n12g2000yqh.googlegroups.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 30 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.156.228.85 X-Trace: sv3-GmnDM+2l+v1tY5WFwPAU5P5wddEPlC+azxT558+CFXtlkpJNpf1E5j158bxvw8gIPyj4REIP64OWwuy!qvDQRGJGKEcuWLQOm/BIKU6IsGOkPY0SdFvCSWHKAd10y2wahiZTwmpj+cEB35hiS1kEy68broLr!whrgzWD2cQ== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2084 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:9973 ImpalerCore wrote: > > On Sep 1, 7:24 pm, pete wrote: > > /* BEGIN block_swap_test.c */ > > /* > > ** block_swap swaps two contiguous subobjects. > > ** (base) is the address of the lower addressed subobject. > > ** (lo_size) is the size of the lower addressed subobject. > > ** (hi_size) is the size of the higher addressed subobject. > > ** If either (lo_size) or (hi_size) or both > > ** compare equal to zero, then no swapping takes place. > > */ > > #include > > > > #define STRING "0123456789A" > > > > void block_swap(void *base, size_t lo_size, size_t hi_size); > > Can someone explain in what context one would use this function? I > can't quite figure out where I would use such a function in a > practical setting. Maybe some kind of bit blit operation? > > I haven't read Programming Pearls, so maybe Jon Bentley gave some > background. I was thinking of using it in a stable, in place, version of mergesort. -- pete