X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/dea4d05507e59ab779ed4bb209e05971d87e260c..180bfa7ca8efeb1297a0bc3f0ff55b02b4e40f9b:/lib/sod.c diff --git a/lib/sod.c b/lib/sod.c index bd600f9..7c2336d 100644 --- a/lib/sod.c +++ b/lib/sod.c @@ -9,19 +9,20 @@ * * This file is part of the Sensble Object Design, an object system for C. * - * SOD is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * The SOD Runtime Library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. * - * SOD is distributed in the hope that it will be useful, + * The SOD Runtime is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with SOD; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU Library General Public + * License along with SOD; if not, write to the Free + * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. */ /*----- Header files ------------------------------------------------------*/ @@ -108,16 +109,15 @@ int sod_subclassp(const SodClass *sub, const SodClass *super) * to know what C or S actually are. */ -void *sod_convert(const SodClass *cls, void *p) +void *sod_convert(const SodClass *cls, const void *obj) { - const struct sod_instance *inst = p; + const struct sod_instance *inst = obj; const struct sod_vtable *vt = inst->_vt; const SodClass *realcls = vt->_class; const struct sod_chain *chain = find_chain(realcls, cls); - if (!chain) - return (0); - return ((char *)p - vt->_base + chain->off_ichain); + if (!chain) return (0); + return ((char *)obj - vt->_base + chain->off_ichain); } /*----- That's all, folks -------------------------------------------------*/