コード例 #1
0
ファイル: cover.c プロジェクト: rbong/jmc
// external functions
SDL_Surface *get_cover (struct mpd_song *song)
{
    if (song == NULL)
        return NULL;
    char *file = get_path_mpd (song);
    SDL_Surface *sur = NULL;

    if (local)
    {
        sur = load_local (file);
        if (sur == NULL && verbose)
            printf ("%s: no local covers in the same folder as %s\n",
                    prog, file);
        else if (sur != NULL)
        {
            free (file);
            return sur;
        }
    }

    if (embedded)
    {
        sur = load_embedded (file);
        if (sur == NULL && verbose)
            printf ("%s: no embedded covers in%s\n", prog, file);
        else if (sur != NULL)
        {
            free (file);
            return sur;
        }
    }

    free (file);
    return sur;
}
コード例 #2
0
void BytecodeClosure::aload_0_fast_get_field_n(int bytecode JVM_TRAPS) {
  load_local(T_OBJECT, 0 JVM_CHECK);

  const static jbyte types[4] = {T_OBJECT, T_INT, T_OBJECT, T_INT};
  const static jbyte sizes[4] = {4, 4, 8, 8};
  const int index = bytecode - Bytecodes::_aload_0_fast_agetfield_4;

  BasicType field_type = (BasicType)types[index];
  int offset = (int)sizes[index];
  fast_get_field(field_type, offset JVM_CHECK);
}
コード例 #3
0
ファイル: codegen.c プロジェクト: ras52/bootstrap
/* Code for leaf nodes in the expression parse tree: constants, strings,
 * identifers, and so on.  */
static
leaf_code(stream, node, need_lval) {
    if ( node[0] == 'num' || node[0] == 'chr' || node[0] == 'str' ) {
        if (node[0] == 'num') load_num(stream, node[3]);
        else if (node[0] == 'chr') load_chr(stream, &node[3]);
        else if (node[0] == 'str') {
            auto lc = new_clabel();
            defn_str(stream, &node[3], lc);
            load_str(stream, lc);
        }
    }

    else if ( node[0] == 'id' ) {
        auto off, is_lval = lookup_sym( &node[3], &off );
        auto need_addr = (is_lval == need_lval);

        if (!off) load_symbol(stream, &node[3], need_addr);
        else load_local(stream, off, need_addr);
    }

    else int_error("Unknown token '%Mc' in parse tree", node[0]);
}
コード例 #4
0
void BytecodeClosure::aload_0_fast_get_field_1(BasicType field_type JVM_TRAPS){
  load_local(T_OBJECT, 0 JVM_CHECK);
  int offset = method()->get_ubyte(_bci+1) * BytesPerWord;
  fast_get_field(field_type, offset JVM_CHECK);
}