The R Project SVN R

Rev

Rev 26089 | Rev 26648 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26089 Rev 26136
Line 259... Line 259...
259
    }
259
    }
260
 
260
 
261
    PROTECT(matchedarg = cptr->promargs);
261
    PROTECT(matchedarg = cptr->promargs);
262
    PROTECT(newcall = duplicate(cptr->call));
262
    PROTECT(newcall = duplicate(cptr->call));
263
 
263
 
264
    class = R_data_class(obj, FALSE);
264
    PROTECT(class = R_data_class(obj, FALSE));
265
    nclass = length(class);
265
    nclass = length(class);
266
    for (i = 0; i < nclass; i++) {
266
    for (i = 0; i < nclass; i++) {
267
	if(strlen(generic) + strlen(CHAR(STRING_ELT(class, i))) + 2 > 512)
267
	if(strlen(generic) + strlen(CHAR(STRING_ELT(class, i))) + 2 > 512)
268
	    error("class name too long in %s", generic);
268
	    error("class name too long in %s", generic);
269
	sprintf(buf, "%s.%s", generic, CHAR(STRING_ELT(class, i)));
269
	sprintf(buf, "%s.%s", generic, CHAR(STRING_ELT(class, i)));
Line 297... Line 297...
297
	    t = newcall;
297
	    t = newcall;
298
	    SETCAR(t, method);
298
	    SETCAR(t, method);
299
	    R_GlobalContext->callflag = CTXT_GENERIC;
299
	    R_GlobalContext->callflag = CTXT_GENERIC;
300
	    *ans = applyMethod(t, sxp, matchedarg, rho, newrho);
300
	    *ans = applyMethod(t, sxp, matchedarg, rho, newrho);
301
	    R_GlobalContext->callflag = CTXT_RETURN;
301
	    R_GlobalContext->callflag = CTXT_RETURN;
302
	    UNPROTECT(4);
302
	    UNPROTECT(5);
303
	    return 1;
303
	    return 1;
304
	}
304
	}
305
    }
305
    }
306
    if(strlen(generic) + strlen("default") + 2 > 512)
306
    if(strlen(generic) + strlen("default") + 2 > 512)
307
	error("class name too long in %s", generic);
307
	error("class name too long in %s", generic);
Line 323... Line 323...
323
	t = newcall;
323
	t = newcall;
324
	SETCAR(t, method);
324
	SETCAR(t, method);
325
	R_GlobalContext->callflag = CTXT_GENERIC;
325
	R_GlobalContext->callflag = CTXT_GENERIC;
326
	*ans = applyMethod(t, sxp, matchedarg, rho, newrho);
326
	*ans = applyMethod(t, sxp, matchedarg, rho, newrho);
327
	R_GlobalContext->callflag = CTXT_RETURN;
327
	R_GlobalContext->callflag = CTXT_RETURN;
328
	UNPROTECT(4);
328
	UNPROTECT(5);
329
	return 1;
329
	return 1;
330
    }
330
    }
331
    UNPROTECT(4);
331
    UNPROTECT(5);
332
    cptr->callflag = CTXT_RETURN;
332
    cptr->callflag = CTXT_RETURN;
333
    return 0;
333
    return 0;
334
}
334
}
335
 
335
 
336
/* Note: "do_usemethod" is not the only entry point to */
336
/* Note: "do_usemethod" is not the only entry point to */