SQLite

Check-in [39786aa894]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change to mkopcodeh.awk to accomodate windows systems. (CVS 2257)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 39786aa894d620480661ed8867961f9f1ef33e40
User & Date: drh 2005-01-21 17:07:23.000
Context
2005-01-21
17:53
Initialize the random number generator from /dev/urandom, if available. (CVS 2258) (check-in: aab8e7f8d8 user: drh tags: trunk)
17:07
Change to mkopcodeh.awk to accomodate windows systems. (CVS 2257) (check-in: 39786aa894 user: drh tags: trunk)
17:03
Update change log for version 3.1.0. (CVS 2256) (check-in: 4d9b858746 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to mkopcodeh.awk.
35
36
37
38
39
40
41

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59




60

61
62
63
64
65
66
67
68
69
70
71
72
  gsub(/:/,"",name)
  gsub("\r","",name)
  op[name] = -1
  for(i=3; i<NF-2; i++){
    if($i=="same" && $(i+1)=="as"){
      op[name] = tk[$(i+2)]
      used[op[name]] = 1

    }
  }
}

# Assign numbers to all opcodes and output the result.
END {
  cnt = 0
  max = 0
  print "/* Automatically generated.  Do not edit */"
  print "/* See the mkopcodeh.awk script for details */"
  for(name in op){
    if( op[name]<0 ){
      cnt++
      while( used[cnt] ) cnt++
      op[name] = cnt
    }
    used[op[name]] = 1;
    if( op[name]>max ) max = op[name]




    printf "#define %-30s %d\n", name, op[name]

  }
  seenUnused = 0;
  for(i=1; i<max; i++){
    if( !used[i] ){
      if( !seenUnused ){
        printf "\n/* The following opcode values are never used */\n"
        seenUnused = 1
      }
      printf "/*#define OP_?          %d  -- Not Used */\n", i
    }
  }
}







>


















>
>
>
>
|
>








|



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  gsub(/:/,"",name)
  gsub("\r","",name)
  op[name] = -1
  for(i=3; i<NF-2; i++){
    if($i=="same" && $(i+1)=="as"){
      op[name] = tk[$(i+2)]
      used[op[name]] = 1
      sameas[op[name]] = $(i+2)
    }
  }
}

# Assign numbers to all opcodes and output the result.
END {
  cnt = 0
  max = 0
  print "/* Automatically generated.  Do not edit */"
  print "/* See the mkopcodeh.awk script for details */"
  for(name in op){
    if( op[name]<0 ){
      cnt++
      while( used[cnt] ) cnt++
      op[name] = cnt
    }
    used[op[name]] = 1;
    if( op[name]>max ) max = op[name]
    printf "#define %-25s %15d", name, op[name]
    if( sameas[op[name]] ) {
      printf "   /*same as %-12s*/", sameas[op[name]]
    } 
    printf "\n"

  }
  seenUnused = 0;
  for(i=1; i<max; i++){
    if( !used[i] ){
      if( !seenUnused ){
        printf "\n/* The following opcode values are never used */\n"
        seenUnused = 1
      }
      printf "#define %-25s %15d\n", sprintf( "OP_NotUsed_%-3d", i ), i
    }
  }
}