pike.git / src / modules / _Stdio / sendfile.c

version» Context lines:

pike.git/src/modules/_Stdio/sendfile.c:911:       /* Fix the trailing args */    push_array(sf.args = aggregate_array(args-7));    args = 8;       /* FIXME: Ought to fix fp so that the backtraces look right. */       /* Check that we're called with the right kind of objects. */    if (sf.to_file->prog == file_program) {    sf.to = (struct my_file *)(sf.to_file->storage); -  } else if (!(sf.to = (struct my_file *)get_storage(sf.to_file, +  } else if (!(sf.to = get_storage(sf.to_file,    file_program))) {    struct svalue *sval; -  if (!(sval = (struct svalue *)get_storage(sf.to_file, file_ref_program)) || +  if (!(sval = get_storage(sf.to_file, file_ref_program)) ||    (TYPEOF(*sval) != T_OBJECT) || -  !(sf.to = (struct my_file *)get_storage(sval->u.object, file_program))) { +  !(sf.to = get_storage(sval->u.object, file_program))) {    SIMPLE_BAD_ARG_ERROR("sendfile", 6, "object(Stdio.File)");    }    add_ref(sval->u.object);   #ifdef PIKE_DEBUG    if ((TYPEOF(sp[5-args]) != T_OBJECT) ||    (sp[5-args].u.object != sf.to_file)) {    Pike_fatal("sendfile: Stack out of sync(1).\n");    }   #endif /* PIKE_DEBUG */    sf.to_file = sval->u.object;
pike.git/src/modules/_Stdio/sendfile.c:948:    /* NOTE: We need to zap from_file from the stack too. */    free_object(sf.from_file);    sf.from_file = NULL;    sf.from = NULL;    SET_SVAL(sp[1-args], T_INT, NUMBER_NUMBER, integer, 0);    }       if (sf.from_file) {    if (sf.from_file->prog == file_program) {    sf.from = (struct my_file *)(sf.from_file->storage); -  } else if (!(sf.from = (struct my_file *)get_storage(sf.from_file, +  } else if (!(sf.from = get_storage(sf.from_file,    file_program))) {    struct svalue *sval; -  if (!(sval = (struct svalue *)get_storage(sf.from_file, +  if (!(sval = get_storage(sf.from_file,    file_ref_program)) ||    !(TYPEOF(*sval) != T_OBJECT) || -  !(sf.from = (struct my_file *)get_storage(sval->u.object, file_program))) { +  !(sf.from = get_storage(sval->u.object, file_program))) {    SIMPLE_BAD_ARG_ERROR("sendfile", 2, "object(Stdio.File)");    }    add_ref(sval->u.object);   #ifdef PIKE_DEBUG    if ((TYPEOF(sp[1-args]) != T_OBJECT) ||    (sp[1-args].u.object != sf.from_file)) {    Pike_fatal("sendfile: Stack out of sync(2).\n");    }   #endif /* PIKE_DEBUG */    sf.from_file = sval->u.object;